Class AbstractMinecart
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.vehicle.VehicleEntity
net.minecraft.world.entity.vehicle.AbstractMinecart
- All Implemented Interfaces:
- CommandSource,- EntityAccess,- Nameable,- ScoreHolder,- IAttachmentHolder,- IAbstractMinecartExtension,- IEntityExtension,- INBTSerializable<CompoundTag>
- Direct Known Subclasses:
- AbstractMinecartContainer,- Minecart,- MinecartCommandBlock,- MinecartFurnace,- MinecartSpawner,- MinecartTNT
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.EntityEntity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolderAttachmentHolder.AsField
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate static IMinecartCollisionHandlerprivate floatprivate static final EntityDataAccessor<Boolean>private static final EntityDataAccessor<Integer>private static final EntityDataAccessor<Integer>private doubleprivate booleanprivate intprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate static final floatprivate @Nullable Floatprivate floatprivate booleanprivate static final floatprivate static final com.google.common.collect.ImmutableMap<Pose,com.google.common.collect.ImmutableList<Integer>> private Vec3protected static final floatFields inherited from class net.minecraft.world.entity.vehicle.VehicleEntityDATA_ID_DAMAGE, DATA_ID_HURT, DATA_ID_HURTDIRFields inherited from class net.minecraft.world.entity.EntityBASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, BREATHING_DISTANCE_BELOW_EYES, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, ENTITY_COUNTER, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, isInsidePortal, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalEntrancePos, portalTime, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolderATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.commands.CommandSourceNULLFields inherited from interface net.neoforged.neoforge.common.extensions.IAbstractMinecartExtensionDEFAULT_AIR_DRAG, DEFAULT_MAX_SPEED_AIR_LATERAL, DEFAULT_MAX_SPEED_AIR_VERTICALFields inherited from interface net.minecraft.world.scores.ScoreHolderWILDCARD, WILDCARD_NAME
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractMinecart(EntityType<?> p_38087_, Level p_38088_) protectedAbstractMinecart(EntityType<?> p_38090_, Level p_38091_, double p_38092_, double p_38093_, double p_38094_) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidactivateMinecart(int p_38111_, int p_38112_, int p_38113_, boolean p_38114_) protected voidaddAdditionalSaveData(CompoundTag p_38151_) voidanimateHurt(float p_265349_) protected voidbooleancanCollideWith(Entity p_38168_) booleanReturns true if this cart can currently use rails.protected voidstatic AbstractMinecartcreateMinecart(ServerLevel p_305794_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_, ItemStack p_305892_, Player p_306203_) protected voidprotected floatfloatReturns the current speed cap for the cart when traveling on rails.intgetDismountLocationForPassenger(LivingEntity p_38145_) intdoubleprotected doublefloatfloatdoubleabstract AbstractMinecart.Typeprotected Entity.MovementEmissionprotected org.joml.Vector3fgetPassengerAttachmentPoint(Entity p_294753_, EntityDimensions p_295251_, float p_296054_) getPos(double p_38180_, double p_38181_, double p_38182_) getPosOffs(double p_38097_, double p_38098_, double p_38099_, double p_38100_) protected Vec3getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) booleanbooleanbooleanbooleanprivate booleanisRedstoneConductor(BlockPos p_38130_) voidlerpMotion(double p_38171_, double p_38172_, double p_38173_) doublefloatdoublefloatdoublevoidlerpTo(double p_38102_, double p_38103_, double p_38104_, float p_38105_, float p_38106_, int p_38107_) protected voidmoveAlongTrack(BlockPos p_38156_, BlockState p_38157_) voidMoved to allow overrides.voidprotected voidreadAdditionalSaveData(CompoundTag p_38137_) static voidvoidsetCanUseRail(boolean value) Set whether the minecart can use rails.voidsetCurrentCartSpeedCapOnRail(float value) voidsetCustomDisplay(boolean p_38139_) voidsetDisplayBlockState(BlockState p_38147_) voidsetDisplayOffset(int p_38175_) voidsetDragAir(double value) voidsetMaxSpeedAirLateral(float value) voidsetMaxSpeedAirVertical(float value) voidtick()Methods inherited from class net.minecraft.world.entity.vehicle.VehicleEntitydestroy, destroy, getDamage, getDropItem, getHurtDir, getHurtTime, hurt, setDamage, setHurtDir, setHurtTime, shouldSourceDestroyMethods inherited from class net.minecraft.world.entity.EntityabsMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canChangeDimensions, canControlVehicle, canFreeze, canRide, canSpawnSprintParticle, canSprint, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, causeFallDamage, changeDimension, changeDimension, checkBelowWorld, checkDespawn, checkFallDamage, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, fixupDimensions, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAllSlots, getArmorSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getHandHoldingItemAngle, getHandSlots, getId, getIndirectPassengers, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMaxHeightFluidType, getMyRidingOffset, getName, getNameTagOffsetY, getOnPos, getOnPos, getOnPosLegacy, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPortalWaitTime, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getViewYRot, getVisualRotationYInDegrees, getX, getX, getXRot, getY, getY, getYHeadRot, getYRot, getZ, getZ, handleDamageEvent, handleEntityEvent, handleInsidePortal, handleNetherPortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killedEntity, lavaHurt, lerpHeadTo, lerpPositionAndRotationStep, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onBelowWorld, onClientRemoval, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, onSyncedDataUpdated, pick, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, reapplyPosition, recreateFromPacket, refreshDimensions, remove, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rideTick, ridingOffset, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setItemSlot, setLevel, setLevelCallback, setMaxUpStep, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithKnownMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSecondsOnFire, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolderareAttachmentsCompatible, deserializeAttachments, getData, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.CommandSourcealwaysAcceptsMethods inherited from interface net.neoforged.neoforge.common.extensions.IAbstractMinecartExtensioncanBeRidden, getComparatorLevel, getCurrentRailPosition, getMaxCartSpeedOnRail, getSlopeAdjustment, isPoweredCart, shouldDoRailFunctionsMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHoldergetData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtensioncanBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canSwimInFluidType, deserializeNBT, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getParts, getPickedResult, getSoundFromFluidType, getStepHeight, hasCustomOutlineRendering, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, sendPairingData, serializeNBT, shouldRiderSitMethods inherited from interface net.minecraft.world.scores.ScoreHoldergetFeedbackDisplayName
- 
Field Details- 
LOWERED_PASSENGER_ATTACHMENT_Yprivate static final float LOWERED_PASSENGER_ATTACHMENT_Y- See Also:
 
- 
PASSENGER_ATTACHMENT_Yprivate static final float PASSENGER_ATTACHMENT_Y- See Also:
 
- 
DATA_ID_DISPLAY_BLOCK
- 
DATA_ID_DISPLAY_OFFSET
- 
DATA_ID_CUSTOM_DISPLAY
- 
POSE_DISMOUNT_HEIGHTS
- 
WATER_SLOWDOWN_FACTORprotected static final float WATER_SLOWDOWN_FACTOR- See Also:
 
- 
flippedprivate boolean flipped
- 
onRailsprivate boolean onRails
- 
lerpStepsprivate int lerpSteps
- 
lerpXprivate double lerpX
- 
lerpYprivate double lerpY
- 
lerpZprivate double lerpZ
- 
lerpYRotprivate double lerpYRot
- 
lerpXRotprivate double lerpXRot
- 
targetDeltaMovement
- 
canBePushedprivate boolean canBePushed
- 
EXITS
- 
COLLISIONS
- 
canUseRailprivate boolean canUseRail
- 
currentSpeedCapOnRailprivate float currentSpeedCapOnRail
- 
maxSpeedAirLateral
- 
maxSpeedAirVerticalprivate float maxSpeedAirVertical
- 
dragAirprivate double dragAir
 
- 
- 
Constructor Details- 
AbstractMinecart
- 
AbstractMinecartprotected AbstractMinecart(EntityType<?> p_38090_, Level p_38091_, double p_38092_, double p_38093_, double p_38094_) 
 
- 
- 
Method Details- 
getCollisionHandler
- 
registerCollisionHandler
- 
createMinecartpublic static AbstractMinecart createMinecart(ServerLevel p_305794_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_, ItemStack p_305892_, @Nullable Player p_306203_) 
- 
getMovementEmission- Overrides:
- getMovementEmissionin class- Entity
 
- 
defineSynchedDataprotected void defineSynchedData()- Overrides:
- defineSynchedDatain class- VehicleEntity
 
- 
canCollideWith- Overrides:
- canCollideWithin class- Entity
 
- 
isPushablepublic boolean isPushable()- Overrides:
- isPushablein class- Entity
 
- 
getRelativePortalPositionprotected Vec3 getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) - Overrides:
- getRelativePortalPositionin class- Entity
 
- 
getPassengerAttachmentPointprotected org.joml.Vector3f getPassengerAttachmentPoint(Entity p_294753_, EntityDimensions p_295251_, float p_296054_) - Overrides:
- getPassengerAttachmentPointin class- Entity
 
- 
getDismountLocationForPassenger- Overrides:
- getDismountLocationForPassengerin class- Entity
 
- 
getBlockSpeedFactorprotected float getBlockSpeedFactor()- Overrides:
- getBlockSpeedFactorin class- Entity
 
- 
animateHurtpublic void animateHurt(float p_265349_) - Overrides:
- animateHurtin class- Entity
 
- 
isPickablepublic boolean isPickable()- Overrides:
- isPickablein class- Entity
 
- 
exits
- 
getMotionDirection- Overrides:
- getMotionDirectionin class- Entity
 
- 
tickpublic void tick()
- 
getMaxSpeedprotected double getMaxSpeed()
- 
activateMinecartpublic void activateMinecart(int p_38111_, int p_38112_, int p_38113_, boolean p_38114_) 
- 
comeOffTrackprotected void comeOffTrack()
- 
moveAlongTrack
- 
isOnRailspublic boolean isOnRails()
- 
isRedstoneConductor
- 
applyNaturalSlowdownprotected void applyNaturalSlowdown()
- 
getPosOffs@Nullable public Vec3 getPosOffs(double p_38097_, double p_38098_, double p_38099_, double p_38100_) 
- 
getPos
- 
getBoundingBoxForCulling- Overrides:
- getBoundingBoxForCullingin class- Entity
 
- 
readAdditionalSaveData- Specified by:
- readAdditionalSaveDatain class- Entity
 
- 
addAdditionalSaveData- Specified by:
- addAdditionalSaveDatain class- Entity
 
- 
push
- 
lerpTopublic void lerpTo(double p_38102_, double p_38103_, double p_38104_, float p_38105_, float p_38106_, int p_38107_) 
- 
lerpTargetXpublic double lerpTargetX()- Overrides:
- lerpTargetXin class- Entity
 
- 
lerpTargetYpublic double lerpTargetY()- Overrides:
- lerpTargetYin class- Entity
 
- 
lerpTargetZpublic double lerpTargetZ()- Overrides:
- lerpTargetZin class- Entity
 
- 
lerpTargetXRotpublic float lerpTargetXRot()- Overrides:
- lerpTargetXRotin class- Entity
 
- 
lerpTargetYRotpublic float lerpTargetYRot()- Overrides:
- lerpTargetYRotin class- Entity
 
- 
lerpMotionpublic void lerpMotion(double p_38171_, double p_38172_, double p_38173_) - Overrides:
- lerpMotionin class- Entity
 
- 
getMinecartType
- 
getDisplayBlockState
- 
getDefaultDisplayBlockState
- 
getDisplayOffsetpublic int getDisplayOffset()
- 
getDefaultDisplayOffsetpublic int getDefaultDisplayOffset()
- 
setDisplayBlockState
- 
setDisplayOffsetpublic void setDisplayOffset(int p_38175_) 
- 
hasCustomDisplaypublic boolean hasCustomDisplay()
- 
setCustomDisplaypublic void setCustomDisplay(boolean p_38139_) 
- 
canUseRailpublic boolean canUseRail()Description copied from interface:IAbstractMinecartExtensionReturns true if this cart can currently use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
- canUseRailin interface- IAbstractMinecartExtension
- Returns:
- True if the minecart can use rails.
 
- 
setCanUseRailpublic void setCanUseRail(boolean value) Description copied from interface:IAbstractMinecartExtensionSet whether the minecart can use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
- setCanUseRailin interface- IAbstractMinecartExtension
- Parameters:
- value- Whether the minecart can currently use rails.
 
- 
getCurrentCartSpeedCapOnRailpublic float getCurrentCartSpeedCapOnRail()Description copied from interface:IAbstractMinecartExtensionReturns the current speed cap for the cart when traveling on rails. This functions differs from getMaxCartSpeedOnRail() in that it controls current movement and cannot be overridden. The value however can never be higher than getMaxCartSpeedOnRail().- Specified by:
- getCurrentCartSpeedCapOnRailin interface- IAbstractMinecartExtension
 
- 
setCurrentCartSpeedCapOnRailpublic void setCurrentCartSpeedCapOnRail(float value) - Specified by:
- setCurrentCartSpeedCapOnRailin interface- IAbstractMinecartExtension
 
- 
getMaxSpeedAirLateralpublic float getMaxSpeedAirLateral()- Specified by:
- getMaxSpeedAirLateralin interface- IAbstractMinecartExtension
 
- 
setMaxSpeedAirLateralpublic void setMaxSpeedAirLateral(float value) - Specified by:
- setMaxSpeedAirLateralin interface- IAbstractMinecartExtension
 
- 
getMaxSpeedAirVerticalpublic float getMaxSpeedAirVertical()- Specified by:
- getMaxSpeedAirVerticalin interface- IAbstractMinecartExtension
 
- 
setMaxSpeedAirVerticalpublic void setMaxSpeedAirVertical(float value) - Specified by:
- setMaxSpeedAirVerticalin interface- IAbstractMinecartExtension
 
- 
getDragAirpublic double getDragAir()- Specified by:
- getDragAirin interface- IAbstractMinecartExtension
 
- 
setDragAirpublic void setDragAir(double value) - Specified by:
- setDragAirin interface- IAbstractMinecartExtension
 
- 
getMaxSpeedWithRailpublic double getMaxSpeedWithRail()- Specified by:
- getMaxSpeedWithRailin interface- IAbstractMinecartExtension
 
- 
moveMinecartOnRailDescription copied from interface:IAbstractMinecartExtensionMoved to allow overrides. This code handles minecart movement and speed capping when on a rail.- Specified by:
- moveMinecartOnRailin interface- IAbstractMinecartExtension
 
- 
getPickResult- Overrides:
- getPickResultin class- Entity
 
 
-