Loading...
Loading...
Create custom block types for Hytale with textures, physics, states, farming, and interactions. Use when asked to "add a custom block", "create a new block type", "make blocks farmable", "add block interactions", or "configure block physics".
npx skill4agent add mnkyarts/hytale-skills hytale-custom-blocksmy-plugin/
└── assets/
└── Server/
└── Content/
└── BlockTypes/
├── my_custom_block.blocktype
├── my_crop.blocktype
└── my_bench.blocktypemy_custom_block.blocktype{
"DisplayName": {
"en-US": "Custom Block"
},
"Description": {
"en-US": "A custom block with special properties"
},
"DrawType": "Cube",
"Texture": "MyPlugin/Textures/custom_block",
"Material": "Stone",
"Tags": {
"Category": ["Building", "Decorative"]
}
}| Property | Type | Description |
|---|---|---|
| LocalizedString | Localized display name |
| LocalizedString | Localized description |
| String | Inherit from another block type |
| Object | Category tags for filtering |
| Property | Type | Default | Description |
|---|---|---|---|
| Enum | | |
| String | - | Texture path for cube rendering |
| String | - | Top face texture |
| String | - | Side faces texture |
| String | - | Bottom face texture |
| String | - | Model asset for DrawType=Model |
| String | - | Custom shader |
| Float | 1.0 | Block opacity (0-1) |
| Boolean | false | Enable alpha blending |
| Boolean | false | Random Y rotation on place |
| Enum | - | Rotation variant mode |
| Enum | - | Random flipping mode |
| Float | 0 | Rotation offset in degrees |
| Property | Type | Default | Description |
|---|---|---|---|
| String | - | Physics material type |
| Boolean | true | Collision enabled |
| Boolean | false | Can be replaced when placing |
| Boolean | false | Falls like sand |
| Object | - | Support provided to neighbors |
| Object | - | Support needed from neighbors |
| Property | Type | Default | Description |
|---|---|---|---|
| Boolean | false | Can be climbed (ladders) |
| Float | 0 | Bounce factor (0-1) |
| Float | 0 | Movement drag |
| Float | 1 | Surface friction |
| Float | 1 | Walk speed multiplier |
| Property | Type | Default | Description |
|---|---|---|---|
| Boolean | false | Right-click interaction |
| Boolean | true | Can be placed adjacent |
| String | - | Item dropped when broken |
| Integer | 0 | Light emission (0-15) |
| Color | white | Light color |
| Boolean | false | Can catch fire |
| Integer | 0 | Fire spread rate |
{
"DrawType": "Cube",
"Texture": "MyPlugin/Textures/stone",
"TextureTop": "MyPlugin/Textures/stone_top"
}{
"DrawType": "Model",
"Model": "MyPlugin/Models/custom_model",
"BoundingBox": "MyPlugin/BoundingBoxes/custom_box"
}{
"DrawType": "Empty",
"IsSolid": false
}{
"BlockFaceSupport": {
"Top": {
"Type": "Full",
"SupportStrength": 100
},
"Bottom": {
"Type": "Full",
"SupportStrength": 100
},
"North": { "Type": "Full" },
"South": { "Type": "Full" },
"East": { "Type": "Full" },
"West": { "Type": "Full" }
}
}FullPartialNoneCenter{
"RequiredBlockFaceSupport": {
"Bottom": [
{
"Type": "Full",
"Match": "REQUIRED"
}
]
}
}REQUIREDIGNOREDDISALLOWED{
"HasGravity": true,
"GravityDelay": 5,
"PhysicsDrop": {
"GatherType": "Shovel",
"Drops": [
{
"Item": "minecraft:sand",
"Quantity": 1
}
]
}
}{
"Gathering": {
"Breaking": {
"GatherType": "Pickaxe",
"Power": 2,
"Quality": 1,
"Drops": [
{
"Item": "my_plugin:custom_ore",
"Quantity": {
"Min": 1,
"Max": 3
},
"Chance": 1.0
}
]
},
"Harvest": {
"GatherType": "Hoe",
"Quality": 1,
"Drops": [
{
"Item": "my_plugin:seeds",
"Quantity": 1
}
]
},
"SoftBlock": {
"Enabled": true,
"Drops": [
{
"Item": "my_plugin:dust",
"Quantity": 1
}
]
}
}
}HandPickaxeAxeShovelHoeSword{
"States": {
"powered": {
"Values": ["true", "false"],
"Default": "false"
},
"facing": {
"Values": ["north", "south", "east", "west"],
"Default": "north"
}
},
"StateData": {
"powered=true,facing=north": {
"Model": "MyPlugin/Models/powered_north"
},
"powered=true,facing=south": {
"Model": "MyPlugin/Models/powered_south"
},
"powered=false": {
"Model": "MyPlugin/Models/unpowered"
}
}
}{
"DisplayName": { "en-US": "Wheat" },
"DrawType": "Model",
"FarmingData": {
"Stages": [
{
"Model": "Hytale/Models/Crops/wheat_stage_0",
"GrowthTime": 300,
"LightRequired": 8
},
{
"Model": "Hytale/Models/Crops/wheat_stage_1",
"GrowthTime": 300,
"LightRequired": 8
},
{
"Model": "Hytale/Models/Crops/wheat_stage_2",
"GrowthTime": 300,
"LightRequired": 8
},
{
"Model": "Hytale/Models/Crops/wheat_stage_3",
"GrowthTime": 0,
"LightRequired": 0,
"IsFinalStage": true
}
],
"Modifiers": {
"Biome": {
"Plains": 1.2,
"Desert": 0.5
},
"Weather": {
"Rain": 1.3
}
},
"SpreadSettings": {
"Enabled": true,
"Chance": 0.1,
"Radius": 2
},
"RequiredSoil": ["Hytale:Farmland", "Hytale:Dirt"]
}
}{
"DisplayName": { "en-US": "Workbench" },
"DrawType": "Model",
"Model": "MyPlugin/Models/workbench",
"IsUsable": true,
"Bench": {
"Type": "Crafting",
"Categories": ["MyPlugin:BasicCrafting", "MyPlugin:AdvancedCrafting"],
"GridSize": {
"Width": 3,
"Height": 3
},
"OutputSlots": 1
}
}{
"Bench": {
"Type": "Processing",
"Categories": ["MyPlugin:Smelting"],
"InputSlots": 1,
"FuelSlots": 1,
"OutputSlots": 1,
"ProcessingTime": 200,
"FuelTypes": ["Hytale:Coal", "Hytale:Charcoal"]
}
}{
"Bench": {
"Type": "DiagramCrafting",
"Categories": ["MyPlugin:BlueprintCrafting"],
"DiagramSlot": true,
"MaterialSlots": 6,
"OutputSlots": 1
}
}{
"BlockSound": "MyPlugin/BlockSounds/metal",
"AmbientSound": {
"Sound": "MyPlugin/Sounds/machine_hum",
"Volume": 0.5,
"Radius": 8
}
}StoneWoodMetalGlassDirtSandGrassGravelSnowWool{
"BreakParticle": "MyPlugin/Particles/stone_break",
"AmbientParticle": {
"Particle": "MyPlugin/Particles/sparkle",
"SpawnRate": 2,
"Radius": 0.5
},
"FootstepParticle": "MyPlugin/Particles/dust"
}{
"Interactions": {
"Use": "MyPlugin:MyBlockInteraction",
"Attack": "MyPlugin:MyBlockAttackInteraction"
}
}| Type | Trigger |
|---|---|
| Right-click |
| Left-click |
| Look at block |
| Walk into block |
{
"DisplayName": {
"en-US": "Mythril Ore"
},
"Description": {
"en-US": "A rare ore found deep underground"
},
"DrawType": "Cube",
"Texture": "MyPlugin/Textures/mythril_ore",
"Material": "Stone",
"LightLevel": 3,
"LightColor": { "R": 0.5, "G": 0.8, "B": 1.0 },
"Tags": {
"Category": ["Ore", "Mining"]
},
"Gathering": {
"Breaking": {
"GatherType": "Pickaxe",
"Power": 4,
"Quality": 3,
"Drops": [
{
"Item": "MyPlugin:RawMythril",
"Quantity": { "Min": 1, "Max": 2 }
}
]
}
},
"BlockFaceSupport": {
"Top": { "Type": "Full" },
"Bottom": { "Type": "Full" },
"North": { "Type": "Full" },
"South": { "Type": "Full" },
"East": { "Type": "Full" },
"West": { "Type": "Full" }
},
"BlockSound": "Hytale/BlockSounds/Stone",
"BreakParticle": "MyPlugin/Particles/mythril_break",
"AmbientParticle": {
"Particle": "MyPlugin/Particles/mythril_sparkle",
"SpawnRate": 0.5
}
}{
"DisplayName": { "en-US": "Wooden Door" },
"DrawType": "Model",
"Material": "Wood",
"IsUsable": true,
"States": {
"open": {
"Values": ["true", "false"],
"Default": "false"
},
"facing": {
"Values": ["north", "south", "east", "west"],
"Default": "north"
},
"half": {
"Values": ["upper", "lower"],
"Default": "lower"
}
},
"StateData": {
"open=false,facing=north,half=lower": {
"Model": "MyPlugin/Models/door_closed_lower_n"
},
"open=true,facing=north,half=lower": {
"Model": "MyPlugin/Models/door_open_lower_n"
}
},
"IsSolid": false,
"Interactions": {
"Use": "MyPlugin:DoorInteraction"
},
"PlacementSettings": {
"RotationMode": "PlayerFacing",
"MultiBlock": {
"Pattern": [
{ "Offset": [0, 1, 0], "State": "half=upper" }
]
}
},
"BlockSound": "Hytale/BlockSounds/Wood",
"RequiredBlockFaceSupport": {
"Bottom": [
{ "Type": "Full", "Match": "REQUIRED" }
]
}
}@Override
protected void setup() {
// Listen for block type loading
getEventRegistry().register(
LoadedAssetsEvent.class,
BlockType.class,
this::onBlockTypesLoaded
);
}
private void onBlockTypesLoaded(LoadedAssetsEvent<BlockType> event) {
// Access loaded block types
BlockType myBlock = event.getAssetStore().get("MyPlugin:my_custom_block");
if (myBlock != null) {
getLogger().atInfo().log("Custom block loaded: %s", myBlock.getDisplayName());
}
}@Override
protected void setup() {
// Block break event
getEntityStoreRegistry().registerSystem(new BreakBlockHandler());
// Block place event
getEntityStoreRegistry().registerSystem(new PlaceBlockHandler());
// Block use event
getEntityStoreRegistry().registerSystem(new UseBlockHandler());
}
public class BreakBlockHandler extends EntityEventSystem<EntityStore, BreakBlockEvent> {
public BreakBlockHandler() {
super(BreakBlockEvent.class);
}
@Override
public void handle(int index, ArchetypeChunk<EntityStore> chunk,
Store<EntityStore> store, CommandBuffer<EntityStore> buffer,
BreakBlockEvent event) {
BlockType blockType = event.getBlockType();
Vector3i position = event.getPosition();
// Custom logic here
if (blockType.getId().equals("MyPlugin:protected_block")) {
event.setCancelled(true);
}
}
}DrawTypeMaterialGatherTypePowerBlockFaceSupportRequiredBlockFaceSupportIsSolidreferences/block-materials.mdreferences/block-states.md