All Implemented Interfaces:
Serializable

public class HERBICIDE extends ThrownPotionStationarySpell
A stationary spell that destroys plants and vegetation within a protected area.

Herbicide creates a powerful killing field that eliminates all plant life by:

  • Replacing plants with dead alternatives (leaves become air, grass becomes dirt, etc.)
  • Dropping items for saplings and vegetation
  • Resetting crop growth to age 0
  • Checking WorldGuard permissions to prevent griefing

The spell targets a comprehensive list of plant materials including flowers, crops, leaves, mossy blocks, potted plants, and mushrooms.

See Also:
  • Field Details

    • minRadiusConfig

      public static final int minRadiusConfig
      Minimum spell radius (5 blocks).
      See Also:
    • maxRadiusConfig

      public static final int maxRadiusConfig
      Maximum spell radius (20 blocks).
      See Also:
    • minDurationConfig

      public static final int minDurationConfig
      Minimum spell duration (30 seconds).
      See Also:
    • maxDurationConfig

      public static final int maxDurationConfig
      Maximum spell duration (30 minutes).
      See Also:
  • Constructor Details

    • HERBICIDE

      public HERBICIDE(@NotNull @NotNull Ollivanders2 plugin)
      Simple constructor used for deserializing saved stationary spells at server start. Do not use to cast spell.
      Parameters:
      plugin - a callback to the MC plugin
    • HERBICIDE

      public HERBICIDE(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull UUID pid, @NotNull @NotNull org.bukkit.Location location, int radius, int duration)
      Constructs a new HERBICIDE spell cast by a player.

      Creates a herbicide field at the specified location with the given radius and duration. All plant life within the radius will be destroyed or transformed into dead alternatives.

      Parameters:
      plugin - a callback to the MC plugin (not null)
      pid - the UUID of the player who cast the spell (not null)
      location - the center location of the spell (not null)
      radius - the radius for this spell (will be clamped to min/max values)
      duration - the duration of the spell in ticks (will be clamped to min/max values)
  • Method Details

    • upkeep

      public void upkeep()
      Ages the spell and eliminates plant life within the protected area.

      Every 10 ticks, processes all blocks in the spell radius:

      • Replaces plant blocks with dead alternatives (leaves→air, grass→dirt, etc.)
      • Drops items for saplings/bamboo and removes the block
      • Resets crop age to 0 for immature crops
      Specified by:
      upkeep in class O2StationarySpell
    • serializeSpellData

      @NotNull public @NotNull Map<String,String> serializeSpellData()
      Serializes the herbicide spell data for persistence.

      The herbicide spell has no extra data to serialize beyond the base spell properties, so this method returns an empty map.

      Returns:
      an empty map (the spell has no custom data to serialize)
    • deserializeSpellData

      public void deserializeSpellData(@NotNull @NotNull Map<String,String> spellData)
      Deserializes herbicide spell data from saved state.

      The herbicide spell has no extra data to deserialize, so this method does nothing.

      Parameters:
      spellData - the serialized spell data map (not used)