Class PaintingEntity

All Implemented Interfaces:
VariantHolder<RegistryEntry<PaintingVariant>>, ScoreHolder, CommandOutput, Nameable, EntityLike

public class PaintingEntity extends AbstractDecorationEntity implements VariantHolder<RegistryEntry<PaintingVariant>>
Mappings:
Namespace Name
official cbp
intermediary net/minecraft/class_1534
named net/minecraft/entity/decoration/painting/PaintingEntity
  • Field Details

    • VARIANT

      private static final TrackedData<RegistryEntry<PaintingVariant>> VARIANT
      Mappings:
      Namespace Name Mixin selector
      official f Lcbp;f:Lagm;
      intermediary field_38941 Lnet/minecraft/class_1534;field_38941:Lnet/minecraft/class_2940;
      named VARIANT Lnet/minecraft/entity/decoration/painting/PaintingEntity;VARIANT:Lnet/minecraft/entity/data/TrackedData;
    • DEFAULT_VARIANT

      private static final RegistryKey<PaintingVariant> DEFAULT_VARIANT
      Mappings:
      Namespace Name Mixin selector
      official g Lcbp;g:Lahf;
      intermediary field_38942 Lnet/minecraft/class_1534;field_38942:Lnet/minecraft/class_5321;
      named DEFAULT_VARIANT Lnet/minecraft/entity/decoration/painting/PaintingEntity;DEFAULT_VARIANT:Lnet/minecraft/registry/RegistryKey;
    • VARIANT_NBT_KEY

      public static final String VARIANT_NBT_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official e Lcbp;e:Ljava/lang/String;
      intermediary field_42463 Lnet/minecraft/class_1534;field_42463:Ljava/lang/String;
      named VARIANT_NBT_KEY Lnet/minecraft/entity/decoration/painting/PaintingEntity;VARIANT_NBT_KEY:Ljava/lang/String;
  • Constructor Details

    • PaintingEntity

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

      private PaintingEntity(World world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcbp;<init>(Lctp;Lhx;)V
      intermediary <init> Lnet/minecraft/class_1534;<init>(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)V
      named <init> Lnet/minecraft/entity/decoration/painting/PaintingEntity;<init>(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V
    • PaintingEntity

      public PaintingEntity(World world, BlockPos pos, Direction direction, RegistryEntry<PaintingVariant> variant)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcbp;<init>(Lctp;Lhx;Lic;Lih;)V
      intermediary <init> Lnet/minecraft/class_1534;<init>(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Lnet/minecraft/class_6880;)V
      named <init> Lnet/minecraft/entity/decoration/painting/PaintingEntity;<init>(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/registry/entry/RegistryEntry;)V
  • Method Details

    • getDefaultVariant

      private static RegistryEntry<PaintingVariant> getDefaultVariant()
      Mappings:
      Namespace Name Mixin selector
      official s Lcbp;s()Lih;
      intermediary method_43405 Lnet/minecraft/class_1534;method_43405()Lnet/minecraft/class_6880;
      named getDefaultVariant Lnet/minecraft/entity/decoration/painting/PaintingEntity;getDefaultVariant()Lnet/minecraft/registry/entry/RegistryEntry;
    • initDataTracker

      protected void initDataTracker()
      Initializes data tracker.
      Overrides:
      initDataTracker in class AbstractDecorationEntity
      Mappings:
      Namespace Name Mixin selector
      official c_ Lblv;c_()V
      intermediary method_5693 Lnet/minecraft/class_1297;method_5693()V
      named initDataTracker Lnet/minecraft/entity/Entity;initDataTracker()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.

      Overrides:
      onTrackedDataSet in class Entity
      Mappings:
      Namespace Name Mixin selector
      official a Lblv;a(Lagm;)V
      intermediary method_5674 Lnet/minecraft/class_1297;method_5674(Lnet/minecraft/class_2940;)V
      named onTrackedDataSet Lnet/minecraft/entity/Entity;onTrackedDataSet(Lnet/minecraft/entity/data/TrackedData;)V
    • setVariant

      public void setVariant(RegistryEntry<PaintingVariant> variant)
      Specified by:
      setVariant in interface VariantHolder<RegistryEntry<PaintingVariant>>
      Mappings:
      Namespace Name Mixin selector
      official a Lcbp;a(Lih;)V
      intermediary method_43402 Lnet/minecraft/class_1534;method_43402(Lnet/minecraft/class_6880;)V
      named setVariant Lnet/minecraft/entity/decoration/painting/PaintingEntity;setVariant(Lnet/minecraft/registry/entry/RegistryEntry;)V
    • getVariant

      public RegistryEntry<PaintingVariant> getVariant()
      Specified by:
      getVariant in interface VariantHolder<RegistryEntry<PaintingVariant>>
      Mappings:
      Namespace Name Mixin selector
      official q Lcbp;q()Lih;
      intermediary method_43404 Lnet/minecraft/class_1534;method_43404()Lnet/minecraft/class_6880;
      named getVariant Lnet/minecraft/entity/decoration/painting/PaintingEntity;getVariant()Lnet/minecraft/registry/entry/RegistryEntry;
    • placePainting

      public static Optional<PaintingEntity> placePainting(World world, BlockPos pos, Direction facing)
      Mappings:
      Namespace Name Mixin selector
      official a Lcbp;a(Lctp;Lhx;Lic;)Ljava/util/Optional;
      intermediary method_43401 Lnet/minecraft/class_1534;method_43401(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Ljava/util/Optional;
      named placePainting Lnet/minecraft/entity/decoration/painting/PaintingEntity;placePainting(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Ljava/util/Optional;
    • getSize

      private static int getSize(RegistryEntry<PaintingVariant> variant)
      Mappings:
      Namespace Name Mixin selector
      official b Lcbp;b(Lih;)I
      intermediary method_43403 Lnet/minecraft/class_1534;method_43403(Lnet/minecraft/class_6880;)I
      named getSize Lnet/minecraft/entity/decoration/painting/PaintingEntity;getSize(Lnet/minecraft/registry/entry/RegistryEntry;)I
    • 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 AbstractDecorationEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lblv;b(Lsn;)V
      intermediary method_5652 Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
      named writeCustomDataToNbt Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)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 AbstractDecorationEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lblv;a(Lsn;)V
      intermediary method_5749 Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
      named readCustomDataFromNbt Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • writeVariantToNbt

      public static void writeVariantToNbt(NbtCompound nbt, RegistryEntry<PaintingVariant> variant)
      Mappings:
      Namespace Name Mixin selector
      official a Lcbp;a(Lsn;Lih;)V
      intermediary method_48928 Lnet/minecraft/class_1534;method_48928(Lnet/minecraft/class_2487;Lnet/minecraft/class_6880;)V
      named writeVariantToNbt Lnet/minecraft/entity/decoration/painting/PaintingEntity;writeVariantToNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/entry/RegistryEntry;)V
    • readVariantFromNbt

      public static Optional<RegistryEntry<PaintingVariant>> readVariantFromNbt(NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official c Lcbp;c(Lsn;)Ljava/util/Optional;
      intermediary method_48929 Lnet/minecraft/class_1534;method_48929(Lnet/minecraft/class_2487;)Ljava/util/Optional;
      named readVariantFromNbt Lnet/minecraft/entity/decoration/painting/PaintingEntity;readVariantFromNbt(Lnet/minecraft/nbt/NbtCompound;)Ljava/util/Optional;
    • getWidthPixels

      public int getWidthPixels()
      Specified by:
      getWidthPixels in class AbstractDecorationEntity
      Mappings:
      Namespace Name Mixin selector
      official B Lcbm;B()I
      intermediary method_6897 Lnet/minecraft/class_1530;method_6897()I
      named getWidthPixels Lnet/minecraft/entity/decoration/AbstractDecorationEntity;getWidthPixels()I
    • getHeightPixels

      public int getHeightPixels()
      Specified by:
      getHeightPixels in class AbstractDecorationEntity
      Mappings:
      Namespace Name Mixin selector
      official C Lcbm;C()I
      intermediary method_6891 Lnet/minecraft/class_1530;method_6891()I
      named getHeightPixels Lnet/minecraft/entity/decoration/AbstractDecorationEntity;getHeightPixels()I
    • onBreak

      public void onBreak(@Nullable @Nullable Entity entity)
      Specified by:
      onBreak in class AbstractDecorationEntity
      Mappings:
      Namespace Name Mixin selector
      official a Lcbm;a(Lblv;)V
      intermediary method_6889 Lnet/minecraft/class_1530;method_6889(Lnet/minecraft/class_1297;)V
      named onBreak Lnet/minecraft/entity/decoration/AbstractDecorationEntity;onBreak(Lnet/minecraft/entity/Entity;)V
    • onPlace

      public void onPlace()
      Specified by:
      onPlace in class AbstractDecorationEntity
      Mappings:
      Namespace Name Mixin selector
      official D Lcbm;D()V
      intermediary method_6894 Lnet/minecraft/class_1530;method_6894()V
      named onPlace Lnet/minecraft/entity/decoration/AbstractDecorationEntity;onPlace()V
    • refreshPositionAndAngles

      public void refreshPositionAndAngles(double x, double y, double z, float yaw, float pitch)
      Sets the entity's position, yaw, and pitch, and refreshes several position-related fields.

      This should be used over other methods for setting positions of mobs.

      Overrides:
      refreshPositionAndAngles in class Entity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lblv;b(DDDFF)V
      intermediary method_5808 Lnet/minecraft/class_1297;method_5808(DDDFF)V
      named refreshPositionAndAngles Lnet/minecraft/entity/Entity;refreshPositionAndAngles(DDDFF)V
    • updateTrackedPositionAndAngles

      public void updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps)
      Overrides:
      updateTrackedPositionAndAngles in class Entity
      Mappings:
      Namespace Name Mixin selector
      official a Lblv;a(DDDFFI)V
      intermediary method_5759 Lnet/minecraft/class_1297;method_5759(DDDFFI)V
      named updateTrackedPositionAndAngles Lnet/minecraft/entity/Entity;updateTrackedPositionAndAngles(DDDFFI)V
    • getSyncedPos

      public Vec3d getSyncedPos()
      Returns the position of the entity synced to clients.

      This is the same as Entity.getPos() except for paintings which return the attachment position.

      Overrides:
      getSyncedPos in class Entity
      Returns:
      the position of the entity synced to clients
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official dl Lblv;dl()Lelt;
      intermediary method_43390 Lnet/minecraft/class_1297;method_43390()Lnet/minecraft/class_243;
      named getSyncedPos Lnet/minecraft/entity/Entity;getSyncedPos()Lnet/minecraft/util/math/Vec3d;
    • createSpawnPacket

      public Packet<ClientPlayPacketListener> createSpawnPacket()
      Returns a packet to notify the clients of the entity's spawning.
      Overrides:
      createSpawnPacket in class Entity
      Returns:
      a packet to notify the clients of the entity's spawning
      Mappings:
      Namespace Name Mixin selector
      official dj Lblv;dj()Lxf;
      intermediary method_18002 Lnet/minecraft/class_1297;method_18002()Lnet/minecraft/class_2596;
      named createSpawnPacket Lnet/minecraft/entity/Entity;createSpawnPacket()Lnet/minecraft/network/packet/Packet;
    • 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 Entity
      Mappings:
      Namespace Name Mixin selector
      official a Lblv;a(Lzb;)V
      intermediary method_31471 Lnet/minecraft/class_1297;method_31471(Lnet/minecraft/class_2604;)V
      named onSpawnPacket Lnet/minecraft/entity/Entity;onSpawnPacket(Lnet/minecraft/network/packet/s2c/play/EntitySpawnS2CPacket;)V
    • getPickBlockStack

      public ItemStack getPickBlockStack()
      Returns the stack for creative "pick block" functionality, or null if there is none.

      If the entity has an item representation (such as boats or minecarts), this should be overridden to return a new stack. Note that MobEntity handles the spawn eggs. ItemFrameEntity instead returns the copy of the stack held in the frame.

      Overrides:
      getPickBlockStack in class Entity
      Returns:
      the stack for creative "pick block" functionality, or null if there is none
      Mappings:
      Namespace Name Mixin selector
      official dz Lblv;dz()Lcmy;
      intermediary method_31480 Lnet/minecraft/class_1297;method_31480()Lnet/minecraft/class_1799;
      named getPickBlockStack Lnet/minecraft/entity/Entity;getPickBlockStack()Lnet/minecraft/item/ItemStack;