Class VibrationData

java.lang.Object
xyz.xenondevs.particle.data.ParticleData
xyz.xenondevs.particle.data.VibrationData

public final class VibrationData extends ParticleData
This class holds all data that is needed by the client to display a ParticleEffect.VIBRATION particle. The required information is: The start Location (Only for pre 1.19 version), The destination and the amount of ticks it will take the particle to fly this path.

Minecraft only supports full block coordinates for the start and destination location. So any particle will spawn at the center of a block. (Again, only for pre 1.19 versions. The client uses the normal spawn location of the particle since 1.19)

Author:
ByteZ
See Also:
  • Constructor Details

    • VibrationData

      public VibrationData(org.bukkit.Location start, org.bukkit.Location destination, int ticks)
      Creates a new VibrationData instance.
      Parameters:
      start - the start Location of the particle. (Not needed since 1.19)
      destination - the destination Location of the particle.
      ticks - the amount of ticks it will take the particle to reach the blockDestination
    • VibrationData

      public VibrationData(org.bukkit.Location destination, int ticks)
      Creates a new VibrationData instance.
      Parameters:
      destination - the destination Location of the particle.
      ticks - the amount of ticks it will take the particle to reach the blockDestination
    • VibrationData

      public VibrationData(org.bukkit.Location start, org.bukkit.entity.Entity destination, int ticks)
      Creates a new VibrationData instance.
      Parameters:
      start - the start Location of the particle. (Not needed since 1.19)
      destination - the destination Entity of the particle.
      ticks - the amount of ticks it will take the particle to reach the blockDestination
    • VibrationData

      public VibrationData(org.bukkit.entity.Entity destination, int ticks)
      Creates a new VibrationData instance.
      Parameters:
      destination - the destination Entity of the particle.
      ticks - the amount of ticks it will take the particle to reach the blockDestination
  • Method Details

    • getStart

      public org.bukkit.Location getStart()
      Gets the start Location of the particle.
      Returns:
      the start Location of the particle.
    • getBlockDestination

      public org.bukkit.Location getBlockDestination()
      Gets the destination Location of the particle.
      Returns:
      the destination Location of the particle.
    • getEntityDestination

      public org.bukkit.entity.Entity getEntityDestination()
      Gets the destination Entity of the particle.
      Returns:
      the destination Entity of the particle.
    • getTicks

      public int getTicks()
      Gets the amount of ticks it will take the particle to travel.
      Returns:
      the travel time in ticks.
    • toNMSData

      public Object toNMSData()
      Creates a new VibrationParticleOption instance with the data of the current VibrationData instance.

      Please note that this class is not supported in any versions before 1.17 and could lead to errors if used in legacy versions.

      Specified by:
      toNMSData in class ParticleData
      Returns:
      a new VibrationParticleOption with the data of the current VibrationData instance.