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
- Воспользуйтесь геттером
definition
от объекта IBlock.
Получение списка объектов IBlockDefinition
Link to получение-списка-объектов-iblockdefinition
- Воспользуйтесь геттером
game.blocks
, чтобы получить все определения блоков в игре.
Геттеры/сеттеры
Link to геттерысеттеры
ZenGetter | ZenSetter | What does it do | Тип |
---|---|---|---|
ZenGetter canSpawnInBlock | ZenSetter | What does it do Returns true if an entity can spawn in this block | Тип bool |
ZenGetter creativeTab | ZenSetter creativeTab | What does it do | Тип ICreativeTab |
ZenGetter defaultState | ZenSetter | What does it do | Тип IBlockState |
ZenGetter | ZenSetter defaultSlipperiness | What does it do | Тип float |
ZenGetter id | ZenSetter | What does it do Возвращает ID блока | Тип string |
ZenGetter displayName | ZenSetter | What does it do Возвращает отображаемое имя блока | Тип string |
ZenGetter hardness | ZenSetter hardness | What does it do | Тип int |
ZenGetter harvestLevel | ZenSetter | What does it do Возвращает уровень добычи блока | Тип int |
ZenGetter harvestTool | ZenSetter | What does it do Возвращает инструмент для добычи этого блока | Тип string |
ZenGetter lightOpacity | ZenSetter lightOpacity | What does it do | Тип int |
ZenGetter lightLevel | ZenSetter lightLevel | What does it do | Тип int |
ZenGetter resistance | ZenSetter resistance | What does it do | Тип int |
ZenGetter unlocalizedName | ZenSetter | What does it do Возвращает нелокализованное имя блока | Тип string |
ZenGetter tickRandomly | ZenSetter tickRandomly | What does it do | Тип bool |
ZenMethods
Link to zenmethods
setUnbreakable
Link to setunbreakable
Uses no paramaeters.
Returns nothing.
Does the same as hardness = -1;
ZenScript CopydefObj.setUnbreakable();
getTickRate
Link to gettickrate
Uses an IWorld object.
Returns an int.
ZenScript CopydefObj.getTickRate(IWorld world);
canPlaceBlockAt, canPlaceBlockOnSide
Link to canplaceblockat-canplaceblockonside
Uses an IWorld object, an IBlockPos object and, depending on the method used, also an IFacing object.
Returns a bool.
ZenScript CopydefObj.canPlaceBlockOnSide(IWorld world, IBlockPos pos, IFacing facing);
defObj.canPlaceBlockAt(IWorld world, IBlockPos pos);
getSlipperiness
Link to getslipperiness
Uses an IBlockState, an IBlockAccess object, an IBlockPos and an optional IEntity object.
Returns a float.
ZenScript CopydefObj.getSlipperiness(IBlockState state, IBlockAccess access, IBlockPos pos, @Optional IEntity entity);
setHarvestLevel
Link to setharvestlevel
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 CopydefObj.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 CopydefObj.getHarvestLevel(IBlockState state);
Get harvest tool of block state
Link to get-harvest-tool-of-block-state
returns a string.
ZenScript CopydefObj.getHarvestTool(IBlockState state);
Get light opacity of block state
Link to get-light-opacity-of-block-state
returns a float.
ZenScript CopydefObj.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 CopydefObj.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 CopydefObj.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 CopydefObj.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 CopydefObj.isToolEffective(String type, IBlockState state);