Class EntityProjectile

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

public class EntityProjectile extends Entity
Class that allows to instantiate entities with projectile-like physics handling.
  • Constructor Details

    • EntityProjectile

      public EntityProjectile(@Nullable @Nullable Entity shooter, @NotNull @NotNull EntityType entityType)
  • Method Details

    • getShooter

      @Nullable public @Nullable Entity getShooter()
    • shoot

      public void shoot(Point to, double power, double spread)
    • 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. This may only be used as a delta and has no meaning in the real world.
    • acquirable

      @Experimental @NotNull public @NotNull Acquirable<? extends EntityProjectile> acquirable()
      Description copied from interface: AcquirableSource
      Obtains an Acquirable. To safely perform operations on this object, the user must call Acquirable.sync(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