Interface Minecart
- All Superinterfaces:
Audience, CommandSender, DataComponentView, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, Metadatable, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, 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 Entity
Entity.Spigot -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets a minecart's damage.Gets the derailed velocity modifier.Deprecated, for removal: This API element is subject to removal in a future version.Gets the display block for this minecart.intGets the offset of the display block.Gets the flying velocity modifier.doubleGets the maximum speed of a minecart.Gets theMaterialthat represents this Minecart type.booleanReturns whether this minecart will slow down faster without a passenger occupying itvoidsetDamage(double damage) Sets a minecart's damage.voidsetDerailedVelocityMod(@NotNull Vector derailed) Sets the derailed velocity modifier.voidsetDisplayBlock(@Nullable MaterialData material) Deprecated, for removal: This API element is subject to removal in a future version.voidsetDisplayBlockData(@Nullable BlockData blockData) Sets the display block for this minecart.voidsetDisplayBlockOffset(int offset) Sets the offset of the display block.voidsetFlyingVelocityMod(@NotNull 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 Audience
clearResourcePacks, clearTitle, closeDialog, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showDialog, showTitle, stopSound, stopSoundMethods inherited from interface CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessageMethods inherited from interface DataComponentView
getData, getDataOrDefault, hasDataMethods inherited from interface Entity
addPassenger, addScoreboardTag, asHoverEvent, broadcastHurtAnimation, collidesAt, copy, copy, createSnapshot, eject, fromMobSpawner, getAsString, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPickItemStack, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getTrackedPlayers, getType, getUniqueId, getVehicle, getVisualFire, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, hasNoPhysics, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvisible, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isInWorld, isOnGround, isPersistent, isSilent, isSneaking, isTicking, isTrackedBy, isUnderWater, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, lookAt, lookAt, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvisible, setInvulnerable, setLastDamageCause, setNoPhysics, setPassenger, setPersistent, setPortalCooldown, setPose, setPose, setRotation, setSilent, setSneaking, setTicksLived, setVisibleByDefault, setVisualFire, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, teleportAsync, teleportAsync, wouldCollideUsingMethods inherited from interface Frictional
getFrictionState, setFrictionStateMethods inherited from interface HoverEventSource
asHoverEventMethods inherited from interface Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface Nameable
customName, customName, getCustomName, setCustomNameMethods inherited from interface Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachmentMethods inherited from interface PersistentDataHolder
getPersistentDataContainerMethods inherited from interface Pointered
get, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface ServerOperator
isOp, setOpMethods inherited from interface 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 orGameRules.MAX_MINECART_SPEED.- 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
-
setFlyingVelocityMod
-
getDerailedVelocityMod
-
setDerailedVelocityMod
-
setDisplayBlock
@Deprecated(forRemoval=true, since="1.13") void setDisplayBlock(@Nullable @Nullable MaterialData material) Deprecated, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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
-
getDisplayBlockData
-
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
-
getDisplayBlockData()