Class LUCK
LUCK applies Minecraft's LUCK potion effect to enhance the target player's fortune with improved item drop rates and loot quality. The effect increases the likelihood of receiving better loot from mobs, fishing, and mining while the effect is active. The effect is powered by the Minecraft potion effect system with strength (amplifier) set to 1, determining the luck magnitude. The effect is detectable by mind-reading spells (Legilimens) and information spells (Informous) which report the target "feels lucky". The player receives an affectation notification of "You feel lucky." when the effect is applied.
- See Also:
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionLUCK(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating a luck potion effect. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRemove()Perform cleanup when the luck effect is removed.Methods inherited from class net.pottercraft.ollivanders2.effect.PotionEffectSuper
checkEffect, getPotionEffectType, getStrength, setPermanent, setStrengthMethods inherited from class net.pottercraft.ollivanders2.effect.O2Effect
age, getAffectedPlayerText, getInformousText, getLegilimensText, getMaxDuration, getMinDuration, getRemainingDuration, getTargetID, isKilled, isPermanent, kill
-
Constructor Details
-
LUCK
public LUCK(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid) Constructor for creating a luck potion effect.Creates a potion effect that increases the target player's fortune with improved item drop rates using Minecraft's LUCK potion effect type. The effect is detected by information spells as the target "feels lucky" and notifies the player "You feel lucky."
- Parameters:
plugin- a callback to the MC pluginduration- the duration in ticks, snapped to min of 2 minutes, max of 5 minutesisPermanent- ignored - potion effects cannot be permanentpid- the unique ID of the player to bless with luck
-
-
Method Details
-
doRemove
public void doRemove()Perform cleanup when the luck effect is removed.The default implementation does nothing, as LUCK is a potion effect whose effects are automatically managed by the Minecraft potion system. When the effect expires or is manually removed, the player's item drop rates return to normal.
-