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
;
Name | Type | Required | Standardwert | Notes |
---|---|---|---|---|
Name axisAlignedBB | Type MCAxisAlignedBB | Required No | Standardwert Full Block | Notes Lets you set the block's bounding box |
Name beaconBase | Type boolean | Required No | Standardwert false | Notes Can this block be used as part of a beacon's base? |
Name blockColorSupplier | Type IBlockColorSupplier | Required No | Standardwert -1 as color | Notes The block's color |
Name blockHardness | Type float | Required No | Standardwert 5.0 | Notes How long it takes to break |
Name blockLayer | Type String | Required No | Standardwert "SOLID" | Notes "SOLID", "CUTOUT_MIPPED", "CUTOUT", "TRANSLUCENT" |
Name blockMaterial | Type IMaterialDefinition | Required No | Standardwert Iron | Notes The Block's base material |
Name blockResistance | Type float | Required No | Standardwert 5.0 | Notes Explosion resistance |
Name blockSoundType | Type SoundType | Required No | Standardwert Metal | Notes The Block's sound type (determines things like the breaking sound) |
Name creativeTab | Type CreativeTab | Required No | Standardwert Misc | Notes The Creative tab the item will appear in |
Name dropHandler | Type IBlockDropHandler | Required No | Standardwert | Notes What the block will drop when broken |
Name entitySpawnable | Type boolean | Required No | Standardwert true | Notes Can be used to prevent any entities from spawning on this block |
Name enumBlockRenderType | Type String | Required No | Standardwert "MODEL" | Notes "INVISIBLE", "LIQUID", "ENTITYBLOCK_ANIMATED", "MODEL" → Sets how the block is rendered |
Name fullBlock | Type boolean | Required No | Standardwert True | Notes Used for rendering and light calculations |
Name gravity | Type boolean | Required No | Standardwert false | Notes Is this block affected by gravity |
Name itemColorSupplier | Type IItemColorSupplier | Required No | Standardwert -1 as color | Notes The block's color when it is in item form |
Name lightOpacity | Type int | Required No | Standardwert 255 if fullBlock is true or 0 | Notes Does Light pass through |
Name lightValue | Type int | Required No | Standardwert 0 | Notes Light level of block, ranges from 0-1. This value is multiplied by 15 to determine the final value. |
Name onBlockBreak | Type IBlockAction | Required No | Standardwert | Notes Called when Block is broken. |
Name onBlockPlace | Type IBlockAction | Required No | Standardwert | Notes Called when Block is placed. |
Name onRandomTick | Type IBlockAction | Required No | Standardwert | Notes Called on a random tick event. |
Name onUpdateTick | Type IBlockAction | Required No | Standardwert | Notes Called when Block receives a block update. |
Name passable | Type boolean | Required No | Standardwert Depending on the IMaterialDefinition provided | Notes Can players pass through this block? |
Name replaceable | Type boolean | Required No | Standardwert Depending on the IMaterialDefinition provided | Notes Can this block be replaced by another block? |
Name slipperiness | Type float | Required No | Standardwert 0.6f | Notes Ice blocks are 0.98f |
Name textureLocation | Type CTResourceLocation | Required No | Standardwert null | Notes The block's resource location, used for textures etc. |
Name toolClass | Type String | Required No | Standardwert pickaxe | Notes Tool required to Break Block |
Name toolLevel | Type int | Required No | Standardwert 2 | Notes Tool Level required to Break Block |
Name translucent | Type boolean | Required No | Standardwert false | Notes Is see through |
Name unlocalizedName | Type String | Required Yes | Standardwert | Notes Name, should be all lowercase |
Name witherProof | Type boolean | Required No | Standardwert false | Notes Can Wither's destroy this block |
Beispiele
Link to beispiele
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!