java.lang.Object
net.pottercraft.ollivanders2.item.enchantment.Enchantment
net.pottercraft.ollivanders2.item.enchantment.FLAGRANTE

public class FLAGRANTE extends Enchantment
Flagrante Curse causes objects to emit searing heat when touched.

When a player holds a flagrante-cursed item, they suffer continuous FLAGRANTE_BURNING damage. The curse is applied whenever the player picks up or holds the cursed item, and removed when they no longer hold it. Flagrante items cannot be picked up by hoppers or other block inventories, and they will not despawn from the world.

Damage is calculated from magnitude: damage = magnitude / 20, clamped between 0.5 and 8.0.

See Also:
  • Constructor Details

    • FLAGRANTE

      public FLAGRANTE(@NotNull @NotNull Ollivanders2 plugin, int mag, @Nullable @Nullable String args, @Nullable @Nullable String itemLore)
      Constructor for creating a flagrante curse enchantment instance.

      Initializes the curse with a calculated damage value based on magnitude. The damage is computed as magnitude / 20, then clamped between minDamage and maxDamage to ensure balanced curse strength across all magnitude levels.

      Parameters:
      plugin - the Ollivanders2 plugin instance
      mag - the magnitude (power level) of this enchantment instance
      args - optional configuration arguments specific to this enchantment instance
      itemLore - optional custom lore to display on the cursed item
  • Method Details

    • doEntityPickupItem

      public void doEntityPickupItem(@NotNull @NotNull org.bukkit.event.entity.EntityPickupItemEvent event)
      Apply the flagrante curse when a player picks up a cursed item.

      Triggers checkFlagranteStatus(Player) for the player picking up the item. Non-player entities are ignored since only players can be affected by the curse.

      Specified by:
      doEntityPickupItem in class Enchantment
      Parameters:
      event - the entity item pickup event
    • doInventoryPickupItem

      public void doInventoryPickupItem(@NotNull @NotNull org.bukkit.event.inventory.InventoryPickupItemEvent event)
      Prevent hoppers and other block inventories from picking up flagrante items.

      Flagrante-cursed items are too dangerous for automated collection systems and will not be picked up by hoppers, droppers, or other block-based inventories.

      Specified by:
      doInventoryPickupItem in class Enchantment
      Parameters:
      event - the inventory pickup event
    • doItemDrop

      public void doItemDrop(@NotNull @NotNull org.bukkit.event.player.PlayerDropItemEvent event)
      Update curse status when a player drops a cursed item.

      When a player drops a flagrante item, re-evaluate their curse status in case they are no longer holding another cursed item. If they are, the curse continues; otherwise it is removed.

      Specified by:
      doItemDrop in class Enchantment
      Parameters:
      event - the item drop event
    • doItemHeld

      public void doItemHeld(@NotNull @NotNull org.bukkit.event.player.PlayerItemHeldEvent event)
      No action needed for item held events.

      The flagrante curse is applied immediately when items enter the player's inventory (via doEntityPickupItem(EntityPickupItemEvent)), so no additional handling is required when the player changes which item slot is held.

      Specified by:
      doItemHeld in class Enchantment
      Parameters:
      event - the item held event