Foliage
Get on Polymart
  • 🏠Welcome
  • Getting Started
    • 🔩First Install
    • ⌨️Foliage Commands
  • Custom Content
    • 🍂Leaves
    • 🎋Saplings
      • 🌳Trees
    • 🪵Logs
    • Twisting Vines
  • Other
    • 📑Drop Tables
  • Settings
    • 🔋Performance
    • ❇️Vanilla Blocks Behaviour
      • Leaves
      • Saplings
      • Twisting Vines
      • Cave Vines
      • Sugar Cane
    • 🖼️Resource Pack
Powered by GitBook
On this page
  • How does it work ?
  • Default example
  • Creating custom leaves
  1. Custom Content

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

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
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.

PreviousFoliage CommandsNextSaplings

Last updated 2 months ago

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

Create a

Everything is detailed in the dedicated page.

Nexo
ItemsAdder
drop table
Drop Tables
🍂
Page cover image