Wiki

Clone wiki

WesterosBlocks / Custom Blocks

The 'blocks' section of the WesterosBlocks.json file consists of an array of block definitions. Each block definition typically corresponds to a single custom block ID implemented with a specified custom block type. A given block ID may define multiple metadata values (ranging from 0 to 15), depending upon the specific custom block type being used, but all blocks with a given ID must be of the same custom type.

Each custom block definition contains the following common values:

#!json
    {
        "blockName" : "unique-block-name",
        "blockID" : default-block-id,
        "blockType" : "custom-block-type",
        "hardness" : block-hardness,
        "stepSound" : "step-sound-resource",
        "material" : "material-type",
        "resistance" : explosion-resistance,
        "harvestLevel" : [ 
                      { "tool" : "tool-type", "level" : tool-level },
                      << Additional harvesting tools, if any >>
                ],
        "creativeTab" : "tool-tab-name",
        "lightValue" : block-light-level,
        "lightOpacity" : block-light-opacity,
        "colorMult" : "color-multiplier",
        "subBlocks" : [
            {
                "meta" : meta-value,
                "label": "item-label",
                "textures" : [ texture-id-list ],
                "lightOpacity" : subblock-light-opacity,
                "colorMult" : "color-multiplier"
            },
                        <additional records for additional meta values, as appropriate>
        ]
    },
Where:

  • 'unique-block-name' is a unique string for identifying the custom block. It will be used for referring to the given block definition in the WesterosBlock.cfg file (including allowing the block ID of the block to be tailored there).
  • 'default-block-id' is an integer corresponding to the default block ID value for the block. This value can be overridden via settings in WesterosBlocks.cfg, and the ID must be both unique across all mods (not just WesterosBlocks) and must be consistent between the client and server installations of the mod.
  • 'custom-block-type' is the identity of the custom block type (provided by WesterosBlocks internally) for the block. The custom block type ultimately determines the behavior of the rest of the block definition, and can include additional parameters that are specific to the block type. The defined block types include:

    • "solid" - corresponds to a simple solid cube block (see Solid Blocks)
    • "stair" - corresponds to a standard stairs block (vanilla Minecraft behavior) (see Stair Blocks)
    • "log" - corresponds to a standard log/wood block (vanilla Mineacraft behavior) (see Log Blocks)
    • "plant" - corresponds to a standard plant block (crossed textures, transparent block) (see Plant Blocks)
    • "crop" - corresponds to a standard crop block (2 row by 2 column textures, transparent block) (see Crop Blocks)
    • "slab" - corresponds to a standard step/slab block (see Slab Block)
    • "fence" - corresponds to a standard fence block (see Fence Block)
    • "wall" - corresponds to a standard wall block (see Wall Block)
    • "pane" - corresponds to a standard glass pane style block (see Pane Block)
    • "sand" - corresponds to a standard solid block that drops with physics (like sand or gravel) (see Sand Block)
    • "cuboid" - corresponds to a cuboid block with fractional X, Y, and/or Z dimensions (see Cuboid Block)
    • "torch" - corresponds to a standard torch block (see Torch Block)
    • "leaves" - corresponds to a standard leaf block (see Leaf Block)
    • "door" - corresponds to a standard door block (see Door Block)
    • "layer" - corresponds to a customizable stack-able layer block (like snow layers) (see Layer Block)
  • 'block-hardness' is a decimal value corresponding to the hardness of the block (resistance to breaking). Standard values include 0.5 (dirt), 0.6 (grass), 1.5 (stone), 2.0 (planks, cobblestone), 3.0 (ores), 5.0 (iron block), -1.0 (bedrock or other unbreakable blocks)

  • 'step-sound-resource' is the identity of the step sound resource (standard or custom) to be used when the block is placed, broken, or stepped upon. Standard resources include "powder", "wood", "gravel", "grass", "stone", "metal", "glass", "cloth", "sand", "snow", "ladder", and "anvil". See Custom Step Sounds for details on custom sounds.
  • 'material-type' is the standard material type best matching the block: this is used for certain adjacent block behaviors. Standard values include "air", "grass", "ground", "wood", "rock", "iron", "anvil", "water", "lava", "leaves", "plants", "vine", "sponge", "cloth", "fire", "sand", "circuits", "glass", "redstoneLight", "tnt", "coral", "ice", "snow", "craftedSnow", "cactus", "clay", "pumpkin", "dragonEgg", "portal", "cake", "web", and "piston".
  • 'explosion-resistance' is a decimal number representing the relative explosion resistance of the block. Typical values include 10.0 (stone), 5.0 (planks), 6000000.0 (bedrock), 100.0 (water), 15.0 (Ender Stone).
  • 'tool-type' is one of the standard harvest tools: "pickaxe", "axe", "shovel"
  • 'tool-level' is an integer representing the level of the given tool that can harvest a block. 0=wooden, 1=stone, 2=iron, 3=diamond
  • 'tool-tab-name' is the identity of the inventory tab that the items associated with the custom block should be shown within. Standard names include "buildingBlocks", "decorations", "redstone", "transportation", "misc", "food", "tools", "combat", "brewing", and "materials". WesterosBlock specific tabs include "WesterosBlocks", "WesterosTabs", and "WesterosPlants".
  • 'block-light-level' is a decimal number representing the emitted light level of the block. 0.0 is default (no emitted light), while 1.0 corresponds to maximum emitted light (15).
  • 'meta-value' is the metadata value for the specific subblock (0-15).
  • 'item-label' is the label to be used for the item representing the given block (in the inventory)
  • 'texture-id-list' is a list of one or more texture resources to be used for the block. If one is specified, the same texture is used for all sides of the block. For most blocks, the order of textures corresponds to the standard side order: bottom, top, north, south, west, east. Some custom block type will specify a different sequence more appropriate to the given type. By default, texture resources are relative to the internal path for WesterosBlocks: assets/westerosblocks/textures/blocks . If the resources need to be relative to another mod base, prefix the path with the mod ID (lower case) plus a colon (e.g. "minecraft:grass"). Resource names do not include the file extension (.png). The format of the list is a comma separated list of quoted strings.
  • 'block-light-opacity' is an integer indicating the number of light levels that light passing through the block drops. 0 = transparent block, 2 = water, 255 = opaque block. If not specified, the value defaults based on the block type (solid blocks to 255, transparent blocks to 0).
  • 'subblock-light-opacity' is an integer overriding the 'block-light-opacity' for a specific subblock. If not specified, the 'block-light-opacity' value for the block applies to the subblock.
  • 'color-multiplier' is a string specifying the color multiplier (shading) applied to the textures of the block. If the value starts with '#', the following 6 digits are a fixed hexadecimal color code '#rrggbb'. The default is white (#FFFFFF), which leaves any textures unchanged. Other special values include:
    • 'water' - use the resource pack's water toning (biome-specific)
    • 'foliage' - use the resource pack's foliage toning (biome-specific)
    • 'grass' - use the resource pack's grass toning (biome-specific)
    • 'pine' - use the resource pack's pine leaves toning (biome-specific)
    • 'birch' - use the resource pack's birch leaves toning (biome-specific)
    • 'basic' - use the resource pack's basic leaves toning (biome-specific)
    • 'lily' - use the resource pack's lily toning (biome-specific) Other values are treated as the identity of a texture resource providing a biome-specific shading map.

Updated