package net.serenas.shitmod; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.world.World; public class kingsoul extends Item { public kingsoul(Settings settings) { super(settings); } public int availableSlots = 10; @Override public TypedActionResult use(World world, PlayerEntity PlayerEntity, Hand hand) { PlayerEntity.getHungerManager().add(1, 1); PlayerEntity.getMainHandStack().damage(1,PlayerEntity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND)); return new TypedActionResult(ActionResult.SUCCESS, PlayerEntity.getStackInHand(hand)); } }