Package org.bukkit.entity
Interface Minecart
- All Superinterfaces:
CommandSender,Entity,Metadatable,Permissible,ServerOperator,Vehicle
- All Known Subinterfaces:
CommandMinecart,ExplosiveMinecart,HopperMinecart,PoweredMinecart,PoweredMinecart,RideableMinecart,SpawnerMinecart,StorageMinecart,StorageMinecart
public interface Minecart extends Vehicle
Represents a minecart entity.
-
Nested Class Summary
-
Method Summary
Modifier and Type Method Description int_INVALID_getDamage()Deprecated.void_INVALID_setDamage(int damage)Deprecated.doublegetDamage()Gets a minecart's damage.VectorgetDerailedVelocityMod()Gets the derailed velocity modifier.MaterialDatagetDisplayBlock()Gets the display block for this minecart.intgetDisplayBlockOffset()Gets the offset of the display block.VectorgetFlyingVelocityMod()Gets the flying velocity modifier.doublegetMaxSpeed()Gets the maximum speed of a minecart.booleanisSlowWhenEmpty()Returns whether this minecart will slow down faster without a passenger occupying itvoidsetDamage(double damage)Sets a minecart's damage.voidsetDerailedVelocityMod(Vector derailed)Sets the derailed velocity modifier.voidsetDisplayBlock(MaterialData material)Sets the display block for this minecart.voidsetDisplayBlockOffset(int offset)Sets the offset of the display block.voidsetFlyingVelocityMod(Vector flying)Sets the flying velocity modifier.voidsetMaxSpeed(double speed)Sets the maximum speed of a minecart.voidsetSlowWhenEmpty(boolean slow)Sets whether this minecart will slow down faster without a passenger occupying itMethods inherited from interface org.bukkit.entity.Entity
eject, getCustomName, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getServer, getTicksLived, getType, getUniqueId, getVehicle, getWorld, isCustomNameVisible, isDead, isEmpty, isInsideVehicle, isOnGround, isValid, leaveVehicle, playEffect, remove, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setLastDamageCause, setPassenger, setTicksLived, spigot, teleport, teleport, teleport, teleportMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
-
Method Details
-
_INVALID_setDamage
@Deprecated void _INVALID_setDamage(int damage)Deprecated.This method exists for legacy reasons to provide backwards compatibility. It will not exist at runtime and should not be used under any circumstances.- Parameters:
damage- over 40 to "kill" a minecart
-
setDamage
void setDamage(double damage)Sets a minecart's damage.- Parameters:
damage- over 40 to "kill" a minecart
-
_INVALID_getDamage
@Deprecated int _INVALID_getDamage()Deprecated.This method exists for legacy reasons to provide backwards compatibility. It will not exist at runtime and should not be used under any circumstances.- Returns:
- The damage
-
getDamage
double getDamage()Gets a minecart's damage.- Returns:
- The damage
-
getMaxSpeed
double getMaxSpeed()Gets the maximum speed of a minecart. The speed is unrelated to the velocity.- Returns:
- The max speed
-
setMaxSpeed
void setMaxSpeed(double speed)Sets the maximum speed of a minecart. Must be nonnegative. Default is 0.4D.- Parameters:
speed- The max speed
-
isSlowWhenEmpty
boolean isSlowWhenEmpty()Returns whether this minecart will slow down faster without a passenger occupying it- Returns:
- Whether it decelerates faster
-
setSlowWhenEmpty
void setSlowWhenEmpty(boolean slow)Sets whether this minecart will slow down faster without a passenger occupying it- Parameters:
slow- Whether it will decelerate faster
-
getFlyingVelocityMod
Vector getFlyingVelocityMod()Gets the flying velocity modifier. Used for minecarts that are in mid-air. A flying minecart's velocity is multiplied by this factor each tick.- Returns:
- The vector factor
-
setFlyingVelocityMod
Sets the flying velocity modifier. Used for minecarts that are in mid-air. A flying minecart's velocity is multiplied by this factor each tick.- Parameters:
flying- velocity modifier vector
-
getDerailedVelocityMod
Vector getDerailedVelocityMod()Gets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails.A derailed minecart's velocity is multiplied by this factor each tick.
- Returns:
- derailed visible speed
-
setDerailedVelocityMod
Sets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails. A derailed minecart's velocity is multiplied by this factor each tick.- Parameters:
derailed- visible speed
-
setDisplayBlock
Sets the display block for this minecart. Passing a null value will set the minecart to have no display block.- Parameters:
material- the material to set as display block.
-
getDisplayBlock
MaterialData getDisplayBlock()Gets the display block for this minecart. This function will return the type AIR if none is set.- Returns:
- the block displayed by this minecart.
-
setDisplayBlockOffset
void setDisplayBlockOffset(int offset)Sets the offset of the display block.- Parameters:
offset- the block offset to set for this minecart.
-
getDisplayBlockOffset
int getDisplayBlockOffset()Gets the offset of the display block.- Returns:
- the current block offset for this minecart.
-