Hytale Mod開発
Server Plugins

Creating custom blocks

Learn how to create custom blocks for your Hytale mod.

Creating custom blocks requires enabling asset packs and organizing your files properly.

Setup

  1. Enable asset packs in manifest.json by setting IncludesAssetPack to true
  2. Create the following folder structure:
model.blockymodel
texture.png
  1. Add translations in Server/Languages/en-US/items.lang:
my_new_block.name = My New Block
my_new_block.description = My Description

Basic Cube Block

Create Server/Item/Items/my_new_block.json:

{
    "TranslationProperties": {
        "Name": "items.my_new_block.name",
        "Description": "items.my_new_block.description"
    },
    "Id": "MyNewBlock",
    "PlayerAnimationsId": "Block",
    "MaxStack": 20,
    "BlockType": {
        "Material": "Solid",
        "DrawType": "Cube",
        "Opacity": "Transparent",
        "Textures": [
            {
                "All": "BlockTextures/texture.png",
                "Weight": 1
            }
        ]
    },
    "Icon": "Icons/ItemsGenerated/my_new_block.png"
}

Custom Model Block

For custom models, use DrawType: "Model":

{
    "TranslationProperties": {
        "Name": "items.my_new_block.name",
        "Description": "items.my_new_block.description"
    },
    "Id": "MyNewBlock",
    "PlayerAnimationsId": "Block",
    "MaxStack": 20,
    "BlockType": {
        "Material": "Solid",
        "DrawType": "Model",
        "Opacity": "Transparent",
        "CustomModel": "Blocks/my_new_model.blockymodel",
        "CustomModelTexture": [
            {
                "Texture": "BlockTextures/texture.png",
                "Weight": 1
            }
        ]
    },
    "Icon": "Icons/ItemsGenerated/my_new_object.png"
}

Ensure all referenced files exist in their respective folders, and the paths are correct.

著者 Flo_12344