Skip to content

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.

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:

Register maple logs and stripped maple logs
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.

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.

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.

In your mod’s common initializer, after the blocks are registered, with the logs above and MAPLE_PLANKS:

Make maple burn and strip as oak does
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);

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

Draw the maple boat item from its texture
{
"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:

Name the maple blocks, boats, and boat entities
{
"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"
}

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:

Craft a maple boat from five maple planks
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"group": "boat",
"key": { "#": { "item": "mymod:maple_planks" } },
"pattern": ["# #", "###"],
"result": { "item": "mymod:maple_boat" }
}
Craft a maple chest boat from a maple boat and a chest
{
"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:

Tag the maple boat as a boat
{
"values": ["mymod:maple_boat"]
}
Tag the maple chest boat as a chest boat
{
"values": ["mymod:maple_chest_boat"]
}

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.