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

public class GEMINO extends Enchantment
GEMINO duplication curse for items.

GEMINO is an expert-level curse that causes items to multiply exponentially when picked up by a player. When a player picks up a gemino-cursed item, 2^magnitude additional copies are added to their inventory, creating exponential duplication. For example: magnitude 1 creates 2 copies (2^1), magnitude 2 creates 4 copies (2^2), magnitude 3 creates 8 copies (2^3), magnitude 4 creates 16 copies (2^4).

The exponential nature of this curse means it can quickly fill a player's inventory, potentially causing inventory overflow and item loss. The cursed item itself is not duplicated—only unenchanted copies are added. Gemino items cannot be picked up by hoppers or other block inventories, preventing automated systems from triggering the curse.

Curse behavior:

  • Player pickup: triggers exponential duplication (2^magnitude copies added)
  • Hopper pickup: blocked, hoppers cannot trigger the curse
  • Drop events: no special behavior, duplication only occurs on pickup
  • Slot switching: no special behavior, duplication only occurs on pickup
See Also:
  • Constructor Details

    • GEMINO

      public GEMINO(@NotNull @NotNull Ollivanders2 plugin, int mag, @Nullable @Nullable String args, @Nullable @Nullable String itemLore)
      Constructor for creating a gemino curse enchantment instance.
      Parameters:
      plugin - the Ollivanders2 plugin instance
      mag - the magnitude (power level) of this enchantment, affects number of copies created
      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 GEMINO curse when a player picks up a cursed item.

      This method triggers the exponential duplication when a player picks up a gemino-cursed item:

      • Clones the picked-up item and removes all enchantment NBT data
      • Sets the amount to 2^magnitude (creates the duplicate copies)
      • Adds the duplicates (without the curse) to the player's inventory

      The original gemino-cursed item is also added to the inventory via the normal pickup event flow. Combined with the duplicates, this can quickly overwhelm the player's inventory. Non-player entities are ignored since only players can be affected by the curse.

      Important: The duplicates created by this method have the enchantment NBT removed, so they will not trigger additional duplication if picked up again by another player.

      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 gemino items.

      Gemino-cursed items are too dangerous for automated collection systems and could cause exponential item duplication issues.

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

      public void doItemDrop(@NotNull @NotNull org.bukkit.event.player.PlayerDropItemEvent event)
      No action needed for item drop events.

      The gemino curse only triggers when items are picked up, not when they are dropped. Dropping a gemino item does not trigger duplication.

      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 gemino curse only triggers when items are picked up from the world, not when the player switches which item slot is held.

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