Class EffectUtils

java.lang.Object
valorless.rarespawns.utils.EffectUtils

public class EffectUtils extends Object
Utility methods for applying common in-game effects and checks.

This class groups helper methods used by RareSpawns to interact with Bukkit/Spigot entities and locations: potion effects, particles, sounds, damage/teleport helpers, and a variety of convenience predicates (e.g. biome/time/entity category checks).

Error handling

All methods are defensive: exceptions are caught, logged through ValorlessUtils.Log, and the method returns a sensible fallback value (typically false, 0, or -1) rather than propagating the exception.

Threading

Many Bukkit API calls must be performed on the server/main thread. Callers are responsible for ensuring correct thread usage.

Since:
1.0.0.beta.939
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    angleBetween(org.bukkit.entity.Entity e1, org.bukkit.entity.Entity e2)
    Computes the angle (in radians) between the facing directions of two entities.
    static double
    angleBetween(org.bukkit.Location l1, org.bukkit.Location l2)
    Computes the angle (in radians) between the facing directions of two locations.
    static boolean
    applyPotionEffect(String effect, int level, int duration, org.bukkit.entity.LivingEntity target, boolean override)
    Applies a potion effect by name.
    static boolean
    applyPotionEffect(org.bukkit.potion.PotionEffectType effect, int level, int duration, org.bukkit.entity.LivingEntity target, boolean override)
    Applies a potion effect by type.
    static boolean
    bleed(org.bukkit.entity.LivingEntity target, double amount)
    Spawns a red dust particle effect at the middle of the entity (visual "bleed").
    static boolean
    burn(int ticks, org.bukkit.entity.Entity target)
    Sets the entity on fire.
    static boolean
    Dispatches a command from the server console.
    static boolean
    damage(org.bukkit.entity.LivingEntity target, double damage)
    Damages a living entity using Bukkit's Damageable.damage(double).
    static boolean
    damageCone(org.bukkit.entity.Entity source, double radius, double angle, double damage)
    Damages living entities within a cone around the source's look direction.
    static double
    damageDistance(org.bukkit.entity.Entity source, org.bukkit.Location location, double baseDamage, double multiplier)
    Calculates damage based on distance from a source entity to a target location.
    static boolean
    damageRadius(org.bukkit.Location center, double radius, double damage)
    Damages all living entities within a radius.
    static double
    decreaseBy(double value, double percentage)
    Decreases a value by a percentage.
    static boolean
    disableKnockback(org.bukkit.entity.LivingEntity entity, int ticks)
    Temporarily sets knockback resistance to 1.0 for the given duration.
    static double
    distance(org.bukkit.entity.Entity e1, org.bukkit.entity.Entity e2)
    Measures distance between two entities.
    static double
    distance(org.bukkit.Location l1, org.bukkit.Location l2)
    Measures distance between two locations.
    static boolean
    dropExperience(org.bukkit.Location location, int amount)
    Spawns an ExperienceOrb at the given location.
    static boolean
    explode(org.bukkit.Location location, float power, boolean setFire, boolean breakBlocks)
    Creates an explosion at the location.
    static boolean
    extinguish(org.bukkit.entity.Entity entity)
    Extinguishes an entity by setting its fire ticks to 0.
    static boolean
    freeze(org.bukkit.entity.LivingEntity entity, int ticks)
    Temporarily sets movement speed to 0 for the given duration.
    static boolean
    hasLineOfSight(org.bukkit.entity.LivingEntity source, org.bukkit.entity.Entity target)
    Checks if the source has a direct line of sight to the target.
    static boolean
    hasLineOfSight(org.bukkit.Location source, org.bukkit.Location target)
    Checks if a straight ray between two locations is unobstructed by blocks.
    static double
    healthPercentage(org.bukkit.entity.Entity entity)
    Returns current health divided by max health.
    static double
    increaseBy(double value, double percentage)
    Increases a value by a percentage.
    static boolean
    isAboveGround(org.bukkit.Location location)
    Checks whether the given location is at or above the world's sea level.
    static boolean
    isAquatic(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered an aquatic mob.
    static boolean
    isArthropod(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered an arthropod.
    static boolean
    isBoss(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered a boss.
    static boolean
    isDaytime(org.bukkit.Location location)
    Checks whether it's currently daytime at the given location.
    static boolean
    isFlying(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered a flying mob.
    static boolean
    isHostile(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered hostile.
    static boolean
    isInAir(org.bukkit.entity.Entity entity)
    Checks whether the given entity is airborne (not on ground and not in liquids).
    static boolean
    isInLava(org.bukkit.entity.Entity entity)
    Checks whether the entity's current block is lava.
    static boolean
    isInWater(org.bukkit.entity.Entity entity)
    Checks whether the entity is currently inside a liquid block.
    static boolean
    isLivingEntity(org.bukkit.entity.Entity entity)
    Checks whether the given entity is a LivingEntity.
    static boolean
    isMount(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered a mount (rideable) entity.
    static boolean
    isNeutral(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered neutral.
    static boolean
    isNighttime(org.bukkit.Location location)
    Checks whether it's currently nighttime at the given location.
    static boolean
    isOnGround(org.bukkit.entity.Entity entity)
    Checks whether Bukkit reports the given entity is on the ground.
    static boolean
    isPassive(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered passive.
    static boolean
    isPlayer(org.bukkit.entity.Entity entity)
    Checks whether the given entity is a player.
    static boolean
    isRaining(org.bukkit.Location location)
    Checks whether the world at the given location currently has a storm.
    static boolean
    isTameable(org.bukkit.entity.Entity entity)
    Checks whether the given entity can be tamed (implements Tameable).
    static boolean
    isTamed(org.bukkit.entity.Entity entity)
    Checks whether the given entity is a tamed Tameable.
    static boolean
    isThundering(org.bukkit.Location location)
    Checks whether the world at the given location is currently thundering.
    static boolean
    isUndead(org.bukkit.entity.Entity entity)
    Determines whether the given entity is considered undead.
    static boolean
    isUnderground(org.bukkit.Location location)
    Checks whether the given location is below sea level.
    static boolean
    kill(org.bukkit.entity.Entity target)
    Kills an entity.
    static boolean
    kill(org.bukkit.entity.Entity target, boolean noAnimation)
    Kills/removes an entity, optionally skipping the death animation.
    static boolean
    particle(String particle, org.bukkit.Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles by name.
    static boolean
    particle(org.bukkit.Particle particle, org.bukkit.Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles by type.
    static boolean
    particleCircle(String particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles along a circle around a center point by particle name.
    static boolean
    particleCircle(org.bukkit.Particle particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles along a circle around a center point by particle type.
    static boolean
    particleLine(String particle, org.bukkit.Location start, org.bukkit.Location end, int points, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles along a line between two points (name overload).
    static boolean
    particleLine(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location end, int points, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles along a line between two points.
    static boolean
    particleSphere(String particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles randomly distributed on a sphere surface (name overload).
    static boolean
    particleSphere(org.bukkit.Particle particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
    Spawns particles randomly distributed on a sphere surface.
    static boolean
    playerCommand(String command, org.bukkit.entity.Player player)
    Has the player perform a command.
    static boolean
    playSound(org.bukkit.entity.Player player, String sound, float volume, float pitch)
    Plays a sound to a player.
    static boolean
    playSound(org.bukkit.Location location, String sound, float volume, float pitch)
    Plays a sound at a location.
    static boolean
    projectile(org.bukkit.entity.Entity shooter, String projectile, double speed, boolean direct)
    Spawns a projectile entity by type name.
    static boolean
    projectile(org.bukkit.entity.Entity shooter, org.bukkit.entity.EntityType projectile, double speed, boolean direct)
    Spawns a projectile entity by EntityType.
    static boolean
    pullCloser(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double strength, boolean relative)
    Pulls the target towards the source by setting/adding velocity.
    static boolean
    pushAway(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double strength, boolean relative)
    Pushes the target away from the source by setting/adding velocity.
    static boolean
    removePotionEffect(String effect, org.bukkit.entity.LivingEntity target)
    Removes a potion effect by name.
    static boolean
    removePotionEffect(org.bukkit.potion.PotionEffectType effect, org.bukkit.entity.LivingEntity target)
    Removes a potion effect by type.
    static boolean
    sendActionBar(org.bukkit.entity.Player player, String message)
    Sends an action bar message to the player.
    static boolean
    sendMessage(org.bukkit.entity.Player player, String message)
    Sends a chat message to the player.
    static boolean
    sendTitle(org.bukkit.entity.Player player, String title, String subtitle, int fadeIn, int stay, int fadeOut)
    Sends a title/subtitle to the player.
    static boolean
    shuffleHotbar(org.bukkit.entity.Player player)
    Randomly shuffles the player's hotbar (first 9 inventory slots).
    static boolean
    strikeLightning(org.bukkit.Location location, boolean effectOnly)
    Strikes lightning at the location.
    static boolean
    teleport(org.bukkit.entity.Entity entity, org.bukkit.Location location)
    Teleports an entity.
    static boolean
    teleportAbove(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double distance)
    Teleports the target entity above their current location.
    static boolean
    teleportBehind(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double distance)
    Teleports the target behind the source's facing direction.
    static boolean
    teleportInFront(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double distance)
    Teleports the target in front of the source's facing direction.
    static boolean
    teleportRelative(org.bukkit.entity.Entity entity, double x, double y, double z)
    Teleports an entity by an offset.
    static boolean
    teleportRelative(org.bukkit.entity.Entity entity, valorless.valorlessutils.types.Vector3<Double> offset)
    Teleports an entity by an offset.
    static boolean
    togglePermission(org.bukkit.entity.Player player, String permission)
    Toggles a permission for a player using a temporary attachment.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EffectUtils

      public EffectUtils()
  • Method Details

    • angleBetween

      public static double angleBetween(org.bukkit.entity.Entity e1, org.bukkit.entity.Entity e2)
      Computes the angle (in radians) between the facing directions of two entities.
      Parameters:
      e1 - first entity
      e2 - second entity
      Returns:
      angle in radians, or -1 on error
    • angleBetween

      public static double angleBetween(org.bukkit.Location l1, org.bukkit.Location l2)
      Computes the angle (in radians) between the facing directions of two locations.

      Note: a Location only has a direction if it has yaw/pitch set.

      Parameters:
      l1 - first location
      l2 - second location
      Returns:
      angle in radians, or -1 on error
    • applyPotionEffect

      public static boolean applyPotionEffect(String effect, int level, int duration, org.bukkit.entity.LivingEntity target, boolean override)
      Applies a potion effect by name.

      The level is 1-based (Minecraft amplifier is 0-based), so this method uses level - 1 as the amplifier.

      Parameters:
      effect - effect name (case-insensitive). Example: "SPEED"
      level - 1-based level
      duration - duration in ticks
      target - target entity
      override - if true, an existing effect of the same type is removed first
      Returns:
      true if applied; false if invalid effect or on error
    • applyPotionEffect

      public static boolean applyPotionEffect(org.bukkit.potion.PotionEffectType effect, int level, int duration, org.bukkit.entity.LivingEntity target, boolean override)
      Applies a potion effect by type.

      The level is 1-based (Minecraft amplifier is 0-based), so this method uses level - 1 as the amplifier.

      Parameters:
      effect - effect type
      level - 1-based level
      duration - duration in ticks
      target - target entity
      override - if true, an existing effect of the same type is removed first
      Returns:
      true if applied; false on error
    • bleed

      public static boolean bleed(org.bukkit.entity.LivingEntity target, double amount)
      Spawns a red dust particle effect at the middle of the entity (visual "bleed").
      Parameters:
      target - target entity
      amount - currently unused (reserved for future scaling)
      Returns:
      true if spawned; false on error
    • burn

      public static boolean burn(int ticks, org.bukkit.entity.Entity target)
      Sets the entity on fire.
      Parameters:
      ticks - fire duration in ticks
      target - target entity
      Returns:
      true if applied; false on error
    • consoleCommand

      public static boolean consoleCommand(String command)
      Dispatches a command from the server console.
      Parameters:
      command - raw command string
      Returns:
      true if dispatched; false on error
    • damage

      public static boolean damage(org.bukkit.entity.LivingEntity target, double damage)
      Damages a living entity using Bukkit's Damageable.damage(double).
      Parameters:
      target - target entity
      damage - amount of damage
      Returns:
      true if applied; false on error
    • damageCone

      public static boolean damageCone(org.bukkit.entity.Entity source, double radius, double angle, double damage)
      Damages living entities within a cone around the source's look direction.
      Parameters:
      source - source entity (cone origin + direction)
      radius - search radius
      angle - cone angle in degrees
      damage - damage to apply
      Returns:
      true if processed; false on error
    • damageDistance

      public static double damageDistance(org.bukkit.entity.Entity source, org.bukkit.Location location, double baseDamage, double multiplier)
      Calculates damage based on distance from a source entity to a target location.
      Parameters:
      source - source entity
      location - target location
      baseDamage - base damage at zero distance
      multiplier - damage increase per block of distance
      Returns:
      calculated damage, or baseDamage on error
    • damageRadius

      public static boolean damageRadius(org.bukkit.Location center, double radius, double damage)
      Damages all living entities within a radius.
      Parameters:
      center - center point
      radius - radius in blocks
      damage - damage per entity
      Returns:
      true if processed; false on error
    • decreaseBy

      public static double decreaseBy(double value, double percentage)
      Decreases a value by a percentage.
      Parameters:
      value - base value
      percentage - percentage to subtract (e.g. 25 => value * 0.75)
      Returns:
      decreased value (or original value on error)
    • disableKnockback

      public static boolean disableKnockback(org.bukkit.entity.LivingEntity entity, int ticks)
      Temporarily sets knockback resistance to 1.0 for the given duration.
      Parameters:
      entity - target entity
      ticks - duration in ticks
      Returns:
      true if scheduled; false on error
    • distance

      public static double distance(org.bukkit.entity.Entity e1, org.bukkit.entity.Entity e2)
      Measures distance between two entities.
      Parameters:
      e1 - first entity
      e2 - second entity
      Returns:
      distance, or -1 on error
    • distance

      public static double distance(org.bukkit.Location l1, org.bukkit.Location l2)
      Measures distance between two locations.
      Parameters:
      l1 - first location
      l2 - second location
      Returns:
      distance, or -1 on error
    • dropExperience

      public static boolean dropExperience(org.bukkit.Location location, int amount)
      Spawns an ExperienceOrb at the given location.
      Parameters:
      location - spawn location
      amount - experience amount
      Returns:
      true if spawned; false on error
    • explode

      public static boolean explode(org.bukkit.Location location, float power, boolean setFire, boolean breakBlocks)
      Creates an explosion at the location.
      Parameters:
      location - explosion location
      power - explosion power
      setFire - whether to set fire
      breakBlocks - whether blocks can be broken
      Returns:
      true if created; false on error
    • extinguish

      public static boolean extinguish(org.bukkit.entity.Entity entity)
      Extinguishes an entity by setting its fire ticks to 0.
      Parameters:
      entity - target entity
      Returns:
      true if applied; false on error
    • freeze

      public static boolean freeze(org.bukkit.entity.LivingEntity entity, int ticks)
      Temporarily sets movement speed to 0 for the given duration.
      Parameters:
      entity - target entity
      ticks - duration in ticks
      Returns:
      true if scheduled; false on error
    • hasLineOfSight

      public static boolean hasLineOfSight(org.bukkit.entity.LivingEntity source, org.bukkit.entity.Entity target)
      Checks if the source has a direct line of sight to the target.
      Parameters:
      source - source living entity
      target - target entity
      Returns:
      true if visible, otherwise false
    • hasLineOfSight

      public static boolean hasLineOfSight(org.bukkit.Location source, org.bukkit.Location target)
      Checks if a straight ray between two locations is unobstructed by blocks.
      Parameters:
      source - source location
      target - target location
      Returns:
      true if unobstructed, otherwise false
    • healthPercentage

      public static double healthPercentage(org.bukkit.entity.Entity entity)
      Returns current health divided by max health.
      Parameters:
      entity - entity to check
      Returns:
      health percentage in range [0..1], or 0 on error / non-living
    • increaseBy

      public static double increaseBy(double value, double percentage)
      Increases a value by a percentage.
      Parameters:
      value - base value
      percentage - percentage to add (e.g. 25 => value * 1.25)
      Returns:
      increased value (or original value on error)
    • isAboveGround

      public static boolean isAboveGround(org.bukkit.Location location)
      Checks whether the given location is at or above the world's sea level.
      Parameters:
      location - location to check
      Returns:
      true if Y is at or above sea level
    • isAquatic

      public static boolean isAquatic(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered an aquatic mob.
      Parameters:
      entity - entity to check
      Returns:
      true if the entity is considered aquatic
    • isArthropod

      public static boolean isArthropod(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered an arthropod.
      Parameters:
      entity - entity to check
      Returns:
      true if the entity is considered an arthropod
    • isBoss

      public static boolean isBoss(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered a boss.
      Parameters:
      entity - entity to check
      Returns:
      true if the entity is considered a boss
    • isDaytime

      public static boolean isDaytime(org.bukkit.Location location)
      Checks whether it's currently daytime at the given location.
      Parameters:
      location - location to check
      Returns:
      true if world time is day (0..12299)
    • isFlying

      public static boolean isFlying(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered a flying mob.
      Parameters:
      entity - entity to check
      Returns:
      true if the entity is considered flying
    • isHostile

      public static boolean isHostile(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered hostile.
      Parameters:
      entity - entity to check
      Returns:
      true if the entity is considered hostile
    • isInAir

      public static boolean isInAir(org.bukkit.entity.Entity entity)
      Checks whether the given entity is airborne (not on ground and not in liquids).
      Parameters:
      entity - entity to check
      Returns:
      true if not on ground and not in water/lava
    • isInLava

      public static boolean isInLava(org.bukkit.entity.Entity entity)
      Checks whether the entity's current block is lava.
      Parameters:
      entity - entity to check
      Returns:
      true if the entity's current block type contains "LAVA"
    • isInWater

      public static boolean isInWater(org.bukkit.entity.Entity entity)
      Checks whether the entity is currently inside a liquid block.
      Parameters:
      entity - entity to check
      Returns:
      true if the entity's current block is liquid
    • isLivingEntity

      public static boolean isLivingEntity(org.bukkit.entity.Entity entity)
      Checks whether the given entity is a LivingEntity.
      Parameters:
      entity - entity
      Returns:
      true if entity is a LivingEntity
    • isMount

      public static boolean isMount(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered a mount (rideable) entity.
      Parameters:
      entity - entity
      Returns:
      true if entity is considered a mount
    • isNeutral

      public static boolean isNeutral(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered neutral.
      Parameters:
      entity - entity
      Returns:
      true if entity is considered neutral
    • isNighttime

      public static boolean isNighttime(org.bukkit.Location location)
      Checks whether it's currently nighttime at the given location.
      Parameters:
      location - location
      Returns:
      true if world time is night (12300..23849)
    • isOnGround

      public static boolean isOnGround(org.bukkit.entity.Entity entity)
      Checks whether Bukkit reports the given entity is on the ground.
      Parameters:
      entity - entity
      Returns:
      true if Bukkit reports the entity is on the ground
    • isPassive

      public static boolean isPassive(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered passive.
      Parameters:
      entity - entity
      Returns:
      true if entity is considered passive
    • isPlayer

      public static boolean isPlayer(org.bukkit.entity.Entity entity)
      Checks whether the given entity is a player.
      Parameters:
      entity - entity
      Returns:
      true if entity is a Player
    • isRaining

      public static boolean isRaining(org.bukkit.Location location)
      Checks whether the world at the given location currently has a storm.
      Parameters:
      location - location
      Returns:
      true if the world currently has a storm
    • isTameable

      public static boolean isTameable(org.bukkit.entity.Entity entity)
      Checks whether the given entity can be tamed (implements Tameable).
      Parameters:
      entity - entity
      Returns:
      true if entity implements Tameable
    • isTamed

      public static boolean isTamed(org.bukkit.entity.Entity entity)
      Checks whether the given entity is a tamed Tameable.
      Parameters:
      entity - entity
      Returns:
      true if entity is a tamed Tameable
    • isThundering

      public static boolean isThundering(org.bukkit.Location location)
      Checks whether the world at the given location is currently thundering.
      Parameters:
      location - location
      Returns:
      true if the world is thundering
    • isUndead

      public static boolean isUndead(org.bukkit.entity.Entity entity)
      Determines whether the given entity is considered undead.
      Parameters:
      entity - entity
      Returns:
      true if entity is considered undead
    • isUnderground

      public static boolean isUnderground(org.bukkit.Location location)
      Checks whether the given location is below sea level.
      Parameters:
      location - location
      Returns:
      true if below sea level
    • kill

      public static boolean kill(org.bukkit.entity.Entity target)
      Kills an entity.

      For living entities this sets health to 0, otherwise it removes the entity.

      Parameters:
      target - target entity
      Returns:
      true if killed/removed; false on error
    • kill

      public static boolean kill(org.bukkit.entity.Entity target, boolean noAnimation)
      Kills/removes an entity, optionally skipping the death animation.
      Parameters:
      target - target entity
      noAnimation - if true the entity is removed directly
      Returns:
      true if killed/removed; false on error
    • particle

      public static boolean particle(String particle, org.bukkit.Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles by name.
      Parameters:
      particle - particle name (case-insensitive)
      location - spawn location
      count - number of particles
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on invalid particle or error
    • particle

      public static boolean particle(org.bukkit.Particle particle, org.bukkit.Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles by type.
      Parameters:
      particle - particle type
      location - spawn location
      count - number of particles
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on error
    • particleCircle

      public static boolean particleCircle(String particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles along a circle around a center point by particle name.
      Parameters:
      particle - particle name
      center - center location
      radius - circle radius
      points - number of points/steps
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on error
    • particleCircle

      public static boolean particleCircle(org.bukkit.Particle particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles along a circle around a center point by particle type.
      Parameters:
      particle - particle type
      center - center location
      radius - circle radius
      points - number of points/steps
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on error
    • particleLine

      public static boolean particleLine(String particle, org.bukkit.Location start, org.bukkit.Location end, int points, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles along a line between two points (name overload).
      Parameters:
      particle - particle name
      start - start location
      end - end location
      points - number of points to sample
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on error
    • particleLine

      public static boolean particleLine(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location end, int points, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles along a line between two points.
      Parameters:
      particle - particle type
      start - start location
      end - end location
      points - number of points to sample
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on error
    • particleSphere

      public static boolean particleSphere(String particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles randomly distributed on a sphere surface (name overload).
      Parameters:
      particle - particle name
      center - center location
      radius - sphere radius
      points - number of particles/points
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on error
    • particleSphere

      public static boolean particleSphere(org.bukkit.Particle particle, org.bukkit.Location center, double radius, int points, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns particles randomly distributed on a sphere surface.
      Parameters:
      particle - particle type
      center - center location
      radius - sphere radius
      points - number of particles/points
      offsetX - offset X
      offsetY - offset Y
      offsetZ - offset Z
      extra - extra data (speed)
      Returns:
      true if spawned; false on error
    • playSound

      public static boolean playSound(org.bukkit.Location location, String sound, float volume, float pitch)
      Plays a sound at a location.
      Parameters:
      location - target location
      sound - sound id/string understood by Sound.parse(String)
      volume - volume
      pitch - pitch
      Returns:
      true if played; false on error
    • playSound

      public static boolean playSound(org.bukkit.entity.Player player, String sound, float volume, float pitch)
      Plays a sound to a player.
      Parameters:
      player - target player
      sound - sound id/string understood by Sound.parse(String)
      volume - volume
      pitch - pitch
      Returns:
      true if played; false on error
    • playerCommand

      public static boolean playerCommand(String command, org.bukkit.entity.Player player)
      Has the player perform a command.
      Parameters:
      command - command to execute
      player - command sender
      Returns:
      true if performed; false on error
    • projectile

      public static boolean projectile(org.bukkit.entity.Entity shooter, String projectile, double speed, boolean direct)
      Spawns a projectile entity by type name.
      Parameters:
      shooter - shooter entity
      projectile - entity type name, e.g. "ARROW"
      speed - velocity multiplier
      direct - if true sets velocity directly, otherwise adds to existing velocity
      Returns:
      true if spawned; false on error
    • projectile

      public static boolean projectile(org.bukkit.entity.Entity shooter, org.bukkit.entity.EntityType projectile, double speed, boolean direct)
      Spawns a projectile entity by EntityType.
      Parameters:
      shooter - shooter entity
      projectile - projectile entity type
      speed - velocity multiplier
      direct - if true sets velocity directly, otherwise adds to existing velocity
      Returns:
      true if spawned; false on error
    • pullCloser

      public static boolean pullCloser(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double strength, boolean relative)
      Pulls the target towards the source by setting/adding velocity.
      Parameters:
      source - source entity
      target - target entity
      strength - velocity multiplier
      relative - if true adds to current velocity, otherwise overrides it
      Returns:
      true if applied; false on error
    • pushAway

      public static boolean pushAway(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double strength, boolean relative)
      Pushes the target away from the source by setting/adding velocity.
      Parameters:
      source - source entity
      target - target entity
      strength - velocity multiplier
      relative - if true adds to current velocity, otherwise overrides it
      Returns:
      true if applied; false on error
    • removePotionEffect

      public static boolean removePotionEffect(org.bukkit.potion.PotionEffectType effect, org.bukkit.entity.LivingEntity target)
      Removes a potion effect by type.
      Parameters:
      effect - effect type
      target - target entity
      Returns:
      true if removed; false on error
    • removePotionEffect

      public static boolean removePotionEffect(String effect, org.bukkit.entity.LivingEntity target)
      Removes a potion effect by name.
      Parameters:
      effect - effect name (case-insensitive)
      target - target entity
      Returns:
      true if removed; false if invalid effect or on error
    • sendActionBar

      public static boolean sendActionBar(org.bukkit.entity.Player player, String message)
      Sends an action bar message to the player.
      Parameters:
      player - target player
      message - message (supports language parsing)
      Returns:
      true if sent; false on error
    • sendMessage

      public static boolean sendMessage(org.bukkit.entity.Player player, String message)
      Sends a chat message to the player.
      Parameters:
      player - target player
      message - message (supports language parsing)
      Returns:
      true if sent; false on error
    • sendTitle

      public static boolean sendTitle(org.bukkit.entity.Player player, @Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut)
      Sends a title/subtitle to the player.
      Parameters:
      player - target player
      title - title text (nullable)
      subtitle - subtitle text (nullable)
      fadeIn - fade in ticks
      stay - stay ticks
      fadeOut - fade out ticks
      Returns:
      true if sent; false on error
    • shuffleHotbar

      public static boolean shuffleHotbar(org.bukkit.entity.Player player)
      Randomly shuffles the player's hotbar (first 9 inventory slots).
      Parameters:
      player - target player
      Returns:
      true if shuffled; false on error
    • strikeLightning

      public static boolean strikeLightning(org.bukkit.Location location, boolean effectOnly)
      Strikes lightning at the location.
      Parameters:
      location - target location
      effectOnly - if true, only plays the effect (no damage)
      Returns:
      true if executed; false on error
    • teleport

      public static boolean teleport(org.bukkit.entity.Entity entity, org.bukkit.Location location)
      Teleports an entity.
      Parameters:
      entity - entity to teleport
      location - destination
      Returns:
      true if teleported; false on error
    • teleportAbove

      public static boolean teleportAbove(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double distance)
      Teleports the target entity above their current location.
      Parameters:
      source - unused (kept for API symmetry)
      target - target entity
      distance - amount to add to Y
      Returns:
      true if teleported; false on error
    • teleportBehind

      public static boolean teleportBehind(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double distance)
      Teleports the target behind the source's facing direction.
      Parameters:
      source - source entity (direction is used)
      target - target entity
      distance - distance behind
      Returns:
      true if teleported; false on error
    • teleportInFront

      public static boolean teleportInFront(org.bukkit.entity.Entity source, org.bukkit.entity.Entity target, double distance)
      Teleports the target in front of the source's facing direction.
      Parameters:
      source - source entity (direction is used)
      target - target entity
      distance - distance in front
      Returns:
      true if teleported; false on error
    • teleportRelative

      public static boolean teleportRelative(org.bukkit.entity.Entity entity, double x, double y, double z)
      Teleports an entity by an offset.
      Parameters:
      entity - entity
      x - x offset
      y - y offset
      z - z offset
      Returns:
      true if teleported; false on error
    • teleportRelative

      public static boolean teleportRelative(org.bukkit.entity.Entity entity, valorless.valorlessutils.types.Vector3<Double> offset)
      Teleports an entity by an offset.
      Parameters:
      entity - entity
      offset - offset vector
      Returns:
      true if teleported; false on error
    • togglePermission

      public static boolean togglePermission(org.bukkit.entity.Player player, String permission)
      Toggles a permission for a player using a temporary attachment.
      Parameters:
      player - target player
      permission - permission node
      Returns:
      true if toggled; false on error