public class SwordItem extends ToolItem implements Vanishable
Item.Settings
Modifier and Type | Field and Description |
---|---|
private float |
attackDamage |
private Multimap<EntityAttribute,EntityAttributeModifier> |
attributeModifiers |
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM
Constructor and Description |
---|
SwordItem(ToolMaterial toolMaterial,
int attackDamage,
float attackSpeed,
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.
|
float |
getAttackDamage() |
Multimap<EntityAttribute,EntityAttributeModifier> |
getAttributeModifiers(EquipmentSlot slot) |
float |
getMiningSpeedMultiplier(ItemStack stack,
BlockState state) |
boolean |
isEffectiveOn(BlockState state) |
boolean |
postHit(ItemStack stack,
LivingEntity target,
LivingEntity attacker) |
boolean |
postMine(ItemStack stack,
World world,
BlockState state,
BlockPos pos,
LivingEntity miner) |
canRepair, getEnchantability, getMaterial
appendStacks, appendTooltip, asItem, byRawId, damage, finishUsing, fromBlock, getDefaultStack, getDrinkSound, getEatSound, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnBlock, useOnEntity
private final float attackDamage
private final Multimap<EntityAttribute,EntityAttributeModifier> attributeModifiers
public SwordItem(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Item.Settings settings)
public float getAttackDamage()
public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner)
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state)
getMiningSpeedMultiplier
in class Item
public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker)
public boolean postMine(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner)
public boolean isEffectiveOn(BlockState state)
isEffectiveOn
in class Item
public Multimap<EntityAttribute,EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot)
getAttributeModifiers
in class Item