Class ShulkerBulletEntity

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

public class ShulkerBulletEntity extends ProjectileEntity
Mappings:
Namespace Name
named net/minecraft/entity/projectile/ShulkerBulletEntity
intermediary net/minecraft/class_1678
official cqs
  • Field Details

    • field_30666

      private static final double field_30666
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30666 Lnet/minecraft/entity/projectile/ShulkerBulletEntity;field_30666:D
      intermediary field_30666 Lnet/minecraft/class_1678;field_30666:D
      official a Lcqs;a:D
    • target

      @Nullable private @Nullable Entity target
      Mappings:
      Namespace Name Mixin selector
      named target Lnet/minecraft/entity/projectile/ShulkerBulletEntity;target:Lnet/minecraft/entity/Entity;
      intermediary field_7626 Lnet/minecraft/class_1678;field_7626:Lnet/minecraft/class_1297;
      official b Lcqs;b:Lbvj;
    • direction

      @Nullable private @Nullable Direction direction
      Mappings:
      Namespace Name Mixin selector
      named direction Lnet/minecraft/entity/projectile/ShulkerBulletEntity;direction:Lnet/minecraft/util/math/Direction;
      intermediary field_7628 Lnet/minecraft/class_1678;field_7628:Lnet/minecraft/class_2350;
      official c Lcqs;c:Ljm;
    • stepCount

      private int stepCount
      Mappings:
      Namespace Name Mixin selector
      named stepCount Lnet/minecraft/entity/projectile/ShulkerBulletEntity;stepCount:I
      intermediary field_7627 Lnet/minecraft/class_1678;field_7627:I
      official d Lcqs;d:I
    • targetX

      private double targetX
      Mappings:
      Namespace Name Mixin selector
      named targetX Lnet/minecraft/entity/projectile/ShulkerBulletEntity;targetX:D
      intermediary field_7635 Lnet/minecraft/class_1678;field_7635:D
      official e Lcqs;e:D
    • targetY

      private double targetY
      Mappings:
      Namespace Name Mixin selector
      named targetY Lnet/minecraft/entity/projectile/ShulkerBulletEntity;targetY:D
      intermediary field_7633 Lnet/minecraft/class_1678;field_7633:D
      official f Lcqs;f:D
    • targetZ

      private double targetZ
      Mappings:
      Namespace Name Mixin selector
      named targetZ Lnet/minecraft/entity/projectile/ShulkerBulletEntity;targetZ:D
      intermediary field_7625 Lnet/minecraft/class_1678;field_7625:D
      official g Lcqs;g:D
    • targetUuid

      @Nullable private @Nullable UUID targetUuid
      Mappings:
      Namespace Name Mixin selector
      named targetUuid Lnet/minecraft/entity/projectile/ShulkerBulletEntity;targetUuid:Ljava/util/UUID;
      intermediary field_7632 Lnet/minecraft/class_1678;field_7632:Ljava/util/UUID;
      official h Lcqs;h:Ljava/util/UUID;
  • Constructor Details

    • ShulkerBulletEntity

      public ShulkerBulletEntity(EntityType<? extends ShulkerBulletEntity> 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> Lbvj;<init>(Lbvq;Ldhh;)V
    • ShulkerBulletEntity

      public ShulkerBulletEntity(World world, LivingEntity owner, Entity target, Direction.Axis axis)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/projectile/ShulkerBulletEntity;<init>(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Direction$Axis;)V
      intermediary <init> Lnet/minecraft/class_1678;<init>(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;Lnet/minecraft/class_2350$class_2351;)V
      official <init> Lcqs;<init>(Ldhh;Lbwf;Lbvj;Ljm$a;)V
  • Method Details

    • getSoundCategory

      public SoundCategory getSoundCategory()
      Returns the sound category for sounds from this entity.

      This is used by Entity.playSound(SoundEvent, float, float) and defaults to SoundCategory.NEUTRAL. Hostile entities should override this to return SoundCategory.HOSTILE.

      Overrides:
      getSoundCategory in class Entity
      Returns:
      the sound category for sounds from this entity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getSoundCategory Lnet/minecraft/entity/Entity;getSoundCategory()Lnet/minecraft/sound/SoundCategory;
      intermediary method_5634 Lnet/minecraft/class_1297;method_5634()Lnet/minecraft/class_3419;
      official dn Lbvj;dn()Laxg;
    • 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 ProjectileEntity
      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 Lbvj;b(Lux;)V
    • 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 ProjectileEntity
      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 Lbvj;a(Lux;)V
    • 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 Lbvj;a(Lalg$a;)V
    • getDirection

      @Nullable private @Nullable Direction getDirection()
      Mappings:
      Namespace Name Mixin selector
      named getDirection Lnet/minecraft/entity/projectile/ShulkerBulletEntity;getDirection()Lnet/minecraft/util/math/Direction;
      intermediary method_35208 Lnet/minecraft/class_1678;method_35208()Lnet/minecraft/class_2350;
      official l Lcqs;l()Ljm;
    • setDirection

      private void setDirection(@Nullable @Nullable Direction direction)
      Mappings:
      Namespace Name Mixin selector
      named setDirection Lnet/minecraft/entity/projectile/ShulkerBulletEntity;setDirection(Lnet/minecraft/util/math/Direction;)V
      intermediary method_7487 Lnet/minecraft/class_1678;method_7487(Lnet/minecraft/class_2350;)V
      official a Lcqs;a(Ljm;)V
    • changeTargetDirection

      private void changeTargetDirection(@Nullable Direction.Axis axis)
      Mappings:
      Namespace Name Mixin selector
      named changeTargetDirection Lnet/minecraft/entity/projectile/ShulkerBulletEntity;changeTargetDirection(Lnet/minecraft/util/math/Direction$Axis;)V
      intermediary method_7486 Lnet/minecraft/class_1678;method_7486(Lnet/minecraft/class_2350$class_2351;)V
      official a Lcqs;a(Ljm$a;)V
    • checkDespawn

      public void checkDespawn()
      Checks whether the entity should be despawned.

      To despawn this entity, call Entity.discard().

      Overrides:
      checkDespawn in class Entity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named checkDespawn Lnet/minecraft/entity/Entity;checkDespawn()V
      intermediary method_5982 Lnet/minecraft/class_1297;method_5982()V
      official dI Lbvj;dI()V
    • getGravity

      protected double getGravity()
      Overrides:
      getGravity in class Entity
      Mappings:
      Namespace Name Mixin selector
      named getGravity Lnet/minecraft/entity/Entity;getGravity()D
      intermediary method_7490 Lnet/minecraft/class_1297;method_7490()D
      official bd Lbvj;bd()D
    • tick

      public void tick()
      Ticks this entity.
      Overrides:
      tick in class ProjectileEntity
      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 h Lbvj;h()V
    • canHit

      protected boolean canHit(Entity entity)
      Overrides:
      canHit in class ProjectileEntity
      Mappings:
      Namespace Name Mixin selector
      named canHit Lnet/minecraft/entity/projectile/ProjectileEntity;canHit(Lnet/minecraft/entity/Entity;)Z
      intermediary method_26958 Lnet/minecraft/class_1676;method_26958(Lnet/minecraft/class_1297;)Z
      official b Lcqp;b(Lbvj;)Z
    • isOnFire

      public boolean isOnFire()
      Returns whether the entity is on fire and is not fire immune.
      Overrides:
      isOnFire in class Entity
      Returns:
      whether the entity is on fire and is not fire immune
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named isOnFire Lnet/minecraft/entity/Entity;isOnFire()Z
      intermediary method_5809 Lnet/minecraft/class_1297;method_5809()Z
      official bY Lbvj;bY()Z
    • shouldRender

      public boolean shouldRender(double distance)
      Overrides:
      shouldRender in class Entity
      Mappings:
      Namespace Name Mixin selector
      named shouldRender Lnet/minecraft/entity/Entity;shouldRender(D)Z
      intermediary method_5640 Lnet/minecraft/class_1297;method_5640(D)Z
      official a Lbvj;a(D)Z
    • getBrightnessAtEyes

      public float getBrightnessAtEyes()
      Overrides:
      getBrightnessAtEyes in class Entity
      Mappings:
      Namespace Name Mixin selector
      named getBrightnessAtEyes Lnet/minecraft/entity/Entity;getBrightnessAtEyes()F
      intermediary method_5718 Lnet/minecraft/class_1297;method_5718()F
      official by Lbvj;by()F
    • onEntityHit

      protected void onEntityHit(EntityHitResult entityHitResult)
      Overrides:
      onEntityHit in class ProjectileEntity
      Mappings:
      Namespace Name Mixin selector
      named onEntityHit Lnet/minecraft/entity/projectile/ProjectileEntity;onEntityHit(Lnet/minecraft/util/hit/EntityHitResult;)V
      intermediary method_7454 Lnet/minecraft/class_1676;method_7454(Lnet/minecraft/class_3966;)V
      official a Lcqp;a(Lfbu;)V
    • onBlockHit

      protected void onBlockHit(BlockHitResult blockHitResult)
      Overrides:
      onBlockHit in class ProjectileEntity
      Mappings:
      Namespace Name Mixin selector
      named onBlockHit Lnet/minecraft/entity/projectile/ProjectileEntity;onBlockHit(Lnet/minecraft/util/hit/BlockHitResult;)V
      intermediary method_24920 Lnet/minecraft/class_1676;method_24920(Lnet/minecraft/class_3965;)V
      official a Lcqp;a(Lfbt;)V
    • destroy

      private void destroy()
      Mappings:
      Namespace Name Mixin selector
      named destroy Lnet/minecraft/entity/projectile/ShulkerBulletEntity;destroy()V
      intermediary method_49723 Lnet/minecraft/class_1678;method_49723()V
      official m Lcqs;m()V
    • onCollision

      protected void onCollision(HitResult hitResult)
      Overrides:
      onCollision in class ProjectileEntity
      Mappings:
      Namespace Name Mixin selector
      named onCollision Lnet/minecraft/entity/projectile/ProjectileEntity;onCollision(Lnet/minecraft/util/hit/HitResult;)V
      intermediary method_7488 Lnet/minecraft/class_1676;method_7488(Lnet/minecraft/class_239;)V
      official a Lcqp;a(Lfbv;)V
    • 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 ProjectileEntity
      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 bH Lbvj;bH()Z
    • clientDamage

      public boolean clientDamage(DamageSource source)
      Overrides:
      clientDamage in class Entity
      Mappings:
      Namespace Name Mixin selector
      named clientDamage Lnet/minecraft/entity/Entity;clientDamage(Lnet/minecraft/entity/damage/DamageSource;)Z
      intermediary method_5643 Lnet/minecraft/class_1297;method_5643(Lnet/minecraft/class_1282;)Z
      official b Lbvj;b(Lbtz;)Z
    • damage

      public 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

      invalid reference
      #isInvulnerableTo
      and return early.
      Overrides:
      damage in class ProjectileEntity
      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 Lbvj;a(Lash;Lbtz;F)Z
    • onSpawnPacket

      public void onSpawnPacket(EntitySpawnS2CPacket packet)
      Called on the client when the entity receives a spawn packet.

      This sets the entity's position, angles, ID, and UUID. Subclasses can override this to initialize additional fields.

      Overrides:
      onSpawnPacket in class ProjectileEntity
      Mappings:
      Namespace Name Mixin selector
      named onSpawnPacket Lnet/minecraft/entity/Entity;onSpawnPacket(Lnet/minecraft/network/packet/s2c/play/EntitySpawnS2CPacket;)V
      intermediary method_31471 Lnet/minecraft/class_1297;method_31471(Lnet/minecraft/class_2604;)V
      official a Lbvj;a(Lacs;)V