π§Compressed Block
Explanation
The compressed blocks are used to define more precisely compressed variants for a block.
Mandatory properties
There are no mandatory properties for this block but it is suggested to have at least a texture field in it
Optional properties
π¦ Model
Name : model
modelDefault : {}
{}Description :
Defines a custom model for compressed blocks.
The model is composed of 2 different parts.
The first one is the parent which allows you to define which model will be used as the parent of the model
The second one is the textures , it works like the one in the normal minecraft models.
When launched the game will apply the layer defines in the configuration on all the textures in the textures object.
Warning: You can't have a model object if a texture object is already present
Example :
"model": {
"parent":"minecraft:block/acacia_log",
"textures": {
"side": "minecraft:block/stone"
}
}Here the model of the compressed block will be the one of an acacia log with stone on the side. The layer to indicate the tier of compression will only be applied on the side because it was the only texture that we precised in the model.
βοΈ Class
Name : class
classDefault : net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BlockDescription :
Defines a custom java class used to create the block in the game registries.
Warning : The used class must have a constructor with only a BlockBehaviour.Properties paramater. If you use a class without a constructor or with a constructor with other paramaters, the block won't be created.
Example :
"class": "net.minecraft.world.level.block.SlimeBlock"Here we create a block which will behave like a slime, so players will be able to bounce on it and it will stick other blocks.
πΌοΈ Render Type
Name : renderType
renderTypeDefault : solid
solid Description :
The render type defines what behaviour the game renderer should apply for the block The available values for this property are
solid: Used for fully solid blocks, such as stone.cutout: Used for blocks where any pixel is either fully solid or fully transparent, i.e. with either full or no transparency, for example glass.cutout_mipped:Variant ofcutoutthat will scale down textures at large distances to avoid visual artifacts.translucent: Used for blocks where any pixel may be partially transparent, for example stained glass.
Example :
π οΈ Push Reaction
Name : pushReaction
pushReactionDefault : normal
normal Description :
Defines which behaviour will have the block when pushed by a piston. The available values are
normal: The block will be pushed and retracted normallydestroy: The block will be destroyed when pushed, such as shulker boxesblock: The block won't be pushed by the piston, such as obsidianpush_only: The block will only be pushed by the piston but not retracted, such as glazed terracota
Example :
Here, when pushed by a piston, the compressed block will be destroyed
π’ Sound Type (1.21.1 only)
Name : soundType
soundTypeDefault : empty
emptyDescription :
Defines what sounds should emit the block when placed, broken, stepped on, etc... The available values are available on the Minecraft Wiki
Warning : You can't use modded sound types in this field
Example :
πTags
Name : tags
tagsDefault : {}
{}Description :
Defines custom tags that will be applied on compressed blocks.
This property is a java object defined with 2 sub objects :
These objects are both a list of string which corresponds to a tag.
These two list are named item and block
Note: Each compressed block is by default generated with 3 tags :
compressed:compressedcompressed:compressed/<type>compressed:compressed/<type>/<tier>
Example :
Here we add the tag minecraft:mineable/pickaxe to the compressed blocks and the tag c:cobblestones to the items linked to these blocks.
Example
Here we create compressed block for stone. These blocks will look like stone block but with the layer. They will behave like a slime block, sound like it, destroyed when pushed by a piston, emit light, and they can be broken by a pickaxe
Last updated