tutorial:adding_to_loot_tables
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:adding_to_loot_tables [2022/03/27 07:08] – stormyfabric | tutorial:adding_to_loot_tables [2022/03/27 07:20] – stormyfabric | ||
---|---|---|---|
Line 11: | Line 11: | ||
Fabric API has an event that’s fired when loot tables are loaded, '' | Fabric API has an event that’s fired when loot tables are loaded, '' | ||
- | <code java> | + | <yarncode |
// No magic constants! | // No magic constants! | ||
- | private static final Identifier | + | private static final class_2960 |
// Actual code | // Actual code | ||
Line 22: | Line 22: | ||
} | } | ||
}); | }); | ||
- | </code> | + | </yarncode> |
===== Adding items to the table ===== | ===== Adding items to the table ===== | ||
Line 30: | Line 30: | ||
We can make a pool with '' | We can make a pool with '' | ||
- | <code java> | + | <yarncode |
LootTableLoadingCallback.EVENT.register((resourceManager, | LootTableLoadingCallback.EVENT.register((resourceManager, | ||
if (COAL_ORE_LOOT_TABLE_ID.equals(id)) { | if (COAL_ORE_LOOT_TABLE_ID.equals(id)) { | ||
Line 39: | Line 39: | ||
} | } | ||
}); | }); | ||
- | </code> | + | </yarncode> |
Our pool doesn’t have any items yet, so we’ll make an item entry and add it to the pool, and we're done: | Our pool doesn’t have any items yet, so we’ll make an item entry and add it to the pool, and we're done: | ||
tutorial/adding_to_loot_tables.txt · Last modified: 2024/02/05 16:08 by mschae23