Class EntityAbstractMinecart

All Implemented Interfaces:
org.cloudburstmc.api.entity.Entity, org.cloudburstmc.api.entity.Interactable, org.cloudburstmc.api.entity.Rideable, org.cloudburstmc.api.entity.vehicle.Vehicle
Direct Known Subclasses:
EntityChestMinecart, EntityHopperMinecart, EntityMinecart, EntityTntMinecart

public abstract class EntityAbstractMinecart extends EntityVehicle
Created by: larryTheCoder on 2017/6/26.

Nukkit Project, Minecart and Riding Project, Package cn.nukkit.entity.item in project Nukkit.

  • Constructor Details

    • EntityAbstractMinecart

      public EntityAbstractMinecart(org.cloudburstmc.api.entity.EntityType<?> type, org.cloudburstmc.api.level.Location location)
  • Method Details

    • isRideable

      public abstract boolean isRideable()
    • getMinecartType

      public abstract org.cloudburstmc.api.util.data.MinecartType getMinecartType()
    • getHeight

      public float getHeight()
      Specified by:
      getHeight in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      getHeight in class BaseEntity
    • getWidth

      public float getWidth()
      Specified by:
      getWidth in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      getWidth in class BaseEntity
    • getDrag

      public float getDrag()
      Specified by:
      getDrag in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      getDrag in class BaseEntity
    • setName

      public void setName(String name)
    • getName

      public String getName()
      Specified by:
      getName in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      getName in class BaseEntity
    • getBaseOffset

      public float getBaseOffset()
      Overrides:
      getBaseOffset in class BaseEntity
    • hasNameTag

      public boolean hasNameTag()
      Specified by:
      hasNameTag in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      hasNameTag in class BaseEntity
    • canDoInteraction

      public boolean canDoInteraction()
      Specified by:
      canDoInteraction in interface org.cloudburstmc.api.entity.Interactable
      Overrides:
      canDoInteraction in class EntityVehicle
    • initEntity

      public void initEntity()
      Overrides:
      initEntity in class BaseEntity
    • loadAdditionalData

      public void loadAdditionalData(com.nukkitx.nbt.NbtMap tag)
      Overrides:
      loadAdditionalData in class BaseEntity
    • saveAdditionalData

      public void saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag)
      Overrides:
      saveAdditionalData in class BaseEntity
    • onUpdate

      public boolean onUpdate(int currentTick)
      Specified by:
      onUpdate in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      onUpdate in class EntityVehicle
    • attack

      public boolean attack(org.cloudburstmc.api.event.entity.EntityDamageEvent source)
      Specified by:
      attack in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      attack in class EntityVehicle
    • dropItem

      public void dropItem()
    • kill

      public void kill()
      Specified by:
      kill in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      kill in class BaseEntity
    • close

      public void close()
      Specified by:
      close in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      close in class BaseEntity
    • onInteract

      public boolean onInteract(org.cloudburstmc.api.player.Player p, org.cloudburstmc.api.item.ItemStack item, com.nukkitx.math.vector.Vector3f clickedPos)
      Specified by:
      onInteract in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      onInteract in class BaseEntity
    • onEntityCollision

      public void onEntityCollision(org.cloudburstmc.api.entity.Entity entity)
      Specified by:
      onEntityCollision in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      onEntityCollision in class BaseEntity
    • getMaxSpeed

      public double getMaxSpeed()
    • activate

      protected void activate(int x, int y, int z, boolean flag)
    • setCurrentSpeed

      public void setCurrentSpeed(float speed)
      Used to multiply the minecart current speed
      Parameters:
      speed - The speed of the minecart that will be calculated
    • getDisplayOffset

      public int getDisplayOffset()
      Get the block display offset
      Returns:
      integer
    • setDisplayBlockOffset

      public void setDisplayBlockOffset(int offset)
      Set the block offset.
      Parameters:
      offset - The offset
    • getDisplayBlock

      public org.cloudburstmc.api.block.BlockState getDisplayBlock()
    • setDisplayBlock

      public void setDisplayBlock(org.cloudburstmc.api.block.BlockState blockState)
    • hasDisplay

      public boolean hasDisplay()
    • setDisplay

      public void setDisplay(boolean display)
    • isSlowWhenEmpty

      public boolean isSlowWhenEmpty()
      Is the minecart can be slowed when empty?
      Returns:
      boolean
    • setSlowWhenEmpty

      public void setSlowWhenEmpty(boolean slow)
      Set the minecart slowdown flag
      Parameters:
      slow - The slowdown flag
    • getFlyingVelocityMod

      public com.nukkitx.math.vector.Vector3f getFlyingVelocityMod()
    • setFlyingVelocityMod

      public void setFlyingVelocityMod(com.nukkitx.math.vector.Vector3f flying)
    • getDerailedVelocityMod

      public com.nukkitx.math.vector.Vector3f getDerailedVelocityMod()
    • setDerailedVelocityMod

      public void setDerailedVelocityMod(com.nukkitx.math.vector.Vector3f derailed)
    • setMaximumSpeed

      public void setMaximumSpeed(float speed)