Skip to content

Wooden Items

petrolpark edited this page Jan 25, 2026 · 18 revisions

Wooden Items refers specifically to Blocks and Items that can be crafted out of any wood, vanilla or modded, which this library provides. This information is stored in the petrolpark:wood Data Component (for Items).

Models

Wooden Item models use the relevant oak texture for any texture that should change based on the wood the Item is made of. At runtime, the oak textures will be replaced with the textures for the correct wood.

To create a model for a Wooden Item, use the petrolpark:wooden Geometry Loader and place the file in the usual place. This has a single parameter, template, which should be the model of the item with the oak equivalent for all wood textures. For example, the following just copies the model for Logs:

{
 "loader": "petrolpark:wooden",
 "template": {
  "parent": "minecraft:block/cube_column",
  "textures": {
    "end": "minecraft:block/oak_log_top",
    "side": "minecraft:block/oak_log"
  }
 }
}

The textures which will be replaced are unfortunately hard-coded, and are limited to:

  • minecraft:block/oak_planks
  • minecraft:block/oak_log
  • minecraft:block/oak_log_top
  • minecraft:block/stripped_oak_log
  • minecraft:block/stripped_oak_log_top
  • minecraft:block/oak_leaves
  • minecraft:block/oak_door_top
  • minecraft:block/oak_door_bottom
  • minecraft:block/oak_trapdoor

For each texture, the library will try to search for the matching texture for the type of wood given in the petrolpark:wood Data Component. Each texture will default to oak. Wooden Items will have their wood automatically applied to the model, but for Blocks this information must be supplied manually.

Crafting Recipes

For your Item to be crafted from arbitrary wood types, you must use a petrolpark:wooden_crafting_shaped Recipe. This is formatted like a vanilla shaped Recipe, with the exception that certain symbols are reserved for certain Item tags. These are:

  • P for planks (tagged minecraft:planks)
  • s for slabs (tagged minecraft:wooden_slabs)
  • S for stairs (tagged minecraft:wooden_stairs)
  • F for fences (tagged c:fences/wooden)
  • G for fence gates (tagged c:fence_gates/wooden)
  • b for buttons (tagged minecraft:wooden_buttons)
  • L for logs (tagged minecraft:logs)
  • l for stripped logs (tagged c:stripped_logs)
  • E for leaves (tagged minecraft:leaves or minecraft:wart_blocks)
  • A for saplings (tagged minecraft:saplings)
  • p for pressure plates (tagged minecraft:wooden_pressure_plates)
  • D for doors (tagged minecraft:wooden_doors)
  • T for trapdoors (tagged minecraft:wooden_trapdoors)
  • I for signs (tagged minecraft:signs)
  • H for hanging signs (tagged minecraft:hanging_signs)
  • B for boats (tagged minecraft:boats)

When the Wooden Item is crafted, all Ingredients conforming to those listed above must be the same wood type, and this wood will be conferred to the output. Any Ingredients with the petrolpark:wood Data Component must also match. Your recipe must include at least one of the Ingredients listed above to parse correctly (as otherwise there is no way of knowing which wood to confer to the result).

Blocks

For your Wooden Item to be placeable, the type of wood must be stored, so it must be a Block Entity. It must:

  1. Confer the wood type of the Item to the Block when it is placed
  2. Supply the wood to the model
  3. Confer the wood type to the Item when the Block is broken

This is done for you if you extend WoodenBlockEntity and include the appropriate function in the Loot Table file:

{
  "type": "minecraft:block",
  "pools": [
    {
      "bonus_rolls": 0.0,
      "conditions": [
        {
          "condition": "minecraft:survives_explosion"
        }
      ],
      "entries": [
        {
          "type": "minecraft:item",
          "functions": [
            {
              "function": "minecraft:copy_components",
              "include": [
                "petrolpark:wood"
              ],
              "source": "block_entity"
            }
          ],
          "name": "mymod:my_wooden_block"
        }
      ],
      "rolls": 1.0
    }
  ],
  "random_sequence": "mymod:blocks/my_wooden_block"
}

That Loot Table would be generated by something like this:

lootTable()
 .withPool(
  lt.applyExplosionCondition(MY_WOODEN_ITEM, lootPool()
   .setRolls(ConstantValue.exactly(1f))
   .add(lootTableItem(b).apply(CopyComponentsFunction.copyComponents(CopyComponentsFunction.Source.BLOCK_ENTITY)
    .include(PetrolparkDataComponentTypes.WOOD)
   ))
  )
 )

API Reference

Flags than can be applied to Item Stacks and other objects and will propagate through crafting

Timers that can be attached to Item Stacks to modify them after a given time, no matter what Inventory they are in

A way for mods to detect groupings of Players and store information on these groupings

Manipulation of Loot Table randomness and other RNG to give desired Items

Additional inventory and hotbar slots for the Player

Blocks and Items that have variants craftable from any mod's wood

Loot and Data

Data-driven modifications to existing Loot Tables with greater versatility than NeoForge Global Loot Modifiers

Data-driven changes to the world (give Items, XP, unlock Villager Trades)

Levelable "Shops" shared between Teams giving Rewards for randomly-generated Item requests

Additional implementations of vanilla's Number Providers used in Loot Tables and Advancements

Recipes

Extension of NeoForge Ingredients to include descriptions and Loot Table forcing

Work with automatically-detected "compression" Recipes (e.g. Nuggets <-> Ingots <-> Blocks)

Recycling (page under construction)

Balanced and versatile "uncrafting" API

Gating Recipes for vanilla and modded Items behind Item unlocks

Changelogs

1.3.1, 1.3.2, 1.3.3, 1.3.4
1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.4.18, 1.4.19, 1.4.20, 1.4.21, 1.4.22, 1.4.23, 1.4.24, 1.4.25, 1.4.26

Clone this wiki locally