-
Notifications
You must be signed in to change notification settings - Fork 0
J | Utility: EffectUtils
Sartaj Singh edited this page May 29, 2025
·
4 revisions
EffectUtils lets you add or manage potion effects as long as a player is holding a specific item.
1. addEffectWhileHolding(Player player, Material itemMaterial, PotionEffectType effect, int duration, int amplifier)
What it does:
Applies a potion effect as long as the player is holding the specified item. Effect is refreshed automatically.
Example:
EffectUtils.addEffectWhileHolding(player, Material.BLAZE_ROD, PotionEffectType.FIRE_RESISTANCE, 200, 1);Player will have Fire Resistance II as long as they hold the blaze rod.
What it does:
Removes any "while holding" effect from this player.
Example:
EffectUtils.removeEffectTask(player);What it does:
Returns true if a "while holding" effect task is currently active for the player.
Example:
if (EffectUtils.hasEffectTask(player)) {
// Player has a persistent effect task running
}- Grant passive buffs to players holding legendary items.
- Always remove effect tasks on logout, death, or item loss to avoid memory leaks.
- Home
- A | Getting Started & Plugin Overview
- B | The Registry System: Items, Foods, Commands, Events
- C | Creating Custom Items
- D | Creating Custom Foods
- E | Advanced: Custom Effects in FXItems
- F | Creating Custom Commands
- G | Creating Custom Events & Behaviors
- H | Utility: CooldownUtils
- I | Utility: CustomItemUtils
- J | Utility: EffectUtils
- K | Utility: ManaUtils
- L | Utility: OneTimeCraftUtils
- M | Utility: TeleportUtils
- N | Utility: ProjectileUtils
- O | Utility: GammaUtils
- P | Utility: EntitySizeUtils
- Q | FXItems API (com.noctify.API) & Making Addons
- R | Advanced Techniques, Gotchas & FAQ
- S | Auto-Registration System
- T | Migration Guide (v1.1 → v1.2+)
- U | Changelog