minecraft-src/net/minecraft/world/item/WritableBookItem.java
2025-07-04 02:00:41 +03:00

21 lines
679 B
Java

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.level.Level;
public class WritableBookItem extends Item {
public WritableBookItem(Item.Properties properties) {
super(properties);
}
@Override
public InteractionResult use(Level level, Player player, InteractionHand interactionHand) {
ItemStack itemStack = player.getItemInHand(interactionHand);
player.openItemGui(itemStack, interactionHand);
player.awardStat(Stats.ITEM_USED.get(this));
return InteractionResult.SUCCESS;
}
}