2022-03-01 23:07:57 -06:00

30 lines
1014 B
Java

package net.serenas.shitmod;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
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.TypedActionResult;
import net.minecraft.world.World;
import net.minecraft.util.Hand;
public class stalwartShell extends Item{
public stalwartShell(Settings settings) {
super(settings);
}
@Override
public TypedActionResult<ItemStack> use(World world, PlayerEntity Playerentity, Hand hand) {
Playerentity.addStatusEffect(new StatusEffectInstance(StatusEffects.RESISTANCE, 20, 5));
Playerentity.getMainHandStack().damage(1,Playerentity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, Playerentity.getStackInHand(hand));
}
}