User Tools

Site Tools


tutorial:items

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:items [2019/05/30 11:49] – [Introduction] Explain the use of placeholders jamieswhiteshirttutorial:items [2019/06/17 19:04] – modid refactoring draylar
Line 25: Line 25:
     public void onInitialize()     public void onInitialize()
     {     {
-        Registry.register(Registry.ITEM, new Identifier("wikitut", "fabric_item"), FABRIC_ITEM);+        Registry.register(Registry.ITEM, new Identifier("tutorial", "fabric_item"), FABRIC_ITEM);
     }      } 
 } }
Line 37: Line 37:
 Registering a texture for an item requires an item model .json file and a texture image. You're going to need to add these to your resource directory. The direct path of each is: Registering a texture for an item requires an item model .json file and a texture image. You're going to need to add these to your resource directory. The direct path of each is:
  
-    Item model: .../resources/assets/wikitut/models/item/fabric_item.json +    Item model: .../resources/assets/tutorial/models/item/fabric_item.json 
-    Item texture: .../resources/assets/wikitut/textures/item/fabric_item.png+    Item texture: .../resources/assets/tutorial/textures/item/fabric_item.png
  
-Note that wikitut is your modid. Our example texture can be found [[https://i.imgur.com/CqLSMEQ.png|here]].+Note that tutorial is your modid. Our example texture can be found [[https://i.imgur.com/CqLSMEQ.png|here]].
  
 If you registered your item properly in the first step, your game will complain about a missing texture file in a fashion similar to this: If you registered your item properly in the first step, your game will complain about a missing texture file in a fashion similar to this:
  
-    [Server-Worker-1/WARN]: Unable to load model: 'wikitut:fabric_item#inventory' referenced from: wikitut:fabric_item#inventory: java.io.FileNotFoundException: wikitut:models/item/fabric_item.json+    [Server-Worker-1/WARN]: Unable to load model: 'tutorial:fabric_item#inventory' referenced from: tutorial:fabric_item#inventory: java.io.FileNotFoundException: tutorial:models/item/fabric_item.json
 It conveniently tells you exactly where it expects your asset[s] to be found-- when in doubt, check the log. It conveniently tells you exactly where it expects your asset[s] to be found-- when in doubt, check the log.
  
Line 52: Line 52:
   "parent": "item/generated",   "parent": "item/generated",
   "textures": {   "textures": {
-    "layer0": "wikitut:item/fabric_item"+    "layer0": "tutorial:item/fabric_item"
   }   }
 } }
tutorial/items.txt · Last modified: 2024/04/20 08:05 by ryhon