minecraft_modding-example/src/main/java/com/example/AdamantiteIngot.java
2024-07-21 18:55:01 +01:00

22 lines
677 B
Java

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));
}
}