Class REPELLO_MUGGLETON

All Implemented Interfaces:
Serializable

public class REPELLO_MUGGLETON extends ConcealmentShieldSpell
The Muggle-Repelling Charm (Repello Muggleton) - a stationary concealment shield spell that prevents non-magical people from seeing or entering a protected area.

When a muggle attempts to enter the spell area, they are repelled with an inexplicable compulsion to go elsewhere - they remember urgent tasks or important appointments. Muggles also cannot see wizards or witches who are concealed within the spell area, nor can they hear conversations happening inside. Unlike some concealment spells, this charm does not trigger proximity alarms when muggles approach.

Behavior:

  • Muggles cannot enter the spell area (canEnter(LivingEntity) returns false)
  • Muggles cannot see wizards inside (canSee(LivingEntity) returns false)
  • Muggles cannot hear conversations from inside (canHear(LivingEntity) returns false)
  • All entities (including muggles) can target players inside without restriction
  • No proximity alarms are triggered when muggles approach the boundary
Since:
2.21
See Also:
  • Field Details

    • minRadiusConfig

      public static final int minRadiusConfig
      Minimum spell radius in blocks (5 blocks). The smallest protected area that can be created with this spell.
      See Also:
    • maxRadiusConfig

      public static final int maxRadiusConfig
      Maximum spell radius in blocks (20 blocks). The largest protected area that can be created with this spell.
      See Also:
    • minDurationConfig

      public static final int minDurationConfig
      Minimum spell duration in ticks (30 seconds). The shortest time a spell can persist after being cast.
      See Also:
    • maxDurationConfig

      public static final int maxDurationConfig
      Maximum spell duration in ticks (30 minutes). The longest time a spell can persist after being cast.
      See Also:
  • Constructor Details

    • REPELLO_MUGGLETON

      public REPELLO_MUGGLETON(@NotNull @NotNull Ollivanders2 plugin)
      Constructs a REPELLO_MUGGLETON spell from deserialized data.

      Used only for loading saved spells from disk at server startup. This constructor should not be called directly when casting a new spell - use the full constructor instead.

      Parameters:
      plugin - a callback to the MC plugin
    • REPELLO_MUGGLETON

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

      Creates the spell at the specified location with the given radius and duration. Initializes entry denial messages that muggles will see when blocked from entering.

      Parameters:
      plugin - a callback to the MC plugin
      pid - the UUID of the player who cast the spell
      location - the center location of the spell
      radius - the initial radius of the protected area in blocks
      duration - the initial duration of the spell in ticks
  • Method Details

    • canSee

      protected boolean canSee(@NotNull @NotNull org.bukkit.entity.LivingEntity entity)
      Determines if an entity outside the spell can see players inside.

      Muggles (non-magical people) cannot see wizards and witches concealed within the spell area. Only magical beings have the ability to perceive those inside the protected zone.

      Specified by:
      canSee in class ConcealmentShieldSpell
      Parameters:
      entity - the entity outside the spell area checking visibility
      Returns:
      false if the entity is a muggle, true if they can see inside
    • canTarget

      public boolean canTarget(@NotNull @NotNull org.bukkit.entity.LivingEntity entity)
      Determines if an entity outside the spell can target players inside.

      REPELLO_MUGGLETON does not prevent entities from targeting wizards inside the protected area. Unlike some concealment spells, it focuses on hiding and preventing entry rather than blocking attacks.

      Specified by:
      canTarget in class ConcealmentShieldSpell
      Parameters:
      entity - the entity outside the spell area attempting to target
      Returns:
      true - all entities (including muggles) can target inside this spell
    • canEnter

      public boolean canEnter(@NotNull @NotNull org.bukkit.entity.LivingEntity entity)
      Determines if an entity can enter the spell's protected area.

      Only magical beings (wizards, witches, and non-player entities) can enter. Muggles are prevented from entering and receive an entry denial message explaining their compulsion to leave.

      Specified by:
      canEnter in class ConcealmentShieldSpell
      Parameters:
      entity - the entity attempting to enter the spell area
      Returns:
      false if the entity is a muggle, true if they can enter
    • canHear

      protected boolean canHear(@NotNull @NotNull org.bukkit.entity.LivingEntity entity)
      Determines if an entity outside the spell can hear conversations from inside.

      Muggles cannot hear sounds from protected wizards inside the spell area. Non-muggles can hear conversations normally.

      Specified by:
      canHear in class ConcealmentShieldSpell
      Parameters:
      entity - the entity outside the spell area checking hearing capability
      Returns:
      true if the entity is not a Muggle, false if muggles cannot hear
    • checkAlarm

      protected boolean checkAlarm(@NotNull @NotNull org.bukkit.entity.Player player)
      Checks if a player near the spell boundary should trigger a proximity alarm.

      REPELLO_MUGGLETON does not have proximity alarm functionality. This spell silently repels muggles without alerting the protected players.

      Specified by:
      checkAlarm in class ConcealmentShieldSpell
      Parameters:
      player - the player outside the spell near the proximity boundary
      Returns:
      always false - no alarms are triggered for this spell
    • checkAlarm

      protected boolean checkAlarm(@NotNull @NotNull org.bukkit.entity.LivingEntity entity)
      Checks if a non-player entity near the spell boundary should trigger a proximity alarm.

      REPELLO_MUGGLETON does not have proximity alarm functionality. Hostile entities approaching the boundary do not trigger alerts.

      Specified by:
      checkAlarm in class ConcealmentShieldSpell
      Parameters:
      entity - the entity outside the spell near the proximity boundary
      Returns:
      always false - no alarms are triggered for this spell
    • proximityAlarm

      protected void proximityAlarm()
      Executes the proximity alarm action for this spell.

      This method does nothing for REPELLO_MUGGLETON since the spell does not have proximity alarm functionality.

      Specified by:
      proximityAlarm in class ConcealmentShieldSpell