XiaoMoMi Plugins
δΈ­ζ–‡η»΄εŸΊ
CraftEngine
CraftEngine
  • Plugin Wiki
    • 🏭️ CraftEngine
      • πŸ§‘β€πŸ”§ Installation Guide
      • πŸ“ Atlas [MUST READ]
      • πŸ—ΊοΈ Mipmap [MUST READ]
      • βž•οΈ Add New Contents
        • πŸ“„ Templates [MUST READ]
          • 🟒 Argument Types
        • 🏭️ Model Generation
        • πŸͺ‡ Events
        • βš–οΈ Conditions
        • πŸ“– Recipes
        • πŸ’Ž Loot Table
        • πŸͺ‘ Furniture
          • βš™οΈ Furniture Settings
          • πŸ•ΉοΈ Furniture Behaviors
          • πŸ“ Furniture Placement
        • πŸ—‘οΈ Items
          • πŸ”’ Item Data
            • πŸ”’ Client Bound Item Data
          • βš™οΈ Item Settings
          • πŸ•ΉοΈ Item Behaviors
            • πŸͺ‘ Furniture Item
            • 🧱 Block Item
              • 🌊 Liquid Collision Block Item
          • 🟰 Item Models
            • πŸ“ Model
              • 🎨 Tint
            • 🧩 Composite
            • βš–οΈ Condition
            • πŸ“‘ Range Dispatch
            • βœ… Select
            • πŸ‘» Special
        • 🧱 Blocks
          • βš™οΈ Block Settings
            • 🏷️ Useful Tags
          • πŸ”£ Block States
            • 🏷️ Properties
          • πŸ•ΉοΈ Block Behaviors
            • 🟨 Falling Block
              • πŸ’¦ Concrete Powder Block
            • 🍁 Leaves Block
            • πŸͺ» Bush Block
              • 🎍 Sugar Cane Block
              • 🌽 Crop Block
              • 🌴 Sapling Block
            • πŸͺ“ Strippable Block
            • 🌊 On Liquid Block
            • 🚟 Hanging Block
            • 🌿 Grass Block
          • πŸ«‘ Block Entities
        • πŸ–ΌοΈ Images
        • πŸ˜€ Emoji
        • γŠ™οΈ Fonts
        • πŸ“‚ Category
        • πŸ”Š Sounds
        • 🌍 Server Lang (i18n)
        • 🌎️ Client Lang (lang)
        • πŸ—ƒοΈ Vanilla Loots
        • πŸ”  Global Variables
      • πŸ”’ Number Format
      • ✏️ Text Format
        • πŸ”— Chain Arguments
      • πŸ“¦οΈ Resource Pack
        • βš”οΈ File Conflict
        • πŸ›œ Host
      • 🐚 Commands
      • πŸ”Œ Compatibility
        • 🐌 External Item Providers
        • πŸͺ“ WorldEdit / FAWE
        • πŸ…ΏοΈ PlaceholderAPI
        • βš›οΈ Axiom
        • 🟒 AdvancedSlimePaper
        • πŸ–ŒοΈ World Painter
        • ⌨️ Skript
      • πŸ“” Worldgen Datapack Tutorial
        • πŸͺ¨ Ore Vein
        • 🌳 Tree
        • 🌺 Surface Decoration
        • 🏰 Structure
      • ⌨️ API
      • πŸ—‚οΈ Misc
        • πŸ““ Config Format Changelog
        • ❓️ Common Questions
Powered by GitBook
On this page
  • Introduction
  • Where to Configure
  • Arguments
  • parent
  • textures
  • gui-light
  • display
  1. Plugin Wiki
  2. 🏭️ CraftEngine
  3. βž•οΈ Add New Contents

🏭️ Model Generation

This page mainly explains how to use model generation.

Introduction

🏭️ Model Generation is acting a role to create a model in YAML format.

When configuring multiple similar models (e.g., 16 wool-colored sofas that only differ in textures), you would normally need to create an equal number of separate models. However, with Model Generation, you can easily manage these model inheritance relationships using YAML format.

The path specified in the path option (located in the same configuration section as generation) must point to a non-existent model path! Otherwise, it will conflict with your existing models.

Model generation is always an optional configuration. If you already have a dedicated JSON model file for that block/item, you do not need to use generationβ€”simply specify the model path using path instead.

Where to Configure

If you observe carefully, you'll notice that the plugin uses the following configuration format in many places.

path: "xxx:xxx"
generation:
  parent: "minecraft:xxx/xxx"
  textures:
    "xxx": "xxx:xxx"

In fact, the plugin supports model generation wherever a model path (path) can be specified. Whenever you see path, it means you can use generation within the same configuration section.

Arguments

parent

items#test:
  default:big_apple:
    material: apple
    custom-model-data: 1000
    model:
      type: minecraft:model
      path: "minecraft:item/custom/big_apple"
      generation:
        parent: "minecraft:item/apple" # inherits apple's model
        # displays a big apple in gui
        display:
          gui:
            scale: 2,2,2
  default:big_big_apple:
    material: apple
    custom-model-data: 1001
    model:
      type: minecraft:model
      path: "namespace:item/custom/big_big_apple"
      generation:
        # inherits the custom big apple model above
        parent: "minecraft:item/custom/big_apple"
        # now it would be very big both in hand and in gui
        display:
          firstperson_righthand:
            scale: 4,4,4

textures

If we intend to generate a block based on this model, the parameters for parent and textures should be specified as follows:

generation:
  parent: "minecraft:block/cube_all"
  textures:
    "particle": "minecraft:block/custom/block_particle"
    "down": "minecraft:block/custom/block_down"
    "up": "minecraft:block/custom/block_up"
    "north": "minecraft:block/custom/block_north"
    "east": "minecraft:block/custom/block_east"
    "south": "minecraft:block/custom/block_south"
    "west": "minecraft:block/custom/block_west"
items#test:
  default:big_apple:
    material: apple
    custom-model-data: 1000
    model:
      type: minecraft:model
      path: "minecraft:item/custom/big_apple"
      generation:
        parent: "minecraft:item/apple"
        textures:
          # replace the apple's texture with an axe
          layer0: minecraft:item/custom/topaz_axe 
        display:
          gui:
            scale: 2,2,2

The key-value pairs under the textures section are determined by the parent model.

For example:

  • minecraft:item/apple inherits from minecraft:item/generated.

  • layer0 is one of the textures parameters defined in minecraft:item/generated.

  • This is why you can override this texture in the child model (apple).

gui-light

Can be "front" or "side". If set to "side", the model is rendered like a block. If set to "front", model is shaded like a flat item. Defaults to "side".

display

Holds the different places where item models are displayed.

  • rotation: Specifies the rotation of the model according to the scheme [x, y, z].

  • translation: Specifies the position of the model according to the scheme [x, y, z]. If the value is greater than 80, it is displayed as 80. If the value is less than -80, it is displayed as -80.

  • scale: Specifies the scale of the model according to the scheme [x, y, z]. If the value is greater than 4, it is displayed as 4.

Available values: thirdperson_righthand, thirdperson_lefthand, firstperson_righthand, firstperson_lefthand, gui, head, ground, or fixed.

Let's continue with this big big apple example. You may notice that when held in the right hand, its rotation behaves incorrectly. This happens because we overrode its parent model's display.firstperson_righthand settings. Now, let's fix it!

generation:
  parent: "minecraft:item/custom/big_apple"
  display:
    firstperson_righthand:
      scale: 4,4,4
      rotation: 0,-90,25
Previous🟒 Argument TypesNextπŸͺ‡ Events

Last updated 11 days ago

Loads a different model from the given path, in form of a

The parent field can not only reference the default models provided by vanilla Minecraft but can also point to your custom models. You can view all available Minecraft models on this

Holds the textures of the model, in form of a or can be another texture variable.

You can view all available Minecraft models and their textures on this

resource location
website
resource location
website
big apple
big big apple
left: front right: side