Class PlayerProjectile

java.lang.Object
net.minestom.server.entity.Entity
net.minestom.server.entity.PlayerProjectile
All Implemented Interfaces:
Sound.Emitter, HoverEventSource<HoverEvent.ShowEntity>, Shape, EventHandler<EntityEvent>, PermissionHandler, Snapshotable, Taggable, TagReadable, TagWritable, AcquirableSource<Entity>, Tickable, Schedulable, Viewable

public class PlayerProjectile extends Entity
  • Constructor Details

  • Method Details

    • shoot

      public void shoot(Point from, double power, double spread)
    • setInstance

      public CompletableFuture<Void> setInstance(@NotNull @NotNull Instance instance, @NotNull @NotNull Pos spawnPosition)
      Description copied from class: Entity
      Changes the entity instance, i.e. spawns it.
      Overrides:
      setInstance in class Entity
      Parameters:
      instance - the new instance of the entity
      spawnPosition - the spawn position for the entity.
      Returns:
      a CompletableFuture called once the entity's instance has been set, this is due to chunks needing to load
    • shoot

      public void shoot(@NotNull @NotNull Point from, @NotNull @NotNull Point to, double power, double spread)
    • refreshPosition

      public void refreshPosition(@NotNull @NotNull Pos newPosition)
      Overrides:
      refreshPosition in class Entity
    • tick

      public void tick(long time)
      Description copied from class: Entity
      Updates the entity, called every tick.

      Ignored if Entity.getInstance() returns null.

      Specified by:
      tick in interface Tickable
      Overrides:
      tick in class Entity
      Parameters:
      time - the update time in milliseconds
    • acquirable

      @Experimental @NotNull public @NotNull Acquirable<? extends PlayerProjectile> acquirable()
      Description copied from interface: AcquirableSource
      Obtains an Acquirable. To safely perform operations on this object, the user must call Acquirable.sync(Consumer), Acquirable.async(Consumer), or Acquirable.lock() (followed by a subsequent unlock) on the Acquirable instance.
      Specified by:
      acquirable in interface AcquirableSource<Entity>
      Overrides:
      acquirable in class Entity
      Returns:
      an Acquirable which can be used to synchronize access to this object