Package org.bukkit.entity
Interface Minecart
- All Superinterfaces:
Audience
,CommandSender
,Entity
,HoverEventSource<HoverEvent.ShowEntity>
,Metadatable
,Nameable
,Permissible
,PersistentDataHolder
,Pointered
,ServerOperator
,Sound.Emitter
,Vehicle
- All Known Subinterfaces:
CommandMinecart
,ExplosiveMinecart
,HopperMinecart
,PoweredMinecart
,RideableMinecart
,SpawnerMinecart
,StorageMinecart
Represents a minecart entity.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets a minecart's damage.Gets the derailed velocity modifier.Deprecated.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.Gets theMaterial
that represents this Minecart type.boolean
Returns whether this minecart will slow down faster without a passenger occupying itvoid
setDamage
(double damage) Sets a minecart's damage.void
setDerailedVelocityMod
(@NotNull Vector derailed) Sets the derailed velocity modifier.void
setDisplayBlock
(@Nullable MaterialData material) Deprecated.void
setDisplayBlockData
(@Nullable BlockData blockData) Sets the display block for this minecart.void
setDisplayBlockOffset
(int offset) Sets the offset of the display block.void
setFlyingVelocityMod
(@NotNull 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 itMethods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, collidesAt, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedPlayers, getType, getUniqueId, getVehicle, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isUnderWater, isValid, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, wouldCollideUsing
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomName
Methods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachment
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
Methods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
Methods inherited from interface org.bukkit.entity.Vehicle
getVelocity, setVelocity
-
Method Details
-
setDamage
void setDamage(double damage) Sets a minecart's damage.- Parameters:
damage
- over 40 to "kill" a minecart
-
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
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
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
Deprecated.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
Deprecated.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.
-
setDisplayBlockData
Sets the display block for this minecart. Passing a null value will set the minecart to have no display block.- Parameters:
blockData
- the material to set as display block.
-
getDisplayBlockData
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.
-
getMinecartMaterial
Gets theMaterial
that represents this Minecart type.- Returns:
- the minecart material.
-
getDisplayBlockData()