Skip to content

EnzoHaegel/MinecraftTreeGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MinecraftTreeGenerator

A Paper 1.21.11 plugin to generate custom trees on a creative server.

In-game usage

  1. /treegen (or /tg) → you receive a Magic Sapling.
  2. Left-click with the sapling in hand → opens the configuration menu:
    • Trunk: drag & drop a block from your inventory onto the trunk slot.
    • Tree type: click to cycle between Oak, Birch, Cherry, Slender, Bonsai and Weeping.
    • Leaves: up to 9 blocks (drag & drop), each with its proportion in % (left-click +5 / right-click -5 / shift ±1 on the paper below). Right-click a leaf to remove it.
    • Air: percentage of holes in the foliage (sparse foliage).
    • Height / Width: left-click +1, right-click -1, shift ±5.
    • The config is saved on the sapling when the menu closes — each sapling has its own config.
  3. Right-click → plants the tree on the targeted block (range 120 blocks). Each tree has randomness: height, trunk waver, branch angles, foliage outlines.

The Classic and Bonsai trees have visible roots and a trunk that thickens with the width (up to ~3x3) and splits into scaffold branches.

The tree only replaces air, grass and leaves: it never destroys a build. Leaves are placed in persistent mode (no decay).

Build

Java 21 required. Maven is bundled in tools/:

tools\apache-maven-3.9.16\bin\mvn.cmd package

The jar is produced at target/TreeGenerator-1.0.0.jar → copy it into server/plugins/.

Local test server

cd server
start.bat

Paper 1.21.11 server (build 132), flat world, creative gamemode, on localhost:25565. After rebuilding the plugin, copy the jar into server/plugins/ and restart the server.

Code structure

  • TreeGenPlugin / TreeGenCommand — bootstrap + the /tg command.
  • config/TreeConfig — a sapling's config (serialized into the item in PDC).
  • item/SaplingItem — creation/reading of the magic sapling.
  • gui/TreeGui + gui/GuiListener — the configuration menu.
  • listener/InteractListener — left-click (menu) / right-click (planting).
  • gen/TreeGenerator — the generation algorithm (plan in memory, then application in the world; weighted leaf draw).

About

Générateur d'arbre custom sur minecraft

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages