Class PigEntity

All Implemented Interfaces:
Attackable, DataTracked, EquipmentHolder, ItemSteerable, Saddleable, Targeter, ScoreHolder, CommandOutput, Nameable, EntityLike

public class PigEntity extends AnimalEntity implements ItemSteerable, Saddleable
Mappings:
Namespace Name
named net/minecraft/entity/passive/PigEntity
intermediary net/minecraft/class_1452
official cfy
  • Field Details

    • SADDLED

      private static final TrackedData<Boolean> SADDLED
      Mappings:
      Namespace Name Mixin selector
      named SADDLED Lnet/minecraft/entity/passive/PigEntity;SADDLED:Lnet/minecraft/entity/data/TrackedData;
      intermediary field_6816 Lnet/minecraft/class_1452;field_6816:Lnet/minecraft/class_2940;
      official bY Lcfy;bY:Lakk;
    • BOOST_TIME

      private static final TrackedData<Integer> BOOST_TIME
      Mappings:
      Namespace Name Mixin selector
      named BOOST_TIME Lnet/minecraft/entity/passive/PigEntity;BOOST_TIME:Lnet/minecraft/entity/data/TrackedData;
      intermediary field_6815 Lnet/minecraft/class_1452;field_6815:Lnet/minecraft/class_2940;
      official bZ Lcfy;bZ:Lakk;
    • saddledComponent

      private final SaddledComponent saddledComponent
      Mappings:
      Namespace Name Mixin selector
      named saddledComponent Lnet/minecraft/entity/passive/PigEntity;saddledComponent:Lnet/minecraft/entity/SaddledComponent;
      intermediary field_23230 Lnet/minecraft/class_1452;field_23230:Lnet/minecraft/class_4980;
      official cb Lcfy;cb:Lbtn;
  • Constructor Details

    • PigEntity

      public PigEntity(EntityType<? extends PigEntity> 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> Lbsw;<init>(Lbtc;Ldca;)V
  • Method Details

    • initGoals

      protected void initGoals()
      Overrides:
      initGoals in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      named initGoals Lnet/minecraft/entity/mob/MobEntity;initGoals()V
      intermediary method_5959 Lnet/minecraft/class_1308;method_5959()V
      official z Lbtt;z()V
    • createPigAttributes

      public static DefaultAttributeContainer.Builder createPigAttributes()
      Mappings:
      Namespace Name Mixin selector
      named createPigAttributes Lnet/minecraft/entity/passive/PigEntity;createPigAttributes()Lnet/minecraft/entity/attribute/DefaultAttributeContainer$Builder;
      intermediary method_26890 Lnet/minecraft/class_1452;method_26890()Lnet/minecraft/class_5132$class_5133;
      official s Lcfy;s()Lbuy$a;
    • getControllingPassenger

      @Nullable public @Nullable LivingEntity getControllingPassenger()
      Returns the passenger in control of this entity, or null if there is none.

      Rideable entities should override this to return the entity. This is usually #getFirstPassenger.

      Overrides:
      getControllingPassenger in class MobEntity
      Returns:
      the passenger in control of this entity, or null if there is none
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getControllingPassenger Lnet/minecraft/entity/Entity;getControllingPassenger()Lnet/minecraft/entity/LivingEntity;
      intermediary method_5642 Lnet/minecraft/class_1297;method_5642()Lnet/minecraft/class_1309;
      official cQ Lbsw;cQ()Lbtr;
    • onTrackedDataSet

      public void onTrackedDataSet(TrackedData<?> data)
      Specified by:
      onTrackedDataSet in interface DataTracked
      Overrides:
      onTrackedDataSet in class PassiveEntity
      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 Lakn;a(Lakk;)V
    • initDataTracker

      protected void initDataTracker(DataTracker.Builder builder)
      Initializes data tracker.
      Overrides:
      initDataTracker in class PassiveEntity
      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 Lbsw;a(Lako$a;)V
    • writeCustomDataToNbt

      public 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 AnimalEntity
      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 Lbsw;b(Lus;)V
    • readCustomDataFromNbt

      public 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 AnimalEntity
      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 Lbsw;a(Lus;)V
    • getAmbientSound

      protected SoundEvent getAmbientSound()
      Overrides:
      getAmbientSound in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      named getAmbientSound Lnet/minecraft/entity/mob/MobEntity;getAmbientSound()Lnet/minecraft/sound/SoundEvent;
      intermediary method_5994 Lnet/minecraft/class_1308;method_5994()Lnet/minecraft/class_3414;
      official v Lbtt;v()Lavz;
    • getHurtSound

      protected SoundEvent getHurtSound(DamageSource source)
      Overrides:
      getHurtSound in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named getHurtSound Lnet/minecraft/entity/LivingEntity;getHurtSound(Lnet/minecraft/entity/damage/DamageSource;)Lnet/minecraft/sound/SoundEvent;
      intermediary method_6011 Lnet/minecraft/class_1309;method_6011(Lnet/minecraft/class_1282;)Lnet/minecraft/class_3414;
      official d Lbtr;d(Lbrp;)Lavz;
    • getDeathSound

      protected SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named getDeathSound Lnet/minecraft/entity/LivingEntity;getDeathSound()Lnet/minecraft/sound/SoundEvent;
      intermediary method_6002 Lnet/minecraft/class_1309;method_6002()Lnet/minecraft/class_3414;
      official o_ Lbtr;o_()Lavz;
    • playStepSound

      protected void playStepSound(BlockPos pos, BlockState state)
      Overrides:
      playStepSound in class Entity
      Mappings:
      Namespace Name Mixin selector
      named playStepSound Lnet/minecraft/entity/Entity;playStepSound(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
      intermediary method_5712 Lnet/minecraft/class_1297;method_5712(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      official b Lbsw;b(Liz;Ldse;)V
    • interactMob

      public ActionResult interactMob(PlayerEntity player, Hand hand)
      Overrides:
      interactMob in class AnimalEntity
      Mappings:
      Namespace Name Mixin selector
      named interactMob Lnet/minecraft/entity/mob/MobEntity;interactMob(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;
      intermediary method_5992 Lnet/minecraft/class_1308;method_5992(Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;
      official b Lbtt;b(Lcmz;Lbqv;)Lbqw;
    • canBeSaddled

      public boolean canBeSaddled()
      Specified by:
      canBeSaddled in interface Saddleable
      Mappings:
      Namespace Name Mixin selector
      named canBeSaddled Lnet/minecraft/entity/Saddleable;canBeSaddled()Z
      intermediary method_6765 Lnet/minecraft/class_5146;method_6765()Z
      official f Lbuh;f()Z
    • dropInventory

      protected void dropInventory()
      Overrides:
      dropInventory in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named dropInventory Lnet/minecraft/entity/LivingEntity;dropInventory()V
      intermediary method_16078 Lnet/minecraft/class_1309;method_16078()V
      official eD Lbtr;eD()V
    • isSaddled

      public boolean isSaddled()
      Specified by:
      isSaddled in interface Saddleable
      Mappings:
      Namespace Name Mixin selector
      named isSaddled Lnet/minecraft/entity/Saddleable;isSaddled()Z
      intermediary method_6725 Lnet/minecraft/class_5146;method_6725()Z
      official i Lbuh;i()Z
    • saddle

      public void saddle(@Nullable @Nullable SoundCategory sound)
      Specified by:
      saddle in interface Saddleable
      Mappings:
      Namespace Name Mixin selector
      named saddle Lnet/minecraft/entity/Saddleable;saddle(Lnet/minecraft/sound/SoundCategory;)V
      intermediary method_6576 Lnet/minecraft/class_5146;method_6576(Lnet/minecraft/class_3419;)V
      official a Lbuh;a(Lawb;)V
    • updatePassengerForDismount

      public Vec3d updatePassengerForDismount(LivingEntity passenger)
      Returns the position of the dismounted passenger.

      Vehicles should override this to return a suitable dismounting position for the passenger. Check the implementation of the subclass for details.

      Overrides:
      updatePassengerForDismount in class Entity
      Returns:
      the position of the dismounted passenger
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named updatePassengerForDismount Lnet/minecraft/entity/Entity;updatePassengerForDismount(Lnet/minecraft/entity/LivingEntity;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_24829 Lnet/minecraft/class_1297;method_24829(Lnet/minecraft/class_1309;)Lnet/minecraft/class_243;
      official b Lbsw;b(Lbtr;)Levt;
    • onStruckByLightning

      public void onStruckByLightning(ServerWorld world, LightningEntity lightning)
      Called when the entity is struck by lightning. This sets the entity on fire and deals lightning damage by default; entities that do not take such damage should override this method to do nothing.
      Overrides:
      onStruckByLightning in class Entity
      Mappings:
      Namespace Name Mixin selector
      named onStruckByLightning Lnet/minecraft/entity/Entity;onStruckByLightning(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LightningEntity;)V
      intermediary method_5800 Lnet/minecraft/class_1297;method_5800(Lnet/minecraft/class_3218;Lnet/minecraft/class_1538;)V
      official a Lbsw;a(Larf;Lbtq;)V
    • tickControlled

      protected void tickControlled(PlayerEntity controllingPlayer, Vec3d movementInput)
      Overrides:
      tickControlled in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named tickControlled Lnet/minecraft/entity/LivingEntity;tickControlled(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/Vec3d;)V
      intermediary method_49481 Lnet/minecraft/class_1309;method_49481(Lnet/minecraft/class_1657;Lnet/minecraft/class_243;)V
      official a Lbtr;a(Lcmz;Levt;)V
    • getControlledMovementInput

      protected Vec3d getControlledMovementInput(PlayerEntity controllingPlayer, Vec3d movementInput)
      Overrides:
      getControlledMovementInput in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named getControlledMovementInput Lnet/minecraft/entity/LivingEntity;getControlledMovementInput(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_49482 Lnet/minecraft/class_1309;method_49482(Lnet/minecraft/class_1657;Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official b Lbtr;b(Lcmz;Levt;)Levt;
    • getSaddledSpeed

      protected float getSaddledSpeed(PlayerEntity controllingPlayer)
      Overrides:
      getSaddledSpeed in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named getSaddledSpeed Lnet/minecraft/entity/LivingEntity;getSaddledSpeed(Lnet/minecraft/entity/player/PlayerEntity;)F
      intermediary method_49485 Lnet/minecraft/class_1309;method_49485(Lnet/minecraft/class_1657;)F
      official e Lbtr;e(Lcmz;)F
    • consumeOnAStickItem

      public boolean consumeOnAStickItem()
      Specified by:
      consumeOnAStickItem in interface ItemSteerable
      Mappings:
      Namespace Name Mixin selector
      named consumeOnAStickItem Lnet/minecraft/entity/ItemSteerable;consumeOnAStickItem()Z
      intermediary method_6577 Lnet/minecraft/class_4981;method_6577()Z
      official a Lbto;a()Z
    • createChild

      @Nullable public @Nullable PigEntity createChild(ServerWorld serverWorld, PassiveEntity passiveEntity)
      Specified by:
      createChild in class PassiveEntity
      Mappings:
      Namespace Name Mixin selector
      named createChild Lnet/minecraft/entity/passive/PigEntity;createChild(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/passive/PassiveEntity;)Lnet/minecraft/entity/passive/PigEntity;
      intermediary method_6574 Lnet/minecraft/class_1452;method_6574(Lnet/minecraft/class_3218;Lnet/minecraft/class_1296;)Lnet/minecraft/class_1452;
      official b Lcfy;b(Larf;Lbsq;)Lcfy;
    • isBreedingItem

      public boolean isBreedingItem(ItemStack stack)
      Specified by:
      isBreedingItem in class AnimalEntity
      Mappings:
      Namespace Name Mixin selector
      named isBreedingItem Lnet/minecraft/entity/passive/AnimalEntity;isBreedingItem(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_6481 Lnet/minecraft/class_1429;method_6481(Lnet/minecraft/class_1799;)Z
      official o Lcfh;o(Lcur;)Z
    • getLeashOffset

      public Vec3d getLeashOffset()
      Returns the offset from the entity's position where the leash is attached to.

      This is different from Entity.getLeashPos(float); this method is called on the entity which a leash is attached to.

      Overrides:
      getLeashOffset in class Entity
      Returns:
      the offset from the entity's position where the leash is attached to
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getLeashOffset Lnet/minecraft/entity/Entity;getLeashOffset()Lnet/minecraft/util/math/Vec3d;
      intermediary method_29919 Lnet/minecraft/class_1297;method_29919()Lnet/minecraft/class_243;
      official cM Lbsw;cM()Levt;