Add a wood type with boats
This guide adds maple wood: logs that burn and strip, planks, a fence gate with maple’s wood type, and maple boats and chest boats that players can craft, place, and ride. It gives the Stope calls and the files the boats need; the logs, planks, and fence gate also need the ordinary files every vanilla-style block has, which you supply.
Register the logs and planks
Section titled “Register the logs and planks”Create the mod’s Registrar, REGISTRAR, and register MAPLE_PLANKS and its item as the
registration quick start
does, in a class your mod’s initializer loads. Register the logs beside them:
static final Registered<RotatedPillarBlock> MAPLE_LOG = REGISTRAR.block("maple_log", () -> new RotatedPillarBlock(BlockBehaviour.Properties.copy(Blocks.OAK_LOG)));static final Registered<RotatedPillarBlock> STRIPPED_MAPLE_LOG = REGISTRAR.block("stripped_maple_log", () -> new RotatedPillarBlock(BlockBehaviour.Properties.copy(Blocks.STRIPPED_OAK_LOG)));Register an item for each log the same way as for the planks.
Register the wood type and the fence gate
Section titled “Register the wood type and the fence gate”In the same class, register the wood type, its block set type, and the fence gate from the
Registrar example.
Register the fence gate’s item the same way as the planks’ item. Signs need sign blocks and
one more call each; see the
BlockBehaviors section.
Add the boats
Section titled “Add the boats”In the same class, add the boat set and maple’s boats from the
BoatSet and BoatWood example.
Which items, entity types, and renderers that registers, and which files the mod supplies, are
listed in that section.
Make the wood burn and strip
Section titled “Make the wood burn and strip”In your mod’s common initializer, after the blocks are registered, with the logs above and
MAPLE_PLANKS:
BlockBehaviors.flammable(MAPLE_LOG, 5, 5);BlockBehaviors.flammable(STRIPPED_MAPLE_LOG, 5, 5);BlockBehaviors.flammable(MAPLE_PLANKS, 5, 20);BlockBehaviors.strippable(MAPLE_LOG, STRIPPED_MAPLE_LOG);Supply the block files
Section titled “Supply the block files”The logs, the stripped logs, the planks, and the fence gate each need a blockstate file,
block and item models, and a loot table, and the planks need a recipe from the log, as any
vanilla-style block does. Follow vanilla’s oak files of the same names. To find the items in
the creative inventory, add them to a tab with Registrar#creativeTab.
Draw and name the boats
Section titled “Draw and name the boats”Draw the boat textures where BoatWood#texture points, laid out like vanilla’s oak boat and
chest boat. Each boat item needs a model and an item texture, as any item does. Save the boat’s
model as assets/mymod/models/item/maple_boat.json, and the chest boat’s the same way:
{ "parent": "minecraft:item/generated", "textures": { "layer0": "mymod:item/maple_boat" }}Name the blocks, the boats, and the boat entities in assets/mymod/lang/en_us.json; the
BoatSet and BoatWood section lists the entity keys:
{ "block.mymod.maple_log": "Maple Log", "block.mymod.stripped_maple_log": "Stripped Maple Log", "block.mymod.maple_planks": "Maple Planks", "block.mymod.maple_fence_gate": "Maple Fence Gate", "entity.mymod.boat": "Boat", "entity.mymod.chest_boat": "Boat with Chest", "item.mymod.maple_boat": "Maple Boat", "item.mymod.maple_chest_boat": "Maple Boat with Chest"}Add the boat recipes and tags
Section titled “Add the boat recipes and tags”The recipes follow vanilla’s oak boat and oak chest boat. Save them as
data/mymod/recipes/maple_boat.json and data/mymod/recipes/maple_chest_boat.json:
{ "type": "minecraft:crafting_shaped", "category": "misc", "group": "boat", "key": { "#": { "item": "mymod:maple_planks" } }, "pattern": ["# #", "###"], "result": { "item": "mymod:maple_boat" }}{ "type": "minecraft:crafting_shapeless", "category": "misc", "group": "chest_boat", "ingredients": [{ "item": "minecraft:chest" }, { "item": "mymod:maple_boat" }], "result": { "item": "mymod:maple_chest_boat" }}The minecraft:boats and minecraft:chest_boats item tags list the two items, so vanilla and
other mods treat them as boats. Save them as data/minecraft/tags/items/boats.json and
data/minecraft/tags/items/chest_boats.json:
{ "values": ["mymod:maple_boat"]}{ "values": ["mymod:maple_chest_boat"]}Try it in game
Section titled “Try it in game”With the block files in place, take maple logs from the creative inventory, or with
/give @s mymod:maple_log 4, and craft them into planks. Craft a maple boat from five maple
planks, place it on water, and ride it; break it and it drops the maple boat. Craft a chest
boat from it, and strip a maple log with an axe.
See also
Section titled “See also”- Registration and ids: the registrar, wood types, and boats.
- Block behavior and rendering: fire, stripping, composting, signs, leaves, and saplings for a new wood.
- Worldgen and loot: growing the wood’s trees in biomes.