Package com.pixelmonmod.pixelmon.items
Class HeldItem
java.lang.Object
net.minecraft.world.item.Item
com.pixelmonmod.pixelmon.items.PixelmonItem
com.pixelmonmod.pixelmon.items.HeldItem
- All Implemented Interfaces:
ITranslatable,net.minecraft.world.flag.FeatureElement,net.minecraft.world.level.ItemLike,net.neoforged.neoforge.common.extensions.IItemExtension
- Direct Known Subclasses:
AirBalloonItem,AmuletCoinItem,AssaultVestItem,BerryItem,BerryJuiceItem,BlackSludgeItem,BlankTechnicalMachineItem,BlunderPolicyItem,BoosterEnergyItem,BrightPowderItem,ChoiceItem,ClearAmuletItem,CovertCloakItem,CritEnhancingItem,DeepSeaToothScaleItem,DestinyKnotItem,EjectButtonItem,EjectPackItem,EVAdjusting,ExpertBeltItem,FairyFeatherItem,FlameOrbItem,FloatStoneItem,FocusBandItem,FocusSashItem,GemsItem,HeavyDutyBootsItem,IncensePowerIncreaseItem,IronBallItem,KingsRockItem,LaggingTailItem,LeftoversItem,LifeOrbItem,MailItem,MegaStoneItem,MemoryItem,MentalHerbItem,MetronomeItem,MilcerySweet,MirrorHerbItem,MuscleBandItem,NoItem,OrbItem,OriginFormItem,PowerHerbItem,ProtectivePadsItem,PunchingGloveItem,QuickClawItem,RaiseStatItem,RazorClawItem,RazorFangItem,RedCardItem,RingTargetItem,RockyHelmetItem,RoomServiceItem,RustedShieldItem,RustedSwordItem,SacredAshItem,SafetyGogglesItem,ScopeLensItem,ShellBellItem,SoulDewItem,StatEnhancingItems,StickyBarbItem,TerrainSeedItem,ThroatSprayItem,ToxicOrbItem,TypeEnhancingItems,UtilityUmbrellaItem,WeaknessPolicyItem,WhiteHerbItem,WideLensItem,ZCrystalItem,ZoomLensItem
Item representation of a held item.
-
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 com.pixelmonmod.pixelmon.items.PixelmonItem
bewlrFields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canRepair, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTHFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionHeldItem(EnumHeldItems heldItemType, net.minecraft.world.item.Item.Properties properties) Constructs the held item with predefined and defined attributes. -
Method Summary
Modifier and TypeMethodDescriptionintModifies the holder's critical hit ratio.booleanDetermines whether the held item affects multi-turn moves.booleanallowsIncomingAttack(PixelmonWrapper pokemon, PixelmonWrapper user, Attack a) Determines whether the holder can be hit by an incoming attack.voidallowsIncomingAttackMessage(PixelmonWrapper pokemon, PixelmonWrapper user, Attack a) Sends a battle message when the Pokémon's Ability nullifies an attack.booleanallowsStatChange(PixelmonWrapper target, PixelmonWrapper user, StatsEffect statsEffect) Determines whether the holder's stats can be changed.voidapplyEffectAfterAllMoveEffects(PixelmonWrapper attacker, PixelmonWrapper defender) Triggers after all the targets of an attack have defended.voidTriggers after a Pokémon attacks all of its targets.voidapplyEffectInDaycare(Pokemon pokemon, Pokemon partner) Triggers when a Pokémon is put in a daycare with another Pokémon.voidapplyEffectOnContact(PixelmonWrapper pokemon, PixelmonWrapper opponent) Triggers when a Pokémon makes contact with the holder.voidapplyPostSwitchEffect(PixelmonWrapper newPokemon) Triggers after all the Pokémon switch in at the start of turn.voidapplyRepeatedEffect(PixelmonWrapper pokemon) Triggers at the end of every turn.voidTriggers at the end of every turn after residual status damage has been applied.voidTriggers at the start of the turn, after switches and evolutions.voidapplySwitchInEffect(PixelmonWrapper newPokemon) Triggers when the holder switches in and when a Pokémon receives a held item in battle.voidTriggers when the holder switches out.static booleancanEatBerry(PixelmonWrapper user) Determines whether the Pokémon can eat Berries.static booleancanUseItem(PixelmonWrapper user) Determines whether the Pokémon can use held items.voiddealtDamage(PixelmonWrapper attacker, PixelmonWrapper defender, Attack attack, DamageTypeEnum damageType) Triggers when the holder deals damage.voideatBerry(PixelmonWrapper user) Called within Berry classes after determining whether or not the Berry will be eaten.Returns the type of held item.static HeldItemgetItemHeld(net.minecraft.world.item.ItemStack itemStack) Gets the type of held item for an item stack.Gets the localized name of the item.booleanChecks if the held item has a negative battle effect.booleanChecks if the held item cannot be suppressed by the Klutz ability.interact(PixelmonEntity pokemon, net.minecraft.world.item.ItemStack itemstack, net.minecraft.world.entity.player.Player player) Overrides the standard held item interaction (not consuming the held item) if needed.booleanisBerry()Determines whether the held item is a Berry.static booleanisItemOfType(net.minecraft.world.item.ItemStack itemStack, EnumHeldItems type) Returns whether an item is a certain held item.intmodifyConfusionDamage(int damage, PixelmonWrapper pw) Triggers when the Pokémon takes would take Confusion damage.doublemodifyDamageIncludeFixed(double damage, PixelmonWrapper attacker, PixelmonWrapper target, Attack attack) Modifies damage done on the holder by damaging attacks, including fixed damage.modifyEffectiveTypes(PixelmonWrapper user, PixelmonWrapper target, List<net.minecraft.core.Holder<Type>> types) Returns the types that will be used in calculating the Pokémon's attack's type effectiveness.voidmodifyMoveEffectChanceTarget(PixelmonWrapper user, PixelmonWrapper target, List<EffectBase> effects) Allows the target's held item to adjust the move's effects, such as disabling effects from CovertCloakvoidmodifyMoveEffectChanceUser(PixelmonWrapper user, PixelmonWrapper target, List<EffectBase> effects) Allows the user's held item to adjust the move's effects, such as adding Flinch from King's RockvoidmodifyMoveEffects(PixelmonWrapper user, PixelmonWrapper target, List<EffectBase> effects) Allows the user's held item to adjust the move's effects, such as adding Flinch from King's Rockint[]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.floatmodifyPriority(PixelmonWrapper pokemon, float priority, MutableBoolean fractional) 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.floatmodifyWeight(float initWeight) Modifies the Pokémon's weight.voidonAttackUsed(PixelmonWrapper user, Attack attack) Triggers when the holder uses an attack.voidonChargingUpAttack(PixelmonWrapper user, PixelmonWrapper target, Attack attack) Triggers if the user uses a turn to charge an attack.voidTriggers at the end of the battle.voidonGlobalStatusAdded(PixelmonWrapper itemHolder, GlobalStatusBase globalStatus) Triggers when a global status is added to the battle.voidonGlobalStatusRemoved(PixelmonWrapper itemHolder, GlobalStatusBase globalStatus) Triggers when a global status is removed from the battle.voidTriggers when a Pokémon loses the held item in battle.voidonMiss(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack) Triggers if the holder misses an attack.voidTriggers at the start of the battle (wherever this is).voidonStatDecrease(PixelmonWrapper pokemon, PixelmonWrapper cause, PixelmonWrapper affected, int amount, BattleStatsType stat) Triggers when a Pokémon's stat is decreased.voidonStatIncrease(PixelmonWrapper pokemon, PixelmonWrapper affected, int amount, BattleStatsType stat) Triggers when a Pokémon's stat is increased.voidonStatModified(PixelmonWrapper itemHolder, PixelmonWrapper affected) Triggers when a Pokémon's stats are modified.voidonStatusAdded(PixelmonWrapper user, PixelmonWrapper opponent, StatusBase status) Triggers when the holder is statused.voidonStatusRemoved(PixelmonWrapper user, StatusBase status) Triggers when a status is removed.voidonTerrainSwitch(BattleController bc, PixelmonWrapper user, Terrain terrain) Triggers when the terrain is changed in battle.voidonWeatherSwitch(BattleController bc, PixelmonWrapper user, Weather weather) Triggers when the weather is changed in battle.voidpostProcessAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack) Triggers after the holder uses an attack.voidpostProcessDamagingAttackSubstitute(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage) Triggers after the holder's Substitute is hit by a damaging attack.voidpostProcessDamagingAttackTarget(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage, DamageTypeEnum damageType) Triggers after the holder is hit by a damaging attack.voidpostProcessDamagingAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage) Triggers after the holder uses a damaging attack.doublepreProcessDamagingAttackTarget(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, double damage) Triggers before the holder is struck by a damaging attack.doublepreProcessDamagingAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, double damage) Triggers before the holder uses a damaging attack.booleanpreventsEffectsOfWeather(Weather weather) Determines whether the item prevents weather from affecting the user.voidtookDamage(PixelmonWrapper attacker, PixelmonWrapper defender, float damage, DamageTypeEnum damageType) Triggers when the holder takes damage.Methods inherited from class com.pixelmonmod.pixelmon.items.PixelmonItem
appendHoverText, causeTempt, getTooltipText, getTooltipText, getUseAnimation, hideFromSearches, isBookEnchantable, isDrink, isEdible, isEnchantable, isFoil, isSearchable, setDrink, setHasEffect, setTempt, useFromBag, useFromBagMethods inherited from class net.minecraft.world.item.Item
asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getTooltipImage, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isRepairable, isValidRepairItem, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, toString, use, useOn, useOnRelease, verifyComponentsAfterLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.neoforged.neoforge.common.extensions.IItemExtension
applyEnchantments, canBeHurtBy, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantmentMethods inherited from interface com.pixelmonmod.pixelmon.api.util.ITranslatable
getTranslatedName
-
Constructor Details
-
HeldItem
Constructs the held item with predefined and defined attributes.- Parameters:
heldItemType- Type of held item.
-
-
Method Details
-
getHeldItemType
Returns the type of held item.- Returns:
- The type of held item.
-
isItemOfType
public static boolean isItemOfType(net.minecraft.world.item.ItemStack itemStack, EnumHeldItems type) Returns whether an item is a certain held item.- Parameters:
itemStack- The item to check.type- The desired held item type.- Returns:
- Whether the item is of the desired held item type.
-
interact
public HeldItemInteractionResult interact(PixelmonEntity pokemon, net.minecraft.world.item.ItemStack itemstack, net.minecraft.world.entity.player.Player player) Overrides the standard held item interaction (not consuming the held item) if needed.- Parameters:
pokemon- The Pokémon being given the item.itemstack- The itemstack used to interact.player- The player using the item.- Returns:
- Whether the item was consumed.
-
applyStartOfTurnEffect
Triggers at the start of the turn, after switches and evolutions.- Parameters:
pw- The Pokémon holding this.
-
onStartOfBattle
Triggers at the start of the battle (wherever this is).- Parameters:
pw- The Pokémon holding this.
-
onEndOfBattle
Triggers at the end of the battle.- Parameters:
pw- The Pokémon in battle at the battle's end.
-
dealtDamage
public void dealtDamage(PixelmonWrapper attacker, PixelmonWrapper defender, Attack attack, DamageTypeEnum damageType) Triggers when the holder deals damage.- Parameters:
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.
-
tookDamage
public void tookDamage(PixelmonWrapper attacker, PixelmonWrapper defender, float damage, DamageTypeEnum damageType) Triggers when the holder takes damage.- Parameters:
attacker- The source of the damage.defender- The target of the damage.damage- The damage dealt.damageType- The type of damage that was dealt.
-
onAttackUsed
Triggers when the holder uses an attack.- Parameters:
user- The attack's user.attack- The attack.
-
preProcessDamagingAttackUser
public double preProcessDamagingAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, double damage) Triggers before the holder uses a damaging attack.- Parameters:
attacker- The attack's user.target- The attack's target.attack- The attack.damage- The damage to be dealt.- Returns:
- The modified damage.
-
preProcessDamagingAttackTarget
public double preProcessDamagingAttackTarget(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, double damage) Triggers before the holder is struck by a damaging attack.- Parameters:
attacker- The attack's user.target- The attack's target.attack- The attack.damage- The damage to be dealt.- Returns:
- The modified damage.
-
postProcessAttackUser
Triggers after the holder uses an attack.- Parameters:
attacker- The attack's user.target- The attack's target.attack- The attack.
-
postProcessDamagingAttackUser
public void postProcessDamagingAttackUser(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage) Triggers after the holder uses a damaging attack.- Parameters:
attacker- The attack's user.target- The attack's target.attack- The attack.damage- The damage dealt.
-
postProcessDamagingAttackTarget
public void postProcessDamagingAttackTarget(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage, DamageTypeEnum damageType) Triggers after the holder is hit by a damaging attack.- Parameters:
attacker- The attack's user.target- The attack's target.attack- The attack.damage- The damage dealt.damageType- The type of damage dealt.
-
postProcessDamagingAttackSubstitute
public void postProcessDamagingAttackSubstitute(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage) Triggers after the holder's Substitute is hit by a damaging attack.- Parameters:
attacker- The attack's user.target- The attack's target.attack- The attack.damage- The damage dealt.
-
modifyDamageIncludeFixed
public double modifyDamageIncludeFixed(double damage, PixelmonWrapper attacker, PixelmonWrapper target, Attack attack) Modifies damage done on the holder by damaging attacks, including fixed damage.- Parameters:
damage- The damage dealt.attacker- The attack's user.target- The attack's target.attack- The attack.- Returns:
- The modified damage.
-
modifyConfusionDamage
Triggers when the Pokémon takes would take Confusion damage.- Parameters:
damage- The amount of damage dealt.pw- The Pokémon taking damage.- Returns:
- The modified damage.
-
applyEffectAfterAllTargets
Triggers after a Pokémon attacks all of its targets.- Parameters:
user- The move's user.
-
applyEffectAfterAllMoveEffects
Triggers after all the targets of an attack have defended.- Parameters:
attacker- The move's user.defender- The Pokémon defending from the attacker.
-
onMiss
Triggers if the holder misses an attack.- Parameters:
attacker- The attack's user.target- The attack's intended target.attack- The attack used.
-
allowsIncomingAttack
Determines whether the holder can be hit by an incoming attack.- Parameters:
pokemon- The holder.user- The attack's user.a- The attack.- Returns:
- Whether the attack can hit the holder.
-
allowsIncomingAttackMessage
Sends a battle message when the Pokémon's Ability nullifies an attack.- Parameters:
pokemon- The Pokémon with the Ability.user- The attack's user.a- The attack.
-
allowsStatChange
public boolean allowsStatChange(PixelmonWrapper target, PixelmonWrapper user, StatsEffect statsEffect) Determines whether the holder's stats can be changed.- Parameters:
target- The holder.user- The attack's user.statsEffect- The stat change.- Returns:
- Whether the attack can hit the holder.
-
applySwitchInEffect
Triggers when the holder switches in and when a Pokémon receives a held item in battle.- Parameters:
newPokemon- The Pokémon switching in.
-
onItemLost
Triggers when a Pokémon loses the held item in battle.- Parameters:
pw- The Pokémon who lost the item.
-
applyPostSwitchEffect
Triggers after all the Pokémon switch in at the start of turn.- Parameters:
newPokemon- The Pokémon switching in.
-
applySwitchOutEffect
Triggers when the holder switches out.- Parameters:
pw- The Pokémon switching out.
-
onStatusAdded
Triggers when the holder is statused.- Parameters:
user- The statused Pokémon.opponent- The Pokémon that caused the status.status- The new status.
-
onGlobalStatusAdded
Triggers when a global status is added to the battle.- Parameters:
itemHolder- The Pokémon holding the item.globalStatus- The new status.
-
onStatusRemoved
Triggers when a status is removed.- Parameters:
user- The statused Pokémon.status- The new status.
-
onGlobalStatusRemoved
Triggers when a global status is removed from the battle.- Parameters:
itemHolder- The Pokémon holding the item.globalStatus- The new status.
-
onStatIncrease
public void onStatIncrease(PixelmonWrapper pokemon, PixelmonWrapper affected, int amount, BattleStatsType stat) Triggers when a Pokémon's stat is increased.- Parameters:
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.
-
onStatDecrease
public void onStatDecrease(PixelmonWrapper pokemon, PixelmonWrapper cause, PixelmonWrapper affected, int amount, BattleStatsType stat) Triggers when a Pokémon's stat is decreased.- Parameters:
pokemon- The Pokémon whose item it is.cause- The Pokémon that caused stat decrease.affected- The Pokémon whose stat was decreased.amount- The size of the decrease.stat- The stat that was decreased.
-
onStatModified
Triggers when a Pokémon's stats are modified.- Parameters:
itemHolder- The Pokémon holding the item.affected- The Pokémon whose stats were just modified.
-
onTerrainSwitch
Triggers when the terrain is changed in battle.- Parameters:
bc- The battle controller.user- The Pokémon whose holding this item.terrain- The terrain being switched in.
-
onWeatherSwitch
Triggers when the weather is changed in battle.- Parameters:
bc- The battle controller.user- The Pokémon whose holding this item.weather- The weather being switched in.
-
adjustCritStage
Modifies the holder's critical hit ratio.- Parameters:
user- The holder.
-
applyRepeatedEffect
Triggers at the end of every turn.- Parameters:
pokemon- The holder.
-
applyRepeatedEffectAfterStatus
Triggers at the end of every turn after residual status damage has been applied.- Parameters:
pokemon- The holder.
-
applyEffectOnContact
Triggers when a Pokémon makes contact with the holder.- Parameters:
pokemon- The attack's user.opponent- The attack's target.
-
applyEffectInDaycare
Triggers when a Pokémon is put in a daycare with another Pokémon.- Parameters:
pokemon- The holder.partner- The holder's partner in the daycare.
-
modifyEffectiveTypes
public List<net.minecraft.core.Holder<Type>> modifyEffectiveTypes(PixelmonWrapper user, PixelmonWrapper target, List<net.minecraft.core.Holder<Type>> types) Returns the types that will be used in calculating the Pokémon's attack's type effectiveness.- Parameters:
user- The attack's user.target- The attack's target.types- The existing target's types.- Returns:
- The target's modified types.
-
eatBerry
Called within Berry classes after determining whether or not the Berry will be eaten. Also called directly by certain moves (e.g., Bug Bite, Pluck).- Parameters:
user- The Pokémon consuming the Berry.
-
canEatBerry
Determines whether the Pokémon can eat Berries.- Parameters:
user- The holder.- Returns:
- Whether the Pokémon can eat Berries.
-
modifyPowerAndAccuracyUser
public int[] modifyPowerAndAccuracyUser(int[] modifiedMoveStats, PixelmonWrapper user, PixelmonWrapper target, Attack a) Modifies the power and accuracy of the Pokémon's attack.- Parameters:
modifiedMoveStats- The attack's power and accuracy.user- The attack's user.target- The attack's target.a- The attack.- Returns:
- The modified power and accuracy.
-
modifyPowerAndAccuracyTarget
public int[] modifyPowerAndAccuracyTarget(int[] modifiedMoveStats, PixelmonWrapper user, PixelmonWrapper target, Attack a) Modifies the power and accuracy of the attack about to hit the Pokémon.- Parameters:
modifiedMoveStats- The attack's power and accuracy.user- The attack's user.target- The attack's target.a- The attack.- Returns:
- The modified power and accuracy.
-
modifyStats
Modifies the Pokémon's stats at the beginning of a battle turn.- Parameters:
user- The Pokémon.stats- The Pokémon's stats.- Returns:
- The modified stats.
-
modifyPriority
Modifies the holder's attack's priority.- Parameters:
pokemon- The attack's user.priority- The attack's priority.fractional- Whether an ability before this also modified priority with a fractional change.- Returns:
- The modified priority.
-
affectMultiturnMove
Determines whether the held item affects multi-turn moves.- Parameters:
user- The holder.- Returns:
- Whether the held item affects multi-turn moves.
-
modifyMoveEffects
public void modifyMoveEffects(PixelmonWrapper user, PixelmonWrapper target, List<EffectBase> effects) Allows the user's held item to adjust the move's effects, such as adding Flinch from King's Rock- Parameters:
user- The item holder and attacking Pokemon.target- The Pokemon being attacked.effects- The current effects of the attack.
-
modifyMoveEffectChanceUser
public void modifyMoveEffectChanceUser(PixelmonWrapper user, PixelmonWrapper target, List<EffectBase> effects) Allows the user's held item to adjust the move's effects, such as adding Flinch from King's Rock- Parameters:
user- The item holder and attacking Pokemon.target- The Pokemon being attacked.effects- The current effects of the attack.
-
modifyMoveEffectChanceTarget
public void modifyMoveEffectChanceTarget(PixelmonWrapper user, PixelmonWrapper target, List<EffectBase> effects) Allows the target's held item to adjust the move's effects, such as disabling effects from CovertCloak- Parameters:
user- The item holder and attacking Pokemon.target- The Pokemon being attacked.effects- The current effects of the attack.
-
modifyWeight
public float modifyWeight(float initWeight) Modifies the Pokémon's weight.- Parameters:
initWeight- The Pokémon's weight.- Returns:
- The modified weight.
-
onChargingUpAttack
Triggers if the user uses a turn to charge an attack.- Parameters:
user- The attack's user.target- The attack's intended target.attack- The attack used.
-
hasNegativeEffect
public boolean hasNegativeEffect()Checks if the held item has a negative battle effect.- Returns:
- Whether the held item has a negative battle effect.
-
ignoresKlutz
public boolean ignoresKlutz()Checks if the held item cannot be suppressed by the Klutz ability.- Returns:
- Whether the held item can be used by a pokemon with the Klutz ability.
-
isBerry
public boolean isBerry()Determines whether the held item is a Berry.- Returns:
- Whether the held item is a Berry.
-
preventsEffectsOfWeather
Determines whether the item prevents weather from affecting the user. -
canUseItem
Determines whether the Pokémon can use held items.- Parameters:
user- The Pokémon.- Returns:
- Whether the Pokémon can use held items.
-
getItemHeld
Gets the type of held item for an item stack.- Parameters:
itemStack- The item stack to get a held item for.- Returns:
- The type of the item for the specified item stack.
-
getTranslationKey
- Specified by:
getTranslationKeyin interfaceITranslatable
-
getLocalizedName
Description copied from class:PixelmonItemGets the localized name of the item.- Specified by:
getLocalizedNamein interfaceITranslatable- Overrides:
getLocalizedNamein classPixelmonItem- Returns:
- The localized name of the item.
-