tutorial:datagen_tags
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutorial:datagen_tags [2022/08/08 20:05] – created mineblock11 | tutorial:datagen_tags [2023/06/05 18:22] (current) – [Adding stuff to the builder] mcrafterzz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tag Generation ====== | ====== Tag Generation ====== | ||
- | The '' | + | The '' |
This page will follow you through all aspects of this provider. | This page will follow you through all aspects of this provider. | ||
- | To create a '' | + | To create a tag generator, create a class that extends |
<code java> | <code java> | ||
- | private static class MyTagGenerator extends | + | private static class MyTagGenerator extends |
- | | + | |
- | | + | super(output, completableFuture); |
} | } | ||
| | ||
- | | + | |
+ | | ||
} | } | ||
} | } | ||
Line 33: | Line 33: | ||
===== Adding a tag ===== | ===== Adding a tag ===== | ||
- | To add a tag, simply call the '' | + | To add a tag, simply call the '' |
<code java> | <code java> | ||
- | private static final TagKey< | + | private static final TagKey< |
@Override | @Override | ||
- | protected void generateTags() { | + | protected void configure(WrapperLookup arg) { |
// This creates a tag builder, where we add slime balls, rotten flesh and everything in the minecraft: | // This creates a tag builder, where we add slime balls, rotten flesh and everything in the minecraft: | ||
| | ||
Line 48: | Line 48: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | Output from the example above: | ||
+ | |||
+ | <file javascript smelly_items.json> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
===== Adding stuff to the builder ===== | ===== Adding stuff to the builder ===== | ||
Line 64: | Line 80: | ||
<code java> | <code java> | ||
- | private static final TagKey< | + | private static final TagKey< |
@Override | @Override | ||
- | protected void generateTags() { | + | protected void configure(WrapperLookup arg) { |
| | ||
.add(Items.SLIME_BALL) | .add(Items.SLIME_BALL) |
tutorial/datagen_tags.1659989141.txt.gz · Last modified: 2022/08/08 20:05 by mineblock11