chips might say you're fat idk if it works

This commit is contained in:
Sunskimmer822 2022-03-18 15:22:29 -07:00
parent c5eeafadd6
commit 23c6e1f338

View File

@ -5,6 +5,7 @@ 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.text.LiteralText;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
@ -20,12 +21,14 @@ int potatoChipsConsumed = 0;
@Override
public TypedActionResult<ItemStack> use(World World, PlayerEntity PlayerEntity, Hand Hand) {
PlayerEntity.getHungerManager().add(1, 0f);
PlayerEntity.getHungerManager().add(1, 10f);
PlayerEntity.getStackInHand(Hand).decrement(1);
potatoChipsConsumed++;
if (potatoChipsConsumed == 69) {
PlayerEntity.addStatusEffect(new StatusEffectInstance(StatusEffects.HUNGER, 20 * 15, 4));
potatoChipsConsumed -= 69;
PlayerEntity.sendMessage(new LiteralText("I'm really fat/test"), false);
System.out.println("I'm really fat\n/test");
}
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, PlayerEntity.getStackInHand(Hand));
}