tutorial:dynamic_model_generation
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:dynamic_model_generation [2020/10/15 12:15] – ↷ Page moved from dynamic_model_generation to tutorial:dynamic_model_generation deathunter | tutorial:dynamic_model_generation [2022/11/05 12:05] (current) – jab125 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | :!: //This page has been replaced by the Fabric Data Generation API tutorials, [[tutorial: | ||
| + | |||
| ====== Dynamic Model Generation ====== | ====== Dynamic Model Generation ====== | ||
| Dynamically generated models can mainly be used to add models to items or blocks that are generated, or if you want to auto-create them for a large number of items or blocks. | Dynamically generated models can mainly be used to add models to items or blocks that are generated, or if you want to auto-create them for a large number of items or blocks. | ||
| Line 16: | Line 18: | ||
| <code java> | <code java> | ||
| public static String createItemModelJson(String id, String type) { | public static String createItemModelJson(String id, String type) { | ||
| - | if (" | + | if (" |
| //The two types of items. " | //The two types of items. " | ||
| return " | return " | ||
| Line 27: | Line 29: | ||
| //However, if the item is a block-item, it will have a different model json than the previous two. | //However, if the item is a block-item, it will have a different model json than the previous two. | ||
| return " | return " | ||
| - | " | + | " |
| " | " | ||
| } | } | ||
| Line 55: | Line 57: | ||
| model.id = id.toString(); | model.id = id.toString(); | ||
| cir.setReturnValue(model); | cir.setReturnValue(model); | ||
| - | cir.cancel(); | ||
| } | } | ||
| } | } | ||
| </ | </ | ||
tutorial/dynamic_model_generation.1602764132.txt.gz · Last modified: 2020/10/15 12:15 by deathunter