Page cover

๐Ÿ‚Leaves

Learn how to create custom leaves with Foliage.

How does it work ?

In Minecraft, a block can have multiple blockstates, each blockstate can show a custom block model, and depending on the situation, Minecraft will set a specific blockstate to a block. Our plugin will use this feature to add new leaves blocks to the game:


Default example

Example config
custom_leaves:
  fir_leaves: #Example using ItemsAdder integration
    item:
      itemsadder: custom_blocks:fir_leaves
    block:
      base_material: AZALEA_LEAVES
      distance: 3
      persistent: true
      model: "custom_blocks:leaves/fir_leaves/fir_leaves" #Use a single model
    drops: "fir_leaves" #Use the name from drops.yml
    
  maple_leaves: #Example using Nexo integration
    item:
      nexo: maple_leaves
    block:
      base_material: AZALEA_LEAVES
      distance: 4
      persistent: true
      models: #Use multiple models
        - "leaves/maple_leaves/maple_leaves"
        - "leaves/maple_leaves/maple_leaves1"
        - "leaves/maple_leaves/maple_leaves2"
        - "leaves/maple_leaves/maple_leaves3"
    drops: "maple_leaves" #Use the name from drops.yml

Creating custom leaves

For example, I want to create a Maple Leaves block. Let's assume that you have already created your custom model.

1

Custom item creation

Create a basic item using Nexo or ItemsAdder without setting a custom block mechanic.

2

Hook your item

Hook your custom item to your custom leaf block in the item section.

custom_leaves.yml
custom_leaves:
  maple_leaves:
    item:
      itemsadder: custom_blocks:maple_leaves #ItemsAdder item
      # OR
      nexo: maple_leaves #Nexo item
      # OR
      material: PAPER
      name: "Maple Leaves"
      custom_model_data: 1000
      lore:
      - "Example item lore."
3

Create your block

Create the custom block in the block section and use the correct model path for model or models value:

custom_leaves.yml
custom_leaves:
  maple_leaves:
    block:
      base_material: AZALEA_LEAVES
      distance: 3
      persistent: true
      model: "leaves/maple_leaves/maple_leaves" #Use a single model
      # OR
      models: #Use multiple models
        - "leaves/maple_leaves/maple_leaves"
        - "leaves/maple_leaves/maple_leaves1"
        - "leaves/maple_leaves/maple_leaves2"
        - "leaves/maple_leaves/maple_leaves3"

Note: the model value is optional, it is only used to generate the correct blockstate file for your resource pack.

4

Create a drop table

Everything is detailed in the Drop Tables dedicated page.

5

Connect the drop table to your block

The drops value should be the name of your desired drop table.

custom_leaves.yml
custom_leaves:
  maple_leaves:
    drops: "maple_leaves" #Use the name from drops.yml
6

Reload the plugin

Use /foliage reload command to reload the plugin and load your new blocks.

7

Get the block

Use /foliage give leaf maple_leaves command to give yourself your custom leaf block.

Last updated