Class InteractionEntity

java.lang.Object
net.minecraft.entity.Entity
net.minecraft.entity.decoration.InteractionEntity
All Implemented Interfaces:
ComponentsAccess, Attackable, DataTracked, Targeter, ScoreHolder, Nameable, EntityLike, UniquelyIdentifiable

public class InteractionEntity extends Entity implements Attackable, Targeter
Mappings:
Namespace Name
named net/minecraft/entity/decoration/InteractionEntity
intermediary net/minecraft/class_8150
official cag
  • Field Details

    • WIDTH

      private static final TrackedData<Float> WIDTH
      Mappings:
      Namespace Name Mixin selector
      named WIDTH Lnet/minecraft/entity/decoration/InteractionEntity;WIDTH:Lnet/minecraft/entity/data/TrackedData;
      intermediary field_42625 Lnet/minecraft/class_8150;field_42625:Lnet/minecraft/class_2940;
      official a Lcag;a:Lalh;
    • HEIGHT

      private static final TrackedData<Float> HEIGHT
      Mappings:
      Namespace Name Mixin selector
      named HEIGHT Lnet/minecraft/entity/decoration/InteractionEntity;HEIGHT:Lnet/minecraft/entity/data/TrackedData;
      intermediary field_42626 Lnet/minecraft/class_8150;field_42626:Lnet/minecraft/class_2940;
      official b Lcag;b:Lalh;
    • RESPONSE

      private static final TrackedData<Boolean> RESPONSE
      Mappings:
      Namespace Name Mixin selector
      named RESPONSE Lnet/minecraft/entity/decoration/InteractionEntity;RESPONSE:Lnet/minecraft/entity/data/TrackedData;
      intermediary field_42627 Lnet/minecraft/class_8150;field_42627:Lnet/minecraft/class_2940;
      official c Lcag;c:Lalh;
    • WIDTH_KEY

      private static final String WIDTH_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named WIDTH_KEY Lnet/minecraft/entity/decoration/InteractionEntity;WIDTH_KEY:Ljava/lang/String;
      intermediary field_42628 Lnet/minecraft/class_8150;field_42628:Ljava/lang/String;
      official d Lcag;d:Ljava/lang/String;
    • HEIGHT_KEY

      private static final String HEIGHT_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named HEIGHT_KEY Lnet/minecraft/entity/decoration/InteractionEntity;HEIGHT_KEY:Ljava/lang/String;
      intermediary field_42629 Lnet/minecraft/class_8150;field_42629:Ljava/lang/String;
      official e Lcag;e:Ljava/lang/String;
    • ATTACK_KEY

      private static final String ATTACK_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named ATTACK_KEY Lnet/minecraft/entity/decoration/InteractionEntity;ATTACK_KEY:Ljava/lang/String;
      intermediary field_42630 Lnet/minecraft/class_8150;field_42630:Ljava/lang/String;
      official f Lcag;f:Ljava/lang/String;
    • INTERACTION_KEY

      private static final String INTERACTION_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named INTERACTION_KEY Lnet/minecraft/entity/decoration/InteractionEntity;INTERACTION_KEY:Ljava/lang/String;
      intermediary field_42631 Lnet/minecraft/class_8150;field_42631:Ljava/lang/String;
      official g Lcag;g:Ljava/lang/String;
    • RESPONSE_KEY

      private static final String RESPONSE_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named RESPONSE_KEY Lnet/minecraft/entity/decoration/InteractionEntity;RESPONSE_KEY:Ljava/lang/String;
      intermediary field_42632 Lnet/minecraft/class_8150;field_42632:Ljava/lang/String;
      official h Lcag;h:Ljava/lang/String;
    • DEFAULT_WIDTH

      private static final float DEFAULT_WIDTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_WIDTH Lnet/minecraft/entity/decoration/InteractionEntity;DEFAULT_WIDTH:F
      intermediary field_57588 Lnet/minecraft/class_8150;field_57588:F
      official i Lcag;i:F
    • DEFAULT_HEIGHT

      private static final float DEFAULT_HEIGHT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_HEIGHT Lnet/minecraft/entity/decoration/InteractionEntity;DEFAULT_HEIGHT:F
      intermediary field_57589 Lnet/minecraft/class_8150;field_57589:F
      official j Lcag;j:F
    • DEFAULT_RESPONSE

      private static final boolean DEFAULT_RESPONSE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_RESPONSE Lnet/minecraft/entity/decoration/InteractionEntity;DEFAULT_RESPONSE:Z
      intermediary field_57590 Lnet/minecraft/class_8150;field_57590:Z
      official k Lcag;k:Z
    • attack

      Mappings:
      Namespace Name Mixin selector
      named attack Lnet/minecraft/entity/decoration/InteractionEntity;attack:Lnet/minecraft/entity/decoration/InteractionEntity$Interaction;
      intermediary field_42633 Lnet/minecraft/class_8150;field_42633:Lnet/minecraft/class_8150$class_8151;
      official l Lcag;l:Lcag$a;
    • interaction

      Mappings:
      Namespace Name Mixin selector
      named interaction Lnet/minecraft/entity/decoration/InteractionEntity;interaction:Lnet/minecraft/entity/decoration/InteractionEntity$Interaction;
      intermediary field_42634 Lnet/minecraft/class_8150;field_42634:Lnet/minecraft/class_8150$class_8151;
      official m Lcag;m:Lcag$a;
  • Constructor Details

    • InteractionEntity

      public InteractionEntity(EntityType<?> 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> Lbzm;<init>(Lbzv;Ldmu;)V
  • Method Details

    • initDataTracker

      protected void initDataTracker(DataTracker.Builder builder)
      Initializes data tracker.
      Specified by:
      initDataTracker in class Entity
      API Note:
      Subclasses should override this and add to the builder any data that needs to be tracked.
      Mappings:
      Namespace Name Mixin selector
      named initDataTracker Lnet/minecraft/entity/Entity;initDataTracker(Lnet/minecraft/entity/data/DataTracker$Builder;)V
      intermediary method_5693 Lnet/minecraft/class_1297;method_5693(Lnet/minecraft/class_2945$class_9222;)V
      official a Lbzm;a(Lall$a;)V
    • readCustomData

      protected void readCustomData(ReadView view)
      Specified by:
      readCustomData in class Entity
      Mappings:
      Namespace Name Mixin selector
      named readCustomData Lnet/minecraft/entity/Entity;readCustomData(Lnet/minecraft/storage/ReadView;)V
      intermediary method_5749 Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_11368;)V
      official a Lbzm;a(Lfda;)V
    • writeCustomData

      protected void writeCustomData(WriteView view)
      Specified by:
      writeCustomData in class Entity
      Mappings:
      Namespace Name Mixin selector
      named writeCustomData Lnet/minecraft/entity/Entity;writeCustomData(Lnet/minecraft/storage/WriteView;)V
      intermediary method_5652 Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_11372;)V
      official a Lbzm;a(Lfdc;)V
    • onTrackedDataSet

      public void onTrackedDataSet(TrackedData<?> data)
      Called on the client when the tracked data is set.

      This can be overridden to refresh other fields when the tracked data is set or changed.

      Specified by:
      onTrackedDataSet in interface DataTracked
      Overrides:
      onTrackedDataSet in class Entity
      Mappings:
      Namespace Name Mixin selector
      named onTrackedDataSet Lnet/minecraft/entity/data/DataTracked;onTrackedDataSet(Lnet/minecraft/entity/data/TrackedData;)V
      intermediary method_5674 Lnet/minecraft/class_9221;method_5674(Lnet/minecraft/class_2940;)V
      official a Lalk;a(Lalh;)V
    • canBeHitByProjectile

      public boolean canBeHitByProjectile()
      Overrides:
      canBeHitByProjectile in class Entity
      Mappings:
      Namespace Name Mixin selector
      named canBeHitByProjectile Lnet/minecraft/entity/Entity;canBeHitByProjectile()Z
      intermediary method_49108 Lnet/minecraft/class_1297;method_49108()Z
      official bJ Lbzm;bJ()Z
    • canHit

      public boolean canHit()
      Returns whether the entity can be hit with a projectile or be targeted by the player crosshair.
      Overrides:
      canHit in class Entity
      Returns:
      whether the entity can be hit with a projectile or be targeted by the player crosshair
      Mappings:
      Namespace Name Mixin selector
      named canHit Lnet/minecraft/entity/Entity;canHit()Z
      intermediary method_5863 Lnet/minecraft/class_1297;method_5863()Z
      official bK Lbzm;bK()Z
    • getPistonBehavior

      public PistonBehavior getPistonBehavior()
      Returns the behavior of the piston for this entity.

      This is PistonBehavior.NORMAL by default. AreaEffectCloudEntity, MarkerEntity, and marker ArmorStandEntity return PistonBehavior.IGNORE, causing the piston to not affect the entity's position. Other piston behaviors are inapplicable to entities, and treated like PistonBehavior.NORMAL.

      Overrides:
      getPistonBehavior in class Entity
      Returns:
      the behavior of the piston for this entity
      Mappings:
      Namespace Name Mixin selector
      named getPistonBehavior Lnet/minecraft/entity/Entity;getPistonBehavior()Lnet/minecraft/block/piston/PistonBehavior;
      intermediary method_5657 Lnet/minecraft/class_1297;method_5657()Lnet/minecraft/class_3619;
      official k_ Lbzm;k_()Lfaq;
    • canAvoidTraps

      public boolean canAvoidTraps()
      Returns whether the entity cannot trigger pressure plates or tripwires.

      BatEntity is the only entity in vanilla that can avoid traps.

      Overrides:
      canAvoidTraps in class Entity
      Returns:
      whether the entity cannot trigger pressure plates or tripwires
      Mappings:
      Namespace Name Mixin selector
      named canAvoidTraps Lnet/minecraft/entity/Entity;canAvoidTraps()Z
      intermediary method_5696 Lnet/minecraft/class_1297;method_5696()Z
      official n_ Lbzm;n_()Z
    • handleAttack

      public boolean handleAttack(Entity attacker)
      Handles a player attacking the entity. This is called before damage(net.minecraft.server.world.ServerWorld, net.minecraft.entity.damage.DamageSource, float) and can be used to restrict players from attacking the entity by returning true.
      Overrides:
      handleAttack in class Entity
      Returns:
      whether to stop handling the attack
      See Also:
      • invalid reference
        World#canPlayerModifyAt
      API Note:
      For example, ArmorStandEntity checks whether the player can modify blocks at the entity's position.
      Mappings:
      Namespace Name Mixin selector
      named handleAttack Lnet/minecraft/entity/Entity;handleAttack(Lnet/minecraft/entity/Entity;)Z
      intermediary method_5698 Lnet/minecraft/class_1297;method_5698(Lnet/minecraft/class_1297;)Z
      official w Lbzm;w(Lbzm;)Z
    • damage

      public final boolean damage(ServerWorld world, 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 LivingEntity.isInvulnerableTo(net.minecraft.server.world.ServerWorld, net.minecraft.entity.damage.DamageSource) and return early.

      Specified by:
      damage in class Entity
      Returns:
      whether the entity was actually damaged
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named damage Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Z
      intermediary method_64397 Lnet/minecraft/class_1297;method_64397(Lnet/minecraft/class_3218;Lnet/minecraft/class_1282;F)Z
      official a Lbzm;a(Laub;Lbyb;F)Z
    • interact

      public ActionResult interact(PlayerEntity player, Hand hand)
      Called when a player interacts with this entity.
      Overrides:
      interact in class Entity
      Parameters:
      player - the player
      hand - the hand the player used to interact with this entity
      Mappings:
      Namespace Name Mixin selector
      named interact Lnet/minecraft/entity/Entity;interact(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;
      intermediary method_5688 Lnet/minecraft/class_1297;method_5688(Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;
      official a Lbzm;a(Lcut;Lbxi;)Lbxj;
    • tick

      public void tick()
      Ticks this entity.
      Overrides:
      tick in class Entity
      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 g Lbzm;g()V
    • getLastAttacker

      @Nullable public @Nullable LivingEntity getLastAttacker()
      Specified by:
      getLastAttacker in interface Attackable
      Mappings:
      Namespace Name Mixin selector
      named getLastAttacker Lnet/minecraft/entity/Attackable;getLastAttacker()Lnet/minecraft/entity/LivingEntity;
      intermediary method_49107 Lnet/minecraft/class_8149;method_49107()Lnet/minecraft/class_1309;
      official ak Lbzf;ak()Lcam;
    • getTarget

      @Nullable public @Nullable LivingEntity getTarget()
      Specified by:
      getTarget in interface Targeter
      Mappings:
      Namespace Name Mixin selector
      named getTarget Lnet/minecraft/entity/Targeter;getTarget()Lnet/minecraft/entity/LivingEntity;
      intermediary method_5968 Lnet/minecraft/class_8152;method_5968()Lnet/minecraft/class_1309;
      official e Lcbj;e()Lcam;
    • setInteractionWidth

      private void setInteractionWidth(float width)
      Mappings:
      Namespace Name Mixin selector
      named setInteractionWidth Lnet/minecraft/entity/decoration/InteractionEntity;setInteractionWidth(F)V
      intermediary method_49109 Lnet/minecraft/class_8150;method_49109(F)V
      official a Lcag;a(F)V
    • getInteractionWidth

      private float getInteractionWidth()
      Mappings:
      Namespace Name Mixin selector
      named getInteractionWidth Lnet/minecraft/entity/decoration/InteractionEntity;getInteractionWidth()F
      intermediary method_49116 Lnet/minecraft/class_8150;method_49116()F
      official f Lcag;f()F
    • setInteractionHeight

      private void setInteractionHeight(float height)
      Mappings:
      Namespace Name Mixin selector
      named setInteractionHeight Lnet/minecraft/entity/decoration/InteractionEntity;setInteractionHeight(F)V
      intermediary method_49113 Lnet/minecraft/class_8150;method_49113(F)V
      official b Lcag;b(F)V
    • getInteractionHeight

      private float getInteractionHeight()
      Mappings:
      Namespace Name Mixin selector
      named getInteractionHeight Lnet/minecraft/entity/decoration/InteractionEntity;getInteractionHeight()F
      intermediary method_49117 Lnet/minecraft/class_8150;method_49117()F
      official i Lcag;i()F
    • setResponse

      private void setResponse(boolean response)
      Mappings:
      Namespace Name Mixin selector
      named setResponse Lnet/minecraft/entity/decoration/InteractionEntity;setResponse(Z)V
      intermediary method_49112 Lnet/minecraft/class_8150;method_49112(Z)V
      official a Lcag;a(Z)V
    • shouldRespond

      private boolean shouldRespond()
      Mappings:
      Namespace Name Mixin selector
      named shouldRespond Lnet/minecraft/entity/decoration/InteractionEntity;shouldRespond()Z
      intermediary method_49118 Lnet/minecraft/class_8150;method_49118()Z
      official l Lcag;l()Z
    • getDimensions

      private EntityDimensions getDimensions()
      Mappings:
      Namespace Name Mixin selector
      named getDimensions Lnet/minecraft/entity/decoration/InteractionEntity;getDimensions()Lnet/minecraft/entity/EntityDimensions;
      intermediary method_49119 Lnet/minecraft/class_8150;method_49119()Lnet/minecraft/class_4048;
      official m Lcag;m()Lbzp;
    • getDimensions

      public EntityDimensions getDimensions(EntityPose pose)
      Returns the dimensions of the entity with the given pose.
      Overrides:
      getDimensions in class Entity
      Returns:
      the dimensions of the entity with the given pose
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getDimensions Lnet/minecraft/entity/Entity;getDimensions(Lnet/minecraft/entity/EntityPose;)Lnet/minecraft/entity/EntityDimensions;
      intermediary method_18377 Lnet/minecraft/class_1297;method_18377(Lnet/minecraft/class_4050;)Lnet/minecraft/class_4048;
      official a Lbzm;a(Lcay;)Lbzp;
    • calculateDefaultBoundingBox

      protected Box calculateDefaultBoundingBox(Vec3d pos)
      Overrides:
      calculateDefaultBoundingBox in class Entity
      Mappings:
      Namespace Name Mixin selector
      named calculateDefaultBoundingBox Lnet/minecraft/entity/Entity;calculateDefaultBoundingBox(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Box;
      intermediary method_65341 Lnet/minecraft/class_1297;method_65341(Lnet/minecraft/class_243;)Lnet/minecraft/class_238;
      official c Lbzm;c(Lfis;)Lfin;