Class EntityProjectile

All Implemented Interfaces:
Metadatable, Cloneable
Direct Known Subclasses:
EntityEgg, EntityEnderPearl, EntityExpBottle, EntityPotion, EntitySmallFireBall, EntitySnowball, SlenderProjectile

public abstract class EntityProjectile extends Entity
Author:
MagicDroidX (Nukkit Project)
  • Field Details

  • Constructor Details

  • Method Details

    • getDamage

      protected double getDamage()
    • getBaseDamage

      protected double getBaseDamage()
    • getResultDamage

      @PowerNukkitOnly("Allows to modify the damage based on the entity being damaged") @Since("1.4.0.0-PN") public int getResultDamage(@Nullable Entity entity)
    • getResultDamage

      public int getResultDamage()
    • attack

      public boolean attack(EntityDamageEvent source)
      Description copied from class: Entity
      当一个实体被攻击时(即接受一个实体伤害事件 这个事件可以是由其他实体攻击导致,也可能是自然伤害)调用.

      Called when an entity is attacked (i.e. receives an entity damage event. This event can be caused by an attack by another entity, or it can be a natural damage).

      Overrides:
      attack in class Entity
      Parameters:
      source - 记录伤害源的事件
      Record the event of the source of the attack
      Returns:
      是否攻击成功
      Whether the attack was successful
    • onCollideWithEntity

      public void onCollideWithEntity(Entity entity)
    • afterCollisionWithEntity

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected void afterCollisionWithEntity(Entity entity)
    • initEntity

      protected void initEntity()
      Description copied from class: Entity
      实体初始化顺序,先初始化Entity类字段->Entity构造函数->进入init方法->调用initEntity方法->子类字段初始化->子类构造函数

      用于初始化实体的NBT和实体字段的方法

      Entity initialization order, first initialize the Entity class field->Entity constructor->Enter the init method->Call the init Entity method-> subclass field initialization-> subclass constructor

      The method used to initialize the NBT and entity fields of the entity

      Overrides:
      initEntity in class Entity
    • canCollideWith

      public boolean canCollideWith(Entity entity)
      Overrides:
      canCollideWith in class Entity
    • saveNBT

      public void saveNBT()
      Overrides:
      saveNBT in class Entity
    • updateMotion

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected void updateMotion()
    • onUpdate

      public boolean onUpdate(int currentTick)
      Overrides:
      onUpdate in class Entity
    • updateRotation

      @PowerNukkitOnly public void updateRotation()
    • inaccurate

      @PowerNukkitOnly public void inaccurate(float modifier)
    • onCollideWithBlock

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected void onCollideWithBlock(Position position, Vector3 motion)
    • onCollideWithBlock

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected boolean onCollideWithBlock(Position position, Vector3 motion, Block collisionBlock)
    • addHitEffect

      @PowerNukkitOnly protected void addHitEffect()
    • hasAge

      @PowerNukkitOnly @Since("1.4.0.0-PN") @Deprecated @DeprecationDetails(by="PowerNukkit", since="FUTURE", reason="Bad method name", replaceWith="getHasAge", toBeRemovedAt="1.7.0.0-PN") public boolean hasAge()
      Deprecated.
    • setAge

      @PowerNukkitOnly @Since("1.4.0.0-PN") @Deprecated @DeprecationDetails(by="PowerNukkit", since="FUTURE", reason="Bad method name", replaceWith="setHasAge", toBeRemovedAt="1.7.0.0-PN") public void setAge(boolean hasAge)
      Deprecated.
    • getHasAge

      public boolean getHasAge()
    • setHasAge

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setHasAge(boolean hasAge)
    • spawnToAll

      public void spawnToAll()
      Overrides:
      spawnToAll in class Entity