Block
Link to block
Fields
Link to fields
Required Fields will never have a default value, empty defaults means null.
All Fields can be set via setName
e.g. block.setUnlocalizedName("name");
and gotten via getName
;
이름 | Type | Required | Default Value | Notes |
---|---|---|---|---|
이름 axisAlignedBB | Type MCAxisAlignedBB | Required No | Default Value Full Block | Notes Lets you set the block's bounding box |
이름 beaconBase | Type boolean | Required No | Default Value false | Notes Can this block be used as part of a beacon's base? |
이름 blockColorSupplier | Type IBlockColorSupplier | Required No | Default Value -1 as color | Notes The block's color |
이름 blockHardness | Type float | Required No | Default Value 5.0 | Notes How long it takes to break |
이름 blockLayer | Type String | Required No | Default Value "SOLID" | Notes "SOLID", "CUTOUT_MIPPED", "CUTOUT", "TRANSLUCENT" |
이름 blockMaterial | Type IMaterialDefinition | Required No | Default Value Iron | Notes The Block's base material |
이름 blockResistance | Type float | Required No | Default Value 5.0 | Notes Explosion resistance |
이름 blockSoundType | Type SoundType | Required No | Default Value Metal | Notes The Block's sound type (determines things like the breaking sound) |
이름 creativeTab | Type CreativeTab | Required No | Default Value Misc | Notes The Creative tab the item will appear in |
이름 dropHandler | Type IBlockDropHandler | Required No | Default Value | Notes What the block will drop when broken |
이름 entitySpawnable | Type boolean | Required No | Default Value true | Notes Can be used to prevent any entities from spawning on this block |
이름 enumBlockRenderType | Type String | Required No | Default Value "MODEL" | Notes "INVISIBLE", "LIQUID", "ENTITYBLOCK_ANIMATED", "MODEL" → Sets how the block is rendered |
이름 fullBlock | Type boolean | Required No | Default Value True | Notes Used for rendering and light calculations |
이름 gravity | Type boolean | Required No | Default Value false | Notes Is this block affected by gravity |
이름 itemColorSupplier | Type IItemColorSupplier | Required No | Default Value -1 as color | Notes The block's color when it is in item form |
이름 lightOpacity | Type int | Required No | Default Value 255 if fullBlock is true or 0 | Notes Does Light pass through |
이름 lightValue | Type int | Required No | Default Value 0 | Notes Light level of block, ranges from 0-1. This value is multiplied by 15 to determine the final value. |
이름 onBlockBreak | Type IBlockAction | Required No | Default Value | Notes Called when Block is broken. |
이름 onBlockPlace | Type IBlockAction | Required No | Default Value | Notes Called when Block is placed. |
이름 onRandomTick | Type IBlockAction | Required No | Default Value | Notes Called on a random tick event. |
이름 onUpdateTick | Type IBlockAction | Required No | Default Value | Notes Called when Block receives a block update. |
이름 passable | Type boolean | Required No | Default Value Depending on the IMaterialDefinition provided | Notes Can players pass through this block? |
이름 replaceable | Type boolean | Required No | Default Value Depending on the IMaterialDefinition provided | Notes Can this block be replaced by another block? |
이름 slipperiness | Type float | Required No | Default Value 0.6f | Notes Ice blocks are 0.98f |
이름 textureLocation | Type CTResourceLocation | Required No | Default Value null | Notes The block's resource location, used for textures etc. |
이름 toolClass | Type String | Required No | Default Value pickaxe | Notes Tool required to Break Block |
이름 toolLevel | Type int | Required No | Default Value 2 | Notes Tool Level required to Break Block |
이름 translucent | Type boolean | Required No | Default Value false | Notes Is see through |
이름 unlocalizedName | Type String | Required Yes | Default Value | Notes Name, should be all lowercase |
이름 witherProof | Type boolean | Required No | Default Value false | Notes Can Wither's destroy this block |
Examples
Link to examples
ZenScript Copy#loader contenttweaker
import mods.contenttweaker.VanillaFactory;
import mods.contenttweaker.Block;
var antiIceBlock = VanillaFactory.createBlock("anti_ice", <blockmaterial:ice>);
antiIceBlock.setLightOpacity(3);
antiIceBlock.setLightValue(0);
antiIceBlock.setBlockHardness(5.0);
antiIceBlock.setBlockResistance(5.0);
antiIceBlock.setToolClass("pickaxe");
antiIceBlock.setToolLevel(0);
antiIceBlock.setBlockSoundType(<soundtype:snow>);
antiIceBlock.setSlipperiness(0.3);
antiIceBlock.register();
Localising the block
Link to localising-the-block
You will need to add tile.contenttweaker.blockName.name=Localized Name
to the responding language files.
If you have doubts, take a look at the display name of the item when you're holding it before translating it.
Alternatively, you could use CraftTweaker's localization feature, though it's recommended using the language files!