public class CompassItem extends Item implements Vanishable
Item.Settings
Modifier and Type | Field and Description |
---|---|
private static Logger |
field_24670 |
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM
Constructor and Description |
---|
CompassItem(Item.Settings settings) |
Modifier and Type | Method and Description |
---|---|
static Optional<RegistryKey<World>> |
getLodestoneDimension(CompoundTag tag) |
String |
getTranslationKey(ItemStack stack)
Gets the translation key of this item using the provided item stack for context.
|
boolean |
hasGlint(ItemStack stack)
Checks if the glint effect should be applied when the item is rendered.
|
static boolean |
hasLodestone(ItemStack stack) |
void |
inventoryTick(ItemStack stack,
World world,
Entity entity,
int slot,
boolean selected) |
private void |
method_27315(RegistryKey<World> registryKey,
BlockPos blockPos,
CompoundTag compoundTag) |
ActionResult |
useOnBlock(ItemUsageContext context)
Called when an item is used on a block.
|
appendStacks, appendTooltip, asItem, byRawId, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getUseAction, hasRecipeRemainder, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnEntity
private static final Logger field_24670
public CompassItem(Item.Settings settings)
public static boolean hasLodestone(ItemStack stack)
public boolean hasGlint(ItemStack stack)
By default, returns true if the item has enchantments.
public static Optional<RegistryKey<World>> getLodestoneDimension(CompoundTag tag)
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected)
inventoryTick
in class Item
public ActionResult useOnBlock(ItemUsageContext context)
This method is called on both the logical client and logical server, so take caution when using this method.
The logical side can be checked using context.getWorld().isClient()
.
useOnBlock
in class Item
context
- the usage contextprivate void method_27315(RegistryKey<World> registryKey, BlockPos blockPos, CompoundTag compoundTag)
public String getTranslationKey(ItemStack stack)
getTranslationKey
in class Item