Class TntMinecartEntity

All Implemented Interfaces:
DataTracked, ScoreHolder, CommandOutput, Nameable, EntityLike

public class TntMinecartEntity extends AbstractMinecartEntity
Mappings:
Namespace Name
named net/minecraft/entity/vehicle/TntMinecartEntity
intermediary net/minecraft/class_1701
official cpf
  • Field Details

    • PRIME_TNT_STATUS

      private static final byte PRIME_TNT_STATUS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named PRIME_TNT_STATUS Lnet/minecraft/entity/vehicle/TntMinecartEntity;PRIME_TNT_STATUS:B
      intermediary field_30703 Lnet/minecraft/class_1701;field_30703:B
      official c Lcpf;c:B
    • fuseTicks

      private int fuseTicks
      Mappings:
      Namespace Name Mixin selector
      named fuseTicks Lnet/minecraft/entity/vehicle/TntMinecartEntity;fuseTicks:I
      intermediary field_7751 Lnet/minecraft/class_1701;field_7751:I
      official d Lcpf;d:I
  • Constructor Details

    • TntMinecartEntity

      public TntMinecartEntity(EntityType<? extends TntMinecartEntity> type, World world)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/Entity;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
      intermediary <init> Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)V
      official <init> Lbsr;<init>(Lbsx;Ldcw;)V
    • TntMinecartEntity

      public TntMinecartEntity(World world, double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/vehicle/TntMinecartEntity;<init>(Lnet/minecraft/world/World;DDD)V
      intermediary <init> Lnet/minecraft/class_1701;<init>(Lnet/minecraft/class_1937;DDD)V
      official <init> Lcpf;<init>(Ldcw;DDD)V
  • Method Details

    • getMinecartType

      public AbstractMinecartEntity.Type getMinecartType()
      Specified by:
      getMinecartType in class AbstractMinecartEntity
      Mappings:
      Namespace Name Mixin selector
      named getMinecartType Lnet/minecraft/entity/vehicle/AbstractMinecartEntity;getMinecartType()Lnet/minecraft/entity/vehicle/AbstractMinecartEntity$Type;
      intermediary method_7518 Lnet/minecraft/class_1688;method_7518()Lnet/minecraft/class_1688$class_1689;
      official v Lcot;v()Lcot$a;
    • getDefaultContainedBlock

      public BlockState getDefaultContainedBlock()
      Overrides:
      getDefaultContainedBlock in class AbstractMinecartEntity
      Mappings:
      Namespace Name Mixin selector
      named getDefaultContainedBlock Lnet/minecraft/entity/vehicle/AbstractMinecartEntity;getDefaultContainedBlock()Lnet/minecraft/block/BlockState;
      intermediary method_7517 Lnet/minecraft/class_1688;method_7517()Lnet/minecraft/class_2680;
      official x Lcot;x()Ldtc;
    • tick

      public void tick()
      Ticks this entity.
      Overrides:
      tick in class AbstractMinecartEntity
      See Also:
      API Note:
      This can be overridden to add additional logics. super.tick(); should be called in those cases.
      Implementation Note:
      By default, this delegates all logics to Entity.baseTick().
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/entity/Entity;tick()V
      intermediary method_5773 Lnet/minecraft/class_1297;method_5773()V
      official l Lbsr;l()V
    • damage

      public boolean damage(DamageSource source, float amount)
      Applies a damage to this entity. The exact implementation differs between subclasses.

      LivingEntity has health value, and damaging the entity decreases it. This also handles shields, extra damage to helmets for falling blocks, setting the attacker, playing hurt sound, etc.

      Some entities like ItemEntity also have health value, which the overridden method decrements. There also exist several entities, like EndCrystalEntity, where any damage discards the entity (perhaps with an explosion).

      If this is overridden, it must check the result of Entity.isInvulnerableTo(net.minecraft.entity.damage.DamageSource) and return early.

      Overrides:
      damage in class VehicleEntity
      Returns:
      whether the entity was actually damaged
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named damage Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;F)Z
      intermediary method_5643 Lnet/minecraft/class_1297;method_5643(Lnet/minecraft/class_1282;F)Z
      official a Lbsr;a(Lbrk;F)Z
    • killAndDropSelf

      public void killAndDropSelf(DamageSource source)
      Overrides:
      killAndDropSelf in class VehicleEntity
      Mappings:
      Namespace Name Mixin selector
      named killAndDropSelf Lnet/minecraft/entity/vehicle/VehicleEntity;killAndDropSelf(Lnet/minecraft/entity/damage/DamageSource;)V
      intermediary method_7516 Lnet/minecraft/class_8836;method_7516(Lnet/minecraft/class_1282;)V
      official a Lcpg;a(Lbrk;)V
    • asItem

      protected Item asItem()
      Specified by:
      asItem in class VehicleEntity
      Mappings:
      Namespace Name Mixin selector
      named asItem Lnet/minecraft/entity/vehicle/VehicleEntity;asItem()Lnet/minecraft/item/Item;
      intermediary method_7557 Lnet/minecraft/class_8836;method_7557()Lnet/minecraft/class_1792;
      official ak_ Lcpg;ak_()Lcul;
    • explode

      protected void explode(double power)
      Mappings:
      Namespace Name Mixin selector
      named explode Lnet/minecraft/entity/vehicle/TntMinecartEntity;explode(D)V
      intermediary method_47305 Lnet/minecraft/class_1701;method_47305(D)V
      official h Lcpf;h(D)V
    • explode

      protected void explode(@Nullable @Nullable DamageSource damageSource, double power)
      Mappings:
      Namespace Name Mixin selector
      named explode Lnet/minecraft/entity/vehicle/TntMinecartEntity;explode(Lnet/minecraft/entity/damage/DamageSource;D)V
      intermediary method_7576 Lnet/minecraft/class_1701;method_7576(Lnet/minecraft/class_1282;D)V
      official a Lcpf;a(Lbrk;D)V
    • handleFallDamage

      public boolean handleFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource)
      Called when an entity falls.

      Flying mobs and mobs immune to fall damage should override this to do nothing. Mobs with reduced fall damage should override this method to apply reduced damage instead. Some entities explode instead of applying fall damage, like TntMinecartEntity.

      Overrides:
      handleFallDamage in class Entity
      Returns:
      whether to play the sound when falling on honey block; false for all entities except horses and llamas
      Mappings:
      Namespace Name Mixin selector
      named handleFallDamage Lnet/minecraft/entity/Entity;handleFallDamage(FFLnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_5747 Lnet/minecraft/class_1297;method_5747(FFLnet/minecraft/class_1282;)Z
      official a Lbsr;a(FFLbrk;)Z
    • onActivatorRail

      public void onActivatorRail(int x, int y, int z, boolean powered)
      Overrides:
      onActivatorRail in class AbstractMinecartEntity
      Mappings:
      Namespace Name Mixin selector
      named onActivatorRail Lnet/minecraft/entity/vehicle/AbstractMinecartEntity;onActivatorRail(IIIZ)V
      intermediary method_7506 Lnet/minecraft/class_1688;method_7506(IIIZ)V
      official a Lcot;a(IIIZ)V
    • handleStatus

      public void handleStatus(byte status)
      Called on the client when the entity receives an entity status from the server. They are often used to spawn particles or play sounds. Subclasses can override this method to handle custom entity status.
      Overrides:
      handleStatus in class Entity
      See Also:
      API Note:
      To send an entity status, use World.sendEntityStatus(net.minecraft.entity.Entity, byte).
      Mappings:
      Namespace Name Mixin selector
      named handleStatus Lnet/minecraft/entity/Entity;handleStatus(B)V
      intermediary method_5711 Lnet/minecraft/class_1297;method_5711(B)V
      official b Lbsr;b(B)V
    • prime

      public void prime()
      Mappings:
      Namespace Name Mixin selector
      named prime Lnet/minecraft/entity/vehicle/TntMinecartEntity;prime()V
      intermediary method_7575 Lnet/minecraft/class_1701;method_7575()V
      official B Lcpf;B()V
    • getFuseTicks

      public int getFuseTicks()
      Mappings:
      Namespace Name Mixin selector
      named getFuseTicks Lnet/minecraft/entity/vehicle/TntMinecartEntity;getFuseTicks()I
      intermediary method_7577 Lnet/minecraft/class_1701;method_7577()I
      official C Lcpf;C()I
    • isPrimed

      public boolean isPrimed()
      Mappings:
      Namespace Name Mixin selector
      named isPrimed Lnet/minecraft/entity/vehicle/TntMinecartEntity;isPrimed()Z
      intermediary method_7578 Lnet/minecraft/class_1701;method_7578()Z
      official D Lcpf;D()Z
    • getEffectiveExplosionResistance

      public float getEffectiveExplosionResistance(Explosion explosion, BlockView world, BlockPos pos, BlockState blockState, FluidState fluidState, float max)
      Returns the blast resistance of blockState for an explosion caused by this entity.
      Overrides:
      getEffectiveExplosionResistance in class Entity
      Returns:
      the blast resistance of blockState for an explosion caused by this entity
      See Also:
      API Note:
      WitherSkullEntity overrides this to implement the "charged/blue skull" behavior.
      Mappings:
      Namespace Name Mixin selector
      named getEffectiveExplosionResistance Lnet/minecraft/entity/Entity;getEffectiveExplosionResistance(Lnet/minecraft/world/explosion/Explosion;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/fluid/FluidState;F)F
      intermediary method_5774 Lnet/minecraft/class_1297;method_5774(Lnet/minecraft/class_1927;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3610;F)F
      official a Lbsr;a(Ldco;Ldcc;Ljd;Ldtc;Lepe;F)F
    • canExplosionDestroyBlock

      public boolean canExplosionDestroyBlock(Explosion explosion, BlockView world, BlockPos pos, BlockState state, float explosionPower)
      Returns whether explosion from this entity can destroy state.
      Overrides:
      canExplosionDestroyBlock in class Entity
      Returns:
      whether explosion from this entity can destroy state
      See Also:
      API Note:
      This is used by TntMinecartEntity to prevent the rail from being destroyed by explosion.
      Mappings:
      Namespace Name Mixin selector
      named canExplosionDestroyBlock Lnet/minecraft/entity/Entity;canExplosionDestroyBlock(Lnet/minecraft/world/explosion/Explosion;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;F)Z
      intermediary method_5853 Lnet/minecraft/class_1297;method_5853(Lnet/minecraft/class_1927;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;F)Z
      official a Lbsr;a(Ldco;Ldcc;Ljd;Ldtc;F)Z
    • readCustomDataFromNbt

      protected void readCustomDataFromNbt(NbtCompound nbt)
      Reads custom data from nbt. Subclasses have to implement this.

      NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.

      nbt might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.

      Overrides:
      readCustomDataFromNbt in class AbstractMinecartEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named readCustomDataFromNbt Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_5749 Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
      official a Lbsr;a(Lub;)V
    • writeCustomDataToNbt

      protected void writeCustomDataToNbt(NbtCompound nbt)
      Writes custom data to nbt. Subclasses have to implement this.

      NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.

      Overrides:
      writeCustomDataToNbt in class AbstractMinecartEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named writeCustomDataToNbt Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_5652 Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
      official b Lbsr;b(Lub;)V
    • shouldAlwaysKill

      boolean shouldAlwaysKill(DamageSource source)
      Overrides:
      shouldAlwaysKill in class VehicleEntity
      Mappings:
      Namespace Name Mixin selector
      named shouldAlwaysKill Lnet/minecraft/entity/vehicle/VehicleEntity;shouldAlwaysKill(Lnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_55056 Lnet/minecraft/class_8836;method_55056(Lnet/minecraft/class_1282;)Z
      official d Lcpg;d(Lbrk;)Z
    • shouldDetonate

      private static boolean shouldDetonate(DamageSource source)
      Mappings:
      Namespace Name Mixin selector
      named shouldDetonate Lnet/minecraft/entity/vehicle/TntMinecartEntity;shouldDetonate(Lnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_55057 Lnet/minecraft/class_1701;method_55057(Lnet/minecraft/class_1282;)Z
      official e Lcpf;e(Lbrk;)Z