接口 Minecart
- 所有超级接口:
CommandSender
,Entity
,Metadatable
,Nameable
,Permissible
,ServerOperator
,Vehicle
- 所有已知子接口:
CommandMinecart
,ExplosiveMinecart
,HopperMinecart
,PoweredMinecart
,RideableMinecart
,SpawnerMinecart
,StorageMinecart
Represents a minecart entity.
-
方法概要
修饰符和类型方法说明double
Gets a minecart's damage.Gets the derailed velocity modifier.Gets the display block for this minecart.int
Gets the offset of the display block.Gets the flying velocity modifier.double
Gets the maximum speed of a minecart.boolean
Returns whether this minecart will slow down faster without a passenger occupying itvoid
setDamage
(double damage) Sets a minecart's damage.void
setDerailedVelocityMod
(Vector derailed) Sets the derailed velocity modifier.void
setDisplayBlock
(MaterialData material) Sets the display block for this minecart.void
setDisplayBlockOffset
(int offset) Sets the offset of the display block.void
setFlyingVelocityMod
(Vector flying) Sets the flying velocity modifier.void
setMaxSpeed
(double speed) Sets the maximum speed of a minecart.void
setSlowWhenEmpty
(boolean slow) Sets whether this minecart will slow down faster without a passenger occupying it从接口继承的方法 org.bukkit.command.CommandSender
getName, sendMessage, sendMessage
从接口继承的方法 org.bukkit.entity.Entity
addPassenger, addScoreboardTag, eject, getEntityId, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isSilent, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPortalCooldown, setSilent, setTicksLived, teleport, teleport, teleport, teleport
从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
从接口继承的方法 org.bukkit.Nameable
getCustomName, setCustomName
从接口继承的方法 org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
从接口继承的方法 org.bukkit.permissions.ServerOperator
isOp, setOp
从接口继承的方法 org.bukkit.entity.Vehicle
getVelocity, setVelocity
-
方法详细资料
-
setDamage
void setDamage(double damage) Sets a minecart's damage.- 参数:
damage
- over 40 to "kill" a minecart
-
getDamage
double getDamage()Gets a minecart's damage.- 返回:
- The damage
-
getMaxSpeed
double getMaxSpeed()Gets the maximum speed of a minecart. The speed is unrelated to the velocity.- 返回:
- The max speed
-
setMaxSpeed
void setMaxSpeed(double speed) Sets the maximum speed of a minecart. Must be nonnegative. Default is 0.4D.- 参数:
speed
- The max speed
-
isSlowWhenEmpty
boolean isSlowWhenEmpty()Returns whether this minecart will slow down faster without a passenger occupying it- 返回:
- Whether it decelerates faster
-
setSlowWhenEmpty
void setSlowWhenEmpty(boolean slow) Sets whether this minecart will slow down faster without a passenger occupying it- 参数:
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.- 返回:
- 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.- 参数:
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.
- 返回:
- 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.- 参数:
derailed
- visible speed
-
setDisplayBlock
Sets the display block for this minecart. Passing a null value will set the minecart to have no display block.- 参数:
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.- 返回:
- the block displayed by this minecart.
-
setDisplayBlockOffset
void setDisplayBlockOffset(int offset) Sets the offset of the display block.- 参数:
offset
- the block offset to set for this minecart.
-
getDisplayBlockOffset
int getDisplayBlockOffset()Gets the offset of the display block.- 返回:
- the current block offset for this minecart.
-