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 revision
Previous revision
Next revisionBoth sides next revision
tutorial:items [2020/09/23 08:33] – Change Item.Settings to FabricItemSettings because it exists ytg1234tutorial:items [2020/11/02 07:32] – [Registering an Item] fix formatting leocth2
Line 28: Line 28:
 } }
 </code> </code>
-Your new item has now been added to Minecraft. Run the `runClientgradle task to see it in action.+Your new item has now been added to Minecraft. Run the ''runClient'' gradle task to see it in action.
  
 {{:tutorial:2019-02-17_16.50.44.png?400|}} {{:tutorial:2019-02-17_16.50.44.png?400|}}
Line 49: Line 49:
 <code JavaScript> <code JavaScript>
 { {
-  "parent": "item/generated",+  "parent": "builtin/generated",
   "textures": {   "textures": {
     "layer0": "tutorial:item/fabric_item"     "layer0": "tutorial:item/fabric_item"
Line 84: Line 84:
     public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) {     public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) {
         playerEntity.playSound(SoundEvents.BLOCK_WOOL_BREAK, 1.0F, 1.0F);         playerEntity.playSound(SoundEvents.BLOCK_WOOL_BREAK, 1.0F, 1.0F);
-        return new TypedActionResult<>(ActionResult.SUCCESS, playerEntity.getStackInHand(hand));+        return TypedActionResult.success(playerEntity.getStackInHand(hand));
     }     }
 } }
tutorial/items.txt · Last modified: 2024/06/17 12:49 by solidblock