33 lines
900 B
Java
33 lines
900 B
Java
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<ItemStack> 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<ItemStack>(ActionResult.SUCCESS, PlayerEntity.getStackInHand(hand));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|