2025-11-24 22:52:51 +03:00

29 lines
808 B
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.world.item;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
public class WrittenBookItem
extends Item {
public WrittenBookItem(Item.Properties properties) {
super(properties);
}
@Override
public InteractionResult use(Level level, Player player, InteractionHand hand) {
ItemStack itemStack = player.getItemInHand(hand);
player.openItemGui(itemStack, hand);
player.awardStat(Stats.ITEM_USED.get(this));
return InteractionResult.SUCCESS;
}
}