Example item added (Adamantite Ingot)

This commit is contained in:
Prabuddha Hans 2024-07-21 18:55:01 +01:00
parent f16b6596d6
commit 1598612b5d
5 changed files with 45 additions and 3 deletions

View file

@ -0,0 +1,22 @@
package com.example;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
public class AdamantiteIngot extends Item{
public AdamantiteIngot(Item.Settings settings) {
super(settings);
}
@Override
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
user.playSound(SoundEvents.BLOCK_AMETHYST_BLOCK_CHIME, 1.0f, 1.0f);
return TypedActionResult.success(user.getStackInHand(hand));
}
}