public class HeldItem extends PixelmonItem
Constructor and Description |
---|
HeldItem(EnumHeldItems heldItemType,
net.minecraft.item.Item.Properties properties)
Constructs the held item with predefined and defined attributes.
|
Modifier and Type | Method and Description |
---|---|
int |
adjustCritStage(PixelmonWrapper user)
Modifies the holder's critical hit ratio.
|
boolean |
affectMultiturnMove(PixelmonWrapper user)
Determines whether the held item affects multi-turn moves.
|
boolean |
allowsIncomingAttack(PixelmonWrapper pokemon,
PixelmonWrapper user,
Attack a)
Determines whether the holder can be hit by an incoming attack.
|
void |
allowsIncomingAttackMessage(PixelmonWrapper pokemon,
PixelmonWrapper user,
Attack a)
Sends a battle message when the Pokémon's Ability nullifies an attack.
|
void |
applyEffectAfterAllTargets(PixelmonWrapper user)
Triggers after a Pokemon attacks all of its targets.
|
void |
applyEffectInDaycare(Pokemon pokemon,
Pokemon partner)
Triggers when a Pokémon is put in a daycare with another Pokémon.
|
void |
applyEffectOnContact(PixelmonWrapper pokemon,
PixelmonWrapper opponent)
Triggers when a Pokémon makes contact with the holder.
|
void |
applyPostSwitchEffect(PixelmonWrapper newPokemon)
Triggers after all the Pokémon switch in at the start of turn.
|
void |
applyRepeatedEffect(PixelmonWrapper pokemon)
Triggers at the end of every turn.
|
void |
applyRepeatedEffectAfterStatus(PixelmonWrapper pokemon)
Triggers at the end of every turn after residual status damage has been applied.
|
void |
applySwitchInEffect(PixelmonWrapper newPokemon)
Triggers when the holder switches in and when a Pokémon receives a held item in battle.
|
void |
applySwitchOutEffect(PixelmonWrapper pw)
Triggers when the holder switches out.
|
static boolean |
canEatBerry(PixelmonWrapper user)
Determines whether the Pokémon can eat Berries.
|
static boolean |
canUseItem(PixelmonWrapper user)
Determines whether the Pokémon can use held items.
|
void |
dealtDamage(PixelmonWrapper attacker,
PixelmonWrapper defender,
Attack attack,
DamageTypeEnum damageType)
Triggers when the holder deals damage.
|
void |
eatBerry(PixelmonWrapper user)
Called within Berry classes after determining whether or not the Berry will be eaten.
|
java.util.List<Element> |
getEffectiveTypes(PixelmonWrapper user,
PixelmonWrapper target)
Returns the types that will be used in calculating the Pokémon's attack's type effectiveness.
|
EnumHeldItems |
getHeldItemType()
Returns the type of held item.
|
static HeldItem |
getItemHeld(net.minecraft.item.ItemStack itemStack)
Gets the type of held item for an item stack.
|
boolean |
hasNegativeEffect()
Checks if the held item has a negative battle effect.
|
boolean |
interact(PixelmonEntity pokemon,
net.minecraft.item.ItemStack itemstack,
net.minecraft.entity.player.PlayerEntity player)
Overrides the standard held item interaction (equipping the held item) if needed.
|
boolean |
isBerry()
Determines whether the held item is a Berry.
|
static boolean |
isItemOfType(net.minecraft.item.ItemStack itemStack,
EnumHeldItems type)
Returns whether an item is a certain held item.
|
double |
modifyDamageIncludeFixed(double damage,
PixelmonWrapper attacker,
PixelmonWrapper target,
Attack attack)
Modifies damage done on the holder by damaging attacks, including fixed damage.
|
int[] |
modifyPowerAndAccuracyTarget(int[] modifiedMoveStats,
PixelmonWrapper user,
PixelmonWrapper target,
Attack a)
Modifies the power and accuracy of the attack about to hit the Pokémon.
|
int[] |
modifyPowerAndAccuracyUser(int[] modifiedMoveStats,
PixelmonWrapper user,
PixelmonWrapper target,
Attack a)
Modifies the power and accuracy of the Pokémon's attack.
|
float |
modifyPriority(PixelmonWrapper pokemon,
float priority,
MutableBoolean triggered)
Modifies the holder's attack's priority.
|
int[] |
modifyStats(PixelmonWrapper user,
int[] stats)
Modifies the Pokémon's stats at the beginning of a battle turn.
|
float |
modifyWeight(float initWeight)
Modifies the Pokémon's weight.
|
void |
onAttackUsed(PixelmonWrapper user,
Attack attack)
Triggers when the holder uses an attack.
|
void |
onEndOfBattle(PixelmonWrapper pw)
Triggers at the end of the battle.
|
void |
onGlobalStatusAdded(PixelmonWrapper itemHolder,
GlobalStatusBase globalStatus)
Triggers when a global status is added to the battle.
|
void |
onMiss(PixelmonWrapper attacker,
PixelmonWrapper target,
Attack attack)
Triggers if the holder misses an attack.
|
void |
onStartOfBattle(PixelmonWrapper pw)
Triggers at the start of the battle (wherever this is).
|
void |
onStatDecrease(PixelmonWrapper pokemon,
PixelmonWrapper affected,
int amount,
BattleStatsType stat)
Triggers when a Pokémon's stat is decreased.
|
void |
onStatIncrease(PixelmonWrapper pokemon,
PixelmonWrapper affected,
int amount,
BattleStatsType stat)
Triggers when a Pokémon's stat is increased.
|
void |
onStatModified(PixelmonWrapper itemHolder,
PixelmonWrapper affected)
Triggers when a Pokémon's stats are modified.
|
void |
onStatusAdded(PixelmonWrapper user,
PixelmonWrapper opponent,
StatusBase status)
Triggers when the holder is statused.
|
void |
onTerrainSwitch(BattleController bc,
PixelmonWrapper user,
Terrain terrain)
Triggers when the terrain is changed in battle.
|
void |
onWeatherSwitch(BattleController bc,
PixelmonWrapper user,
Weather weather)
Triggers when the weather is changed in battle.
|
void |
postProcessAttackUser(PixelmonWrapper attacker,
PixelmonWrapper target,
Attack attack)
Triggers after the holder uses an attack.
|
void |
postProcessDamagingAttackTarget(PixelmonWrapper attacker,
PixelmonWrapper target,
Attack attack,
float damage)
Triggers after the holder is hit by a damaging attack.
|
void |
postProcessDamagingAttackUser(PixelmonWrapper attacker,
PixelmonWrapper target,
Attack attack,
float damage)
Triggers after the holder uses a damaging attack.
|
double |
preProcessDamagingAttackTarget(PixelmonWrapper attacker,
PixelmonWrapper target,
Attack attack,
double damage)
Triggers before the holder is struck by a damaging attack.
|
double |
preProcessDamagingAttackUser(PixelmonWrapper attacker,
PixelmonWrapper target,
Attack attack,
double damage)
Triggers before the holder uses a damaging attack.
|
void |
tookDamage(PixelmonWrapper attacker,
PixelmonWrapper defender,
float damage,
DamageTypeEnum damageType)
Triggers when the holder takes damage.
|
appendHoverText, causeTempt, fillItemCategory, getLocalizedName, getTooltipText, getTooltipText, getUseAnimation, hideFromSearches, isBookEnchantable, isDrink, isEdible, isEnchantable, isFoil, isSearchable, setDrink, setHasEffect, setTempt, useFromBag, useFromBag
allowdedIn, asItem, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, finishUsingItem, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getFoodProperties, getHarvestLevel, getId, getItemCategory, getItemStackTileEntityRenderer, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getTags, getToolTypes, getUseDuration, hasCraftingRemainingItem, hurtEnemy, interactLivingEntity, inventoryTick, is, isComplex, isCorrectToolForDrops, isFireResistant, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onUseTick, releaseUsing, shouldOverrideMultiplayerNbt, toString, use, useOn, useOnRelease, verifyTagAfterLoad
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canHarvestBlock, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, isShield, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
public HeldItem(EnumHeldItems heldItemType, net.minecraft.item.Item.Properties properties)
heldItemType
- Type of held item.public EnumHeldItems getHeldItemType()
public static boolean isItemOfType(net.minecraft.item.ItemStack itemStack, EnumHeldItems type)
itemStack
- The item to check.type
- The desired held item type.public boolean interact(PixelmonEntity pokemon, net.minecraft.item.ItemStack itemstack, net.minecraft.entity.player.PlayerEntity player)
pokemon
- The Pokémon being given the item.itemstack
- The itemstack used to interact.player
- The player using the item.public void onStartOfBattle(PixelmonWrapper pw)
pw
- The Pokémon holding this.public void onEndOfBattle(PixelmonWrapper pw)
pw
- The Pokémon in battle at the battle's end.public void dealtDamage(PixelmonWrapper attacker, PixelmonWrapper defender, Attack attack, DamageTypeEnum damageType)
attacker
- The source of the damage.defender
- The target of the damage.attack
- The attack used by the attacker.damageType
- The type of damage that was dealt.public void tookDamage(PixelmonWrapper attacker, PixelmonWrapper defender, float damage, DamageTypeEnum damageType)
attacker
- The source of the damage.defender
- The target of the damage.damage
- The damage dealt.damageType
- The type of damage that was dealt.public void onAttackUsed(PixelmonWrapper user, Attack attack)
user
- The attack's user.attack
- The attack.public double preProcessDamagingAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, double damage)
attacker
- The attack's user.target
- The attack's target.attack
- The attack.damage
- The damage to be dealt.public double preProcessDamagingAttackTarget(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, double damage)
attacker
- The attack's user.target
- The attack's target.attack
- The attack.damage
- The damage to be dealt.public void postProcessAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack)
attacker
- The attack's user.target
- The attack's target.attack
- The attack.public void postProcessDamagingAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage)
attacker
- The attack's user.target
- The attack's target.attack
- The attack.damage
- The damage dealt.public void postProcessDamagingAttackTarget(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage)
attacker
- The attack's user.target
- The attack's target.attack
- The attack.damage
- The damage dealt.public double modifyDamageIncludeFixed(double damage, PixelmonWrapper attacker, PixelmonWrapper target, Attack attack)
damage
- The damage dealt.attacker
- The attack's user.target
- The attack's target.attack
- The attack.public void onMiss(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack)
attacker
- The attack's user.target
- The attack's intended target.attack
- The attack used.public boolean allowsIncomingAttack(PixelmonWrapper pokemon, PixelmonWrapper user, Attack a)
pokemon
- The holder.user
- The attack's user.a
- The attack.public void allowsIncomingAttackMessage(PixelmonWrapper pokemon, PixelmonWrapper user, Attack a)
pokemon
- The Pokémon with the Ability.user
- The attack's user.a
- The attack.public void applyEffectAfterAllTargets(PixelmonWrapper user)
user
- The move's user.public void applySwitchInEffect(PixelmonWrapper newPokemon)
newPokemon
- The Pokémon switching in.public void applyPostSwitchEffect(PixelmonWrapper newPokemon)
newPokemon
- The Pokémon switching in.public void applySwitchOutEffect(PixelmonWrapper pw)
pw
- The Pokémon switching out.public void onStatusAdded(PixelmonWrapper user, PixelmonWrapper opponent, StatusBase status)
user
- The statused Pokémon.opponent
- The Pokémon that caused the status.status
- The new status.public void onGlobalStatusAdded(PixelmonWrapper itemHolder, GlobalStatusBase globalStatus)
itemHolder
- The Pokémon holding the item.globalStatus
- The new status.public void onStatIncrease(PixelmonWrapper pokemon, PixelmonWrapper affected, int amount, BattleStatsType stat)
pokemon
- The Pokémon whose item it is.affected
- The Pokémon whose stat was increased.amount
- The size of the increase.stat
- The stat that was increased.public void onStatDecrease(PixelmonWrapper pokemon, PixelmonWrapper affected, int amount, BattleStatsType stat)
pokemon
- The Pokémon whose item it is.affected
- The Pokémon whose stat was decreased.amount
- The size of the decrease.stat
- The stat that was decreased.public void onStatModified(PixelmonWrapper itemHolder, PixelmonWrapper affected)
itemHolder
- The Pokémon holding the item.affected
- The Pokémon whose stats were just modified.public void onTerrainSwitch(BattleController bc, PixelmonWrapper user, Terrain terrain)
bc
- The battle controller.user
- The Pokémon whose holding this item.terrain
- The terrain being switched in.public void onWeatherSwitch(BattleController bc, PixelmonWrapper user, Weather weather)
bc
- The battle controller.user
- The Pokémon whose holding this item.weather
- The weather being switched in.public int adjustCritStage(PixelmonWrapper user)
user
- The holder.public void applyRepeatedEffect(PixelmonWrapper pokemon)
pokemon
- The holder.public void applyRepeatedEffectAfterStatus(PixelmonWrapper pokemon)
pokemon
- The holder.public void applyEffectOnContact(PixelmonWrapper pokemon, PixelmonWrapper opponent)
pokemon
- The attack's user.opponent
- The attack's target.public void applyEffectInDaycare(Pokemon pokemon, Pokemon partner)
pokemon
- The holder.opponent
- The holder's partner in the daycare.public java.util.List<Element> getEffectiveTypes(PixelmonWrapper user, PixelmonWrapper target)
user
- The attack's user.target
- The attack's target.public void eatBerry(PixelmonWrapper user)
user
- The Pokémon consuming the Berry.public static boolean canEatBerry(PixelmonWrapper user)
user
- The holder.public int[] modifyPowerAndAccuracyUser(int[] modifiedMoveStats, PixelmonWrapper user, PixelmonWrapper target, Attack a)
modifiedMoveStats
- The attack's power and accuracy.user
- The attack's user.target
- The attack's target.a
- The attack.public int[] modifyPowerAndAccuracyTarget(int[] modifiedMoveStats, PixelmonWrapper user, PixelmonWrapper target, Attack a)
modifiedMoveStats
- The attack's power and accuracy.user
- The attack's user.target
- The attack's target.a
- The attack.public int[] modifyStats(PixelmonWrapper user, int[] stats)
user
- The Pokémon.stats
- The Pokémon's stats.public float modifyPriority(PixelmonWrapper pokemon, float priority, MutableBoolean triggered)
pokemon
- The attack's user.priority
- The attack's priority.triggered
- Whether an ability before this also modified priority.public boolean affectMultiturnMove(PixelmonWrapper user)
user
- The holder.public float modifyWeight(float initWeight)
initWeight
- The Pokémon's weight.public boolean hasNegativeEffect()
public boolean isBerry()
public static boolean canUseItem(PixelmonWrapper user)
user
- The Pokémon.public static HeldItem getItemHeld(net.minecraft.item.ItemStack itemStack)
itemStack
- The item stack to get a held item for.