public class TridentItem extends Item implements Vanishable
Item.Settings| Modifier and Type | Field and Description |
|---|---|
private Multimap<EntityAttribute,EntityAttributeModifier> |
attributeModifiers |
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM| Constructor and Description |
|---|
TridentItem(Item.Settings settings) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canMine(BlockState state,
World world,
BlockPos pos,
PlayerEntity miner)
Checks if a player can break a block while holding the item.
|
Multimap<EntityAttribute,EntityAttributeModifier> |
getAttributeModifiers(EquipmentSlot slot) |
int |
getEnchantability()
Gets the enchantability of an item.
|
int |
getMaxUseTime(ItemStack stack) |
UseAction |
getUseAction(ItemStack stack) |
void |
onStoppedUsing(ItemStack stack,
World world,
LivingEntity user,
int remainingUseTicks) |
boolean |
postHit(ItemStack stack,
LivingEntity target,
LivingEntity attacker) |
boolean |
postMine(ItemStack stack,
World world,
BlockState state,
BlockPos pos,
LivingEntity miner) |
TypedActionResult<ItemStack> |
use(World world,
PlayerEntity user,
Hand hand)
Called when an item is used by a player.
|
appendStacks, appendTooltip, asItem, byRawId, canRepair, damage, finishUsing, fromBlock, getDefaultStack, getDrinkSound, getEatSound, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, useOnBlock, useOnEntityprivate final Multimap<EntityAttribute,EntityAttributeModifier> attributeModifiers
public TridentItem(Item.Settings settings)
public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner)
public UseAction getUseAction(ItemStack stack)
getUseAction in class Itempublic int getMaxUseTime(ItemStack stack)
getMaxUseTime in class Itempublic void onStoppedUsing(ItemStack stack, World world, LivingEntity user, int remainingUseTicks)
onStoppedUsing in class Itempublic TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand)
This method is called on both the logical client and logical server, so take caution when overriding this method.
The logical side can be checked using world.isClient().
use in class Itemworld - the world the item was used inuser - the player who used the itemhand - the hand usedpublic boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker)
public boolean postMine(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner)
public Multimap<EntityAttribute,EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot)
getAttributeModifiers in class Itempublic int getEnchantability()
If the value of this method is 0, the item cannot be enchanted using an enchanting table.
getEnchantability in class Item