Class GuideBookItem
java.lang.Object
net.minecraft.world.item.Item
net.ixdarklord.folios.api.GuideBookItem
- All Implemented Interfaces:
net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike
public class GuideBookItem
extends net.minecraft.world.item.Item
An item that opens a guide book when used. Folios registers one,
folios:guide_book, that opens the
book its folios:guide_book component names (GuideBooks.createStack(Identifier)); a mod can register its own for a
single book, which then needs no component:
ITEMS.register("handbook", () -> new GuideBookItem(properties, MyMod.id("handbook")));
Its name is the book's own, unless the stack has a custom name or item_name.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item.TooltipContext -
Field Summary
Fields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, APPROXIMATELY_INFINITE_USE_DURATION, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, CODEC, CODEC_WITH_BOUND_COMPONENTS, DEFAULT_MAX_STACK_SIZE, descriptionId, MAX_BAR_WIDTH, STREAM_CODECFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionGuideBookItem(net.minecraft.world.item.Item.Properties properties) An item that opens whichever book its stack's component names.GuideBookItem(net.minecraft.world.item.Item.Properties properties, @Nullable net.minecraft.resources.Identifier book) An item that always opens one book (its stacks' component, if any, wins). -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.resources.Identifierbook(net.minecraft.world.item.ItemStack stack) The book a stack of this item opens, or null when it names none.net.minecraft.network.chat.ComponentgetName(net.minecraft.world.item.ItemStack stack) voidinventoryTick(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity owner, @Nullable net.minecraft.world.entity.EquipmentSlot slot) net.minecraft.world.InteractionResultuse(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand) Methods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canDestroyBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getCraftingRemainder, getDefaultInstance, getDefaultMaxStackSize, getDescriptionId, getDestroySpeed, getId, getItemDamageSource, getPlayerPOVHitResult, getTooltipImage, getUseAnimation, getUseDuration, hurtEnemy, interactLivingEntity, isBarVisible, isCorrectToolForDrops, isFoil, mineBlock, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, shouldPrintOpWarning, toString, useOn, useOnReleaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
-
Constructor Details
-
GuideBookItem
public GuideBookItem(net.minecraft.world.item.Item.Properties properties) An item that opens whichever book its stack's component names. -
GuideBookItem
public GuideBookItem(net.minecraft.world.item.Item.Properties properties, @Nullable net.minecraft.resources.Identifier book) An item that always opens one book (its stacks' component, if any, wins).
-
-
Method Details
-
book
public @Nullable net.minecraft.resources.Identifier book(net.minecraft.world.item.ItemStack stack) The book a stack of this item opens, or null when it names none. -
use
public net.minecraft.world.InteractionResult use(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand) - Overrides:
usein classnet.minecraft.world.item.Item
-
inventoryTick
public void inventoryTick(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity owner, @Nullable net.minecraft.world.entity.EquipmentSlot slot) - Overrides:
inventoryTickin classnet.minecraft.world.item.Item
-
getName
public net.minecraft.network.chat.Component getName(net.minecraft.world.item.ItemStack stack) - Overrides:
getNamein classnet.minecraft.world.item.Item
-