Class MerchantEntity

All Implemented Interfaces:
Attackable, DataTracked, EquipmentHolder, InventoryOwner, Leashable, Npc, Targeter, ScoreHolder, Nameable, Merchant, EntityLike
Direct Known Subclasses:
VillagerEntity, WanderingTraderEntity

public abstract class MerchantEntity extends PassiveEntity implements InventoryOwner, Npc, Merchant
Mappings:
Namespace Name
named net/minecraft/entity/passive/MerchantEntity
intermediary net/minecraft/class_3988
official cpd
  • Field Details

    • HEAD_ROLLING_TIME_LEFT

      private static final TrackedData<Integer> HEAD_ROLLING_TIME_LEFT
      Mappings:
      Namespace Name Mixin selector
      named HEAD_ROLLING_TIME_LEFT Lnet/minecraft/entity/passive/MerchantEntity;HEAD_ROLLING_TIME_LEFT:Lnet/minecraft/entity/data/TrackedData;
      intermediary field_19295 Lnet/minecraft/class_3988;field_19295:Lnet/minecraft/class_2940;
      official cb Lcpd;cb:Lalc;
    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/entity/passive/MerchantEntity;LOGGER:Lorg/slf4j/Logger;
      intermediary field_48833 Lnet/minecraft/class_3988;field_48833:Lorg/slf4j/Logger;
      official cc Lcpd;cc:Lorg/slf4j/Logger;
    • field_30599

      public static final int field_30599
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_30599 Lnet/minecraft/entity/passive/MerchantEntity;field_30599:I
      intermediary field_30599 Lnet/minecraft/class_3988;field_30599:I
      official bZ Lcpd;bZ:I
    • INVENTORY_SIZE

      private static final int INVENTORY_SIZE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named INVENTORY_SIZE Lnet/minecraft/entity/passive/MerchantEntity;INVENTORY_SIZE:I
      intermediary field_30600 Lnet/minecraft/class_3988;field_30600:I
      official cd Lcpd;cd:I
    • customer

      @Nullable private @Nullable PlayerEntity customer
      Mappings:
      Namespace Name Mixin selector
      named customer Lnet/minecraft/entity/passive/MerchantEntity;customer:Lnet/minecraft/entity/player/PlayerEntity;
      intermediary field_17722 Lnet/minecraft/class_3988;field_17722:Lnet/minecraft/class_1657;
      official ce Lcpd;ce:Lcpw;
    • offers

      Mappings:
      Namespace Name Mixin selector
      named offers Lnet/minecraft/entity/passive/MerchantEntity;offers:Lnet/minecraft/village/TradeOfferList;
      intermediary field_17721 Lnet/minecraft/class_3988;field_17721:Lnet/minecraft/class_1916;
      official ca Lcpd;ca:Ldgf;
    • inventory

      private final SimpleInventory inventory
      Mappings:
      Namespace Name Mixin selector
      named inventory Lnet/minecraft/entity/passive/MerchantEntity;inventory:Lnet/minecraft/inventory/SimpleInventory;
      intermediary field_17723 Lnet/minecraft/class_3988;field_17723:Lnet/minecraft/class_1277;
      official cf Lcpd;cf:Lbtp;
  • Constructor Details

    • MerchantEntity

      public MerchantEntity(EntityType<? extends MerchantEntity> 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
  • Method Details

    • initialize

      public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable @Nullable EntityData entityData)
      Overrides:
      initialize in class PassiveEntity
      Mappings:
      Namespace Name Mixin selector
      named initialize Lnet/minecraft/entity/mob/MobEntity;initialize(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;)Lnet/minecraft/entity/EntityData;
      intermediary method_5943 Lnet/minecraft/class_1308;method_5943(Lnet/minecraft/class_5425;Lnet/minecraft/class_1266;Lnet/minecraft/class_3730;Lnet/minecraft/class_1315;)Lnet/minecraft/class_1315;
      official a Lbwh;a(Ldhy;Lbtg;Lbvp;Lbwy;)Lbwy;
    • getHeadRollingTimeLeft

      public int getHeadRollingTimeLeft()
      Mappings:
      Namespace Name Mixin selector
      named getHeadRollingTimeLeft Lnet/minecraft/entity/passive/MerchantEntity;getHeadRollingTimeLeft()I
      intermediary method_20506 Lnet/minecraft/class_3988;method_20506()I
      official p Lcpd;p()I
    • setHeadRollingTimeLeft

      public void setHeadRollingTimeLeft(int ticks)
      Mappings:
      Namespace Name Mixin selector
      named setHeadRollingTimeLeft Lnet/minecraft/entity/passive/MerchantEntity;setHeadRollingTimeLeft(I)V
      intermediary method_20507 Lnet/minecraft/class_3988;method_20507(I)V
      official r Lcpd;r(I)V
    • getExperience

      public int getExperience()
      Specified by:
      getExperience in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named getExperience Lnet/minecraft/village/Merchant;getExperience()I
      intermediary method_19269 Lnet/minecraft/class_1915;method_19269()I
      official x Ldgd;x()I
    • 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 Lbvj;a(Lalg$a;)V
    • setCustomer

      public void setCustomer(@Nullable @Nullable PlayerEntity customer)
      Specified by:
      setCustomer in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named setCustomer Lnet/minecraft/village/Merchant;setCustomer(Lnet/minecraft/entity/player/PlayerEntity;)V
      intermediary method_8259 Lnet/minecraft/class_1915;method_8259(Lnet/minecraft/class_1657;)V
      official a Ldgd;a(Lcpw;)V
    • getCustomer

      @Nullable public @Nullable PlayerEntity getCustomer()
      Specified by:
      getCustomer in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named getCustomer Lnet/minecraft/village/Merchant;getCustomer()Lnet/minecraft/entity/player/PlayerEntity;
      intermediary method_8257 Lnet/minecraft/class_1915;method_8257()Lnet/minecraft/class_1657;
      official go Ldgd;go()Lcpw;
    • hasCustomer

      public boolean hasCustomer()
      Mappings:
      Namespace Name Mixin selector
      named hasCustomer Lnet/minecraft/entity/passive/MerchantEntity;hasCustomer()Z
      intermediary method_18009 Lnet/minecraft/class_3988;method_18009()Z
      official gp Lcpd;gp()Z
    • getOffers

      public TradeOfferList getOffers()
      Specified by:
      getOffers in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named getOffers Lnet/minecraft/village/Merchant;getOffers()Lnet/minecraft/village/TradeOfferList;
      intermediary method_8264 Lnet/minecraft/class_1915;method_8264()Lnet/minecraft/class_1916;
      official gq Ldgd;gq()Ldgf;
    • setOffersFromServer

      public void setOffersFromServer(@Nullable @Nullable TradeOfferList offers)
      Specified by:
      setOffersFromServer in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named setOffersFromServer Lnet/minecraft/village/Merchant;setOffersFromServer(Lnet/minecraft/village/TradeOfferList;)V
      intermediary method_8261 Lnet/minecraft/class_1915;method_8261(Lnet/minecraft/class_1916;)V
      official a Ldgd;a(Ldgf;)V
    • setExperienceFromServer

      public void setExperienceFromServer(int experience)
      Specified by:
      setExperienceFromServer in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named setExperienceFromServer Lnet/minecraft/village/Merchant;setExperienceFromServer(I)V
      intermediary method_19271 Lnet/minecraft/class_1915;method_19271(I)V
      official s Ldgd;s(I)V
    • trade

      public void trade(TradeOffer offer)
      Specified by:
      trade in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named trade Lnet/minecraft/village/Merchant;trade(Lnet/minecraft/village/TradeOffer;)V
      intermediary method_8262 Lnet/minecraft/class_1915;method_8262(Lnet/minecraft/class_1914;)V
      official a Ldgd;a(Ldge;)V
    • afterUsing

      protected abstract void afterUsing(TradeOffer offer)
      Mappings:
      Namespace Name Mixin selector
      named afterUsing Lnet/minecraft/entity/passive/MerchantEntity;afterUsing(Lnet/minecraft/village/TradeOffer;)V
      intermediary method_18008 Lnet/minecraft/class_3988;method_18008(Lnet/minecraft/class_1914;)V
      official b Lcpd;b(Ldge;)V
    • isLeveledMerchant

      public boolean isLeveledMerchant()
      Specified by:
      isLeveledMerchant in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named isLeveledMerchant Lnet/minecraft/village/Merchant;isLeveledMerchant()Z
      intermediary method_19270 Lnet/minecraft/class_1915;method_19270()Z
      official gr Ldgd;gr()Z
    • onSellingItem

      public void onSellingItem(ItemStack stack)
      Specified by:
      onSellingItem in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named onSellingItem Lnet/minecraft/village/Merchant;onSellingItem(Lnet/minecraft/item/ItemStack;)V
      intermediary method_8258 Lnet/minecraft/class_1915;method_8258(Lnet/minecraft/class_1799;)V
      official i Ldgd;i(Lcxo;)V
    • getYesSound

      public SoundEvent getYesSound()
      Specified by:
      getYesSound in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named getYesSound Lnet/minecraft/village/Merchant;getYesSound()Lnet/minecraft/sound/SoundEvent;
      intermediary method_18010 Lnet/minecraft/class_1915;method_18010()Lnet/minecraft/class_3414;
      official gs Ldgd;gs()Laxe;
    • getTradingSound

      protected SoundEvent getTradingSound(boolean sold)
      Mappings:
      Namespace Name Mixin selector
      named getTradingSound Lnet/minecraft/entity/passive/MerchantEntity;getTradingSound(Z)Lnet/minecraft/sound/SoundEvent;
      intermediary method_18012 Lnet/minecraft/class_3988;method_18012(Z)Lnet/minecraft/class_3414;
      official x Lcpd;x(Z)Laxe;
    • playCelebrateSound

      public void playCelebrateSound()
      Mappings:
      Namespace Name Mixin selector
      named playCelebrateSound Lnet/minecraft/entity/passive/MerchantEntity;playCelebrateSound()V
      intermediary method_20010 Lnet/minecraft/class_3988;method_20010()V
      official gt Lcpd;gt()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 PassiveEntity
      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

      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 PassiveEntity
      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
    • teleportTo

      @Nullable public @Nullable Entity teleportTo(TeleportTarget teleportTarget)
      Teleports this entity to another location, potentially in another world.

      Note if teleported to a different world, entities (excluding server player entities) are completely recreated at the destination.

      Overrides:
      teleportTo in class Entity
      Returns:
      the entity after teleporting
      Mappings:
      Namespace Name Mixin selector
      named teleportTo Lnet/minecraft/entity/Entity;teleportTo(Lnet/minecraft/world/TeleportTarget;)Lnet/minecraft/entity/Entity;
      intermediary method_5731 Lnet/minecraft/class_1297;method_5731(Lnet/minecraft/class_5454;)Lnet/minecraft/class_1297;
      official b Lbvj;b(Leuw;)Lbvj;
    • resetCustomer

      protected void resetCustomer()
      Mappings:
      Namespace Name Mixin selector
      named resetCustomer Lnet/minecraft/entity/passive/MerchantEntity;resetCustomer()V
      intermediary method_19181 Lnet/minecraft/class_3988;method_19181()V
      official gu Lcpd;gu()V
    • onDeath

      public void onDeath(DamageSource damageSource)
      Overrides:
      onDeath in class LivingEntity
      Mappings:
      Namespace Name Mixin selector
      named onDeath Lnet/minecraft/entity/LivingEntity;onDeath(Lnet/minecraft/entity/damage/DamageSource;)V
      intermediary method_6078 Lnet/minecraft/class_1309;method_6078(Lnet/minecraft/class_1282;)V
      official a Lbwf;a(Lbtz;)V
    • produceParticles

      protected void produceParticles(ParticleEffect parameters)
      Mappings:
      Namespace Name Mixin selector
      named produceParticles Lnet/minecraft/entity/passive/MerchantEntity;produceParticles(Lnet/minecraft/particle/ParticleEffect;)V
      intermediary method_18007 Lnet/minecraft/class_3988;method_18007(Lnet/minecraft/class_2394;)V
      official a Lcpd;a(Llq;)V
    • canBeLeashed

      public boolean canBeLeashed()
      Specified by:
      canBeLeashed in interface Leashable
      Overrides:
      canBeLeashed in class MobEntity
      Mappings:
      Namespace Name Mixin selector
      named canBeLeashed Lnet/minecraft/entity/Leashable;canBeLeashed()Z
      intermediary method_5931 Lnet/minecraft/class_9817;method_5931()Z
      official y Lbwd;y()Z
    • getInventory

      public SimpleInventory getInventory()
      Specified by:
      getInventory in interface InventoryOwner
      Mappings:
      Namespace Name Mixin selector
      named getInventory Lnet/minecraft/entity/InventoryOwner;getInventory()Lnet/minecraft/inventory/SimpleInventory;
      intermediary method_35199 Lnet/minecraft/class_6067;method_35199()Lnet/minecraft/class_1277;
      official t Lcpg;t()Lbtp;
    • getStackReference

      public StackReference getStackReference(int mappedIndex)
      Obtains a stack reference to be modified. Used by commands like /loot or /item.
      Overrides:
      getStackReference in class LivingEntity
      Parameters:
      mappedIndex - the mapped index as given by the item slot argument
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getStackReference Lnet/minecraft/entity/Entity;getStackReference(I)Lnet/minecraft/inventory/StackReference;
      intermediary method_32318 Lnet/minecraft/class_1297;method_32318(I)Lnet/minecraft/class_5630;
      official a_ Lbvj;a_(I)Lbwx;
    • fillRecipes

      protected abstract void fillRecipes()
      Mappings:
      Namespace Name Mixin selector
      named fillRecipes Lnet/minecraft/entity/passive/MerchantEntity;fillRecipes()V
      intermediary method_7237 Lnet/minecraft/class_3988;method_7237()V
      official gv Lcpd;gv()V
    • fillRecipesFromPool

      protected void fillRecipesFromPool(TradeOfferList recipeList, TradeOffers.Factory[] pool, int count)
      Mappings:
      Namespace Name Mixin selector
      named fillRecipesFromPool Lnet/minecraft/entity/passive/MerchantEntity;fillRecipesFromPool(Lnet/minecraft/village/TradeOfferList;[Lnet/minecraft/village/TradeOffers$Factory;I)V
      intermediary method_19170 Lnet/minecraft/class_3988;method_19170(Lnet/minecraft/class_1916;[Lnet/minecraft/class_3853$class_1652;I)V
      official a Lcpd;a(Ldgf;[Lcpm$g;I)V
    • getLeashPos

      public Vec3d getLeashPos(float delta)
      Returns the position of the leash this entity holds.

      This is different from Entity.getLeashOffset(float); this method is called on the entity that holds the leash.

      Overrides:
      getLeashPos in class Entity
      Returns:
      the position of the leash this entity holds
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getLeashPos Lnet/minecraft/entity/Entity;getLeashPos(F)Lnet/minecraft/util/math/Vec3d;
      intermediary method_30951 Lnet/minecraft/class_1297;method_30951(F)Lnet/minecraft/class_243;
      official u Lbvj;u(F)Lfbx;
    • isClient

      public boolean isClient()
      Specified by:
      isClient in interface Merchant
      Mappings:
      Namespace Name Mixin selector
      named isClient Lnet/minecraft/village/Merchant;isClient()Z
      intermediary method_38069 Lnet/minecraft/class_1915;method_38069()Z
      official gw Ldgd;gw()Z