Class EntityVehicle

All Implemented Interfaces:
EntityInteractable, EntityRideable, Metadatable, Cloneable
Direct Known Subclasses:
EntityBoat, EntityMinecartAbstract

public abstract class EntityVehicle extends Entity implements EntityRideable, EntityInteractable
Author:
MagicDroidX (Nukkit Project)
  • Field Details

    • rollingDirection

      protected boolean rollingDirection
  • Constructor Details

  • Method Details

    • getRollingAmplitude

      public int getRollingAmplitude()
    • setRollingAmplitude

      public void setRollingAmplitude(int time)
    • getRollingDirection

      public int getRollingDirection()
    • setRollingDirection

      public void setRollingDirection(int direction)
    • getDamage

      public int getDamage()
    • setDamage

      public void setDamage(int damage)
    • getInteractButtonText

      public String getInteractButtonText(Player player)
      Specified by:
      getInteractButtonText in interface EntityInteractable
    • canDoInteraction

      public boolean canDoInteraction()
      Specified by:
      canDoInteraction in interface EntityInteractable
    • onUpdate

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

      protected boolean performHurtAnimation()
    • 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