IBlockDefinition

Link to iblockdefinition

IBlockDefinition 객체는 블럭의 추가정보를 제공합니다.

패키지 임포트하기

Link to 패키지-임포트하기

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import crafttweaker.block.IBlockDefinition;

IBlockDefinition 객체 호출

Link to iblockdefinition-객체-호출

  • IBlock 객체의 definition ZenGetter를 이용

IBlockDefinition 객체 호출

Link to iblockdefinition-객체-호출-1

  • Game.blocks을 사용하여 게임의 모든 블럭 정의 목록을 획득

ZenGetters/ZenSetters

Link to zengetterszensetters

ZenGetterZenSetter역할Type
ZenGetter
canSpawnInBlock
ZenSetter
역할
Returns true if an entity can spawn in this block
Type
bool
ZenGetter
creativeTab
ZenSetter
creativeTab
역할
Type
ICreativeTab
ZenGetter
defaultState
ZenSetter
역할
Type
IBlockState
ZenGetter
ZenSetter
defaultSlipperiness
역할
Type
float
ZenGetter
id
ZenSetter
역할
블럭 ID를 반환
Type
string
ZenGetter
displayName
ZenSetter
역할
블럭의 표시명을 반환
Type
string
ZenGetter
hardness
ZenSetter
hardness
역할
Type
int
ZenGetter
harvestLevel
ZenSetter
역할
블럭의 하베스트 레벨을 반환
Type
int
ZenGetter
harvestTool
ZenSetter
역할
블럭의 하베스트 가능 툴을 반환
Type
string
ZenGetter
lightOpacity
ZenSetter
lightOpacity
역할
Type
int
ZenGetter
lightLevel
ZenSetter
lightLevel
역할
Type
int
ZenGetter
resistance
ZenSetter
resistance
역할
Type
int
ZenGetter
unlocalizedName
ZenSetter
역할
번역되지 않은 블럭의 이름을 반환
Type
string
ZenGetter
tickRandomly
ZenSetter
tickRandomly
역할
Type
bool

블럭을 부수지 못하게 설정

Link to 블럭을-부수지-못하게-설정

Uses no paramaeters.
Returns nothing.
Does the same as hardness = -1;

ZenScript
Copy
defObj.setUnbreakable();

특정 월드의 틱 속도 얻기

Link to 특정-월드의-틱-속도-얻기

Uses an IWorld object.
Returns an int.

ZenScript
Copy
defObj.getTickRate(IWorld world);

블럭을 다른 블럭위에 위치할 수 있는지를 체크

Link to 블럭을-다른-블럭위에-위치할-수-있는지를--체크

Uses an IWorld object, an IBlockPos object and, depending on the method used, also an IFacing object.
Returns a bool.

ZenScript
Copy
defObj.canPlaceBlockOnSide(IWorld world, IBlockPos pos, IFacing facing);
defObj.canPlaceBlockAt(IWorld world, IBlockPos pos);

블럭의 미끄러움 정도를 얻기

Link to 블럭의-미끄러움-정도를-얻기

Uses an IBlockState, an IBlockAccess object, an IBlockPos and an optional IEntity object.
Returns a float.

ZenScript
Copy
defObj.getSlipperiness(IBlockState state, IBlockAccess access, IBlockPos pos, @Optional IEntity entity);

블럭의 하베스트 레벨을 설정

Link to 블럭의-하베스트-레벨을-설정

Uses a string, an int and an optional IBlockState.
if the IBlockState argument is ignored, it will set harvest level to all block states in the block definition.
Returns void (nothing).

ZenScript
Copy
defObj.setHarvestLevel(string toolclass, int level, @Optional IBlockState state);

Get harvest level of block state

Link to get-harvest-level-of-block-state

returns an int.

ZenScript
Copy
defObj.getHarvestLevel(IBlockState state);

Get harvest tool of block state

Link to get-harvest-tool-of-block-state

returns a string.

ZenScript
Copy
defObj.getHarvestTool(IBlockState state);

Get light opacity of block state

Link to get-light-opacity-of-block-state

returns a float.

ZenScript
Copy
defObj.getLightOpacity(IBlockState state);
defObj.getLightOpacity(IBlockState state, IWorld world, IBlockPos pos);

Get light level of block state

Link to get-light-level-of-block-state

returns a float.

ZenScript
Copy
defObj.getLightLevel(IBlockState state);
defObj.getLightLevel(IBlockState state, IWorld world, IBlockPos pos);

Get explosion resistance of block position and explosion

Link to get-explosion-resistance-of-block-position-and-explosion

returns a float.

ZenScript
Copy
defObj.getResistance(IWorld world, IBlockPos pos, IEntity entity, IExplosion explosion);

Get a block state by metadata

Link to get-a-block-state-by-metadata

Uses an int.
Returns an IBlockState.

ZenScript
Copy
defObj.getStateFromMeta(int meta);

Block effective for the tool

Link to block-effective-for-the-tool

Uses a string and an IBlockState.
Returns a bool.

ZenScript
Copy
defObj.isToolEffective(String type, IBlockState state);