P

palm tree mod

Kodari AI
KodariJun 9 at 7:48 am 58
PalmTreeMod
Adds palm trees to Minecraft! Features a custom Palm Log, Palm Planks, Palm Leaves, and Palm Sapling that grows into a full palm tree. Palm trees generate naturally in desert and beach biomes, featuring a tall trunk with a canopy of leaves at the top. Includes all standard wood variants: slabs, stairs, fences, fence gates, doors, trapdoors, and buttons crafted from Palm Planks.

Let me read the required docs before writing any code.

PalmTreeMod
Adds a full palm wood set to Minecraft! Features Palm Logs, Planks, Slabs, Stairs, Fences, Fence Gates, Doors, Trapdoors, Buttons, Pressure Plates, Leaves, and Saplings. Palm trees generate naturally in Desert and Beach biomes with tall trunks and a leafy canopy. All wood blocks use jungle-wood-style visuals as placeholders — swap in custom textures under assets/palmtreemod to customize the look.

Planning the full file set before writing:

  • Build: build.gradle, gradle.properties, settings.gradle

  • Java: PalmTreeMod, ModBlocks, ModItemGroups, ModWorldGen, PalmSaplingGenerator, PalmTreeModClient

  • Blockstates: 15 files (log, planks, slab, stairs, fence, gate, door, trapdoor, button, pressure plate, leaves, sapling + stripped variants)

  • Block models: ~30 files (column logs, slab/stair variants, fence parts, door halves, trapdoor variants, etc.)

  • Item definitions (items/): 15 files — mandatory in 1.21.4+

  • Item models for inventory items (fence, door, trapdoor, button etc.)

  • Recipes: 10 files

  • Loot tables: 15 files

  • Tags: minecraft-namespace additions (logs, planks, wooden_*, leaves, saplings, mineable/axe)

  • World gen: configured_feature + placed_feature JSON (namespaced subdirectory per 1.21.5+)

Now the blockstates:

Now the block models:

Now item models for blocks that need special inventory models:

Now the mandatory items/ definition files (1.21.4+ requirement):

Now the recipes:

Now loot tables (singular loot_table/ directory):

Now the tags. Minecraft-namespace tags use "replace": false to add to existing lists:

Now the world gen files. Note the namespaced subdirectory required since 1.21.5+:

That’s the complete Palm Tree Mod! Here’s a summary of what was built:

15 blocks — Palm Log, Stripped Palm Log, Palm Wood, Stripped Palm Wood, Planks, Slab, Stairs, Fence, Fence Gate, Door, Trapdoor, Button, Pressure Plate, Leaves, Sapling

World gen — Palm trees spawn in Desert and Beach biomes with straight 6–9 block trunks and a leafy blob canopy

Full crafting — All standard wood recipes wired up; planks crafted from any #palmtreemod:palm_logs ingredient

Tags — Registered in all appropriate minecraft: wood, leaves, and sapling tags so vanilla mechanics (fire spread, leaf decay, note blocks, etc.) work correctly

Textures — Models inherit vanilla Jungle Wood textures as placeholders. Replace any texture by dropping a PNG into assets/palmtreemod/textures/block/ and updating the model files to point to palmtreemod:block/<texture_name>.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
137 1,254
src/main/java/com/palmtreemod/PalmTreeMod.java
package com.palmtreemod;

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PalmTreeMod implements ModInitializer {
    public static final String MOD_ID = "palmtreemod";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        ModBlocks.initialize();
        ModItemGroups.initialize();
        ModWorldGen.initialize();
    }
}