Class AbstractMinecartEntity

java.lang.Object
net.minecraft.entity.Entity
net.minecraft.entity.vehicle.AbstractMinecartEntity
All Implemented Interfaces:
CommandOutput, Nameable
Direct Known Subclasses:
CommandBlockMinecartEntity, FurnaceMinecartEntity, MinecartEntity, SpawnerMinecartEntity, StorageMinecartEntity, TntMinecartEntity

public abstract class AbstractMinecartEntity
extends Entity
  • Field Details

    • DAMAGE_WOBBLE_TICKS

      private static final TrackedData<Integer> DAMAGE_WOBBLE_TICKS
    • DAMAGE_WOBBLE_SIDE

      private static final TrackedData<Integer> DAMAGE_WOBBLE_SIDE
    • DAMAGE_WOBBLE_STRENGTH

      private static final TrackedData<Float> DAMAGE_WOBBLE_STRENGTH
    • CUSTOM_BLOCK_ID

      private static final TrackedData<Integer> CUSTOM_BLOCK_ID
    • CUSTOM_BLOCK_OFFSET

      private static final TrackedData<Integer> CUSTOM_BLOCK_OFFSET
    • CUSTOM_BLOCK_PRESENT

      private static final TrackedData<Boolean> CUSTOM_BLOCK_PRESENT
    • DISMOUNT_FREE_Y_SPACES_NEEDED

      private static final ImmutableMap<EntityPose,​ImmutableList<Integer>> DISMOUNT_FREE_Y_SPACES_NEEDED
    • ADJACENT_RAIL_POSITIONS_BY_SHAPE

      private static final Map<RailShape,​com.mojang.datafixers.util.Pair<Vec3i,​Vec3i>> ADJACENT_RAIL_POSITIONS_BY_SHAPE
    • yawFlipped

      private boolean yawFlipped
    • clientInterpolationSteps

      private int clientInterpolationSteps
    • clientX

      private double clientX
    • clientY

      private double clientY
    • clientZ

      private double clientZ
    • clientYaw

      private double clientYaw
    • clientPitch

      private double clientPitch
    • clientXVelocity

      @Environment(CLIENT) private double clientXVelocity
    • clientYVelocity

      @Environment(CLIENT) private double clientYVelocity
    • clientZVelocity

      @Environment(CLIENT) private double clientZVelocity
  • Constructor Details

    • AbstractMinecartEntity

      protected AbstractMinecartEntity​(EntityType<?> type, World world)
    • AbstractMinecartEntity

      protected AbstractMinecartEntity​(EntityType<?> type, World world, double x, double y, double z)
  • Method Details

    • create

      public static AbstractMinecartEntity create​(World world, double x, double y, double z, AbstractMinecartEntity.Type type)
    • canClimb

      protected boolean canClimb()
      Overrides:
      canClimb in class Entity
    • initDataTracker

      protected void initDataTracker()
      Specified by:
      initDataTracker in class Entity
    • collidesWith

      public boolean collidesWith​(Entity other)
      Overrides:
      collidesWith in class Entity
    • isPushable

      public boolean isPushable()
      Overrides:
      isPushable in class Entity
    • method_30633

      protected Vec3d method_30633​(Direction.Axis axis, class_5459.class_5460 class_5460)
      Overrides:
      method_30633 in class Entity
    • getMountedHeightOffset

      public double getMountedHeightOffset()
      Overrides:
      getMountedHeightOffset in class Entity
    • updatePassengerForDismount

      public Vec3d updatePassengerForDismount​(LivingEntity passenger)
      Overrides:
      updatePassengerForDismount in class Entity
    • damage

      public boolean damage​(DamageSource source, float amount)
      Overrides:
      damage in class Entity
    • getVelocityMultiplier

      protected float getVelocityMultiplier()
      Overrides:
      getVelocityMultiplier in class Entity
    • dropItems

      public void dropItems​(DamageSource damageSource)
    • animateDamage

      @Environment(CLIENT) public void animateDamage()
      Overrides:
      animateDamage in class Entity
    • collides

      public boolean collides()
      Overrides:
      collides in class Entity
    • getAdjacentRailPositionsByShape

      private static com.mojang.datafixers.util.Pair<Vec3i,​Vec3i> getAdjacentRailPositionsByShape​(RailShape shape)
    • getMovementDirection

      public Direction getMovementDirection()
      Overrides:
      getMovementDirection in class Entity
    • tick

      public void tick()
      Overrides:
      tick in class Entity
    • getMaxOffRailSpeed

      protected double getMaxOffRailSpeed()
    • onActivatorRail

      public void onActivatorRail​(int x, int y, int z, boolean powered)
    • moveOffRail

      protected void moveOffRail()
    • moveOnRail

      protected void moveOnRail​(BlockPos pos, BlockState state)
    • willHitBlockAt

      private boolean willHitBlockAt​(BlockPos pos)
    • applySlowdown

      protected void applySlowdown()
    • snapPositionToRailWithOffset

      @Environment(CLIENT) @Nullable public Vec3d snapPositionToRailWithOffset​(double x, double y, double z, double offset)
      This method is used to determine the minecart's render orientation, by computing a position along the rail slightly before and slightly after the minecart's actual position.
    • snapPositionToRail

      @Nullable public Vec3d snapPositionToRail​(double x, double y, double z)
    • getVisibilityBoundingBox

      @Environment(CLIENT) public Box getVisibilityBoundingBox()
      Overrides:
      getVisibilityBoundingBox in class Entity
    • readCustomDataFromTag

      protected void readCustomDataFromTag​(CompoundTag tag)
      Specified by:
      readCustomDataFromTag in class Entity
    • writeCustomDataToTag

      protected void writeCustomDataToTag​(CompoundTag tag)
      Specified by:
      writeCustomDataToTag in class Entity
    • pushAwayFrom

      public void pushAwayFrom​(Entity entity)
      Overrides:
      pushAwayFrom in class Entity
    • updateTrackedPositionAndAngles

      @Environment(CLIENT) public void updateTrackedPositionAndAngles​(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)
      Overrides:
      updateTrackedPositionAndAngles in class Entity
    • setVelocityClient

      @Environment(CLIENT) public void setVelocityClient​(double x, double y, double z)
      Overrides:
      setVelocityClient in class Entity
    • setDamageWobbleStrength

      public void setDamageWobbleStrength​(float float2)
    • getDamageWobbleStrength

      public float getDamageWobbleStrength()
    • setDamageWobbleTicks

      public void setDamageWobbleTicks​(int wobbleTicks)
    • getDamageWobbleTicks

      public int getDamageWobbleTicks()
    • setDamageWobbleSide

      public void setDamageWobbleSide​(int wobbleSide)
    • getDamageWobbleSide

      public int getDamageWobbleSide()
    • getMinecartType

      public abstract AbstractMinecartEntity.Type getMinecartType()
    • getContainedBlock

      public BlockState getContainedBlock()
    • getDefaultContainedBlock

      public BlockState getDefaultContainedBlock()
    • getBlockOffset

      public int getBlockOffset()
    • getDefaultBlockOffset

      public int getDefaultBlockOffset()
    • setCustomBlock

      public void setCustomBlock​(BlockState state)
    • setCustomBlockOffset

      public void setCustomBlockOffset​(int offset)
    • hasCustomBlock

      public boolean hasCustomBlock()
    • setCustomBlockPresent

      public void setCustomBlockPresent​(boolean present)
    • createSpawnPacket

      public Packet<?> createSpawnPacket()
      Specified by:
      createSpawnPacket in class Entity