Class LivingEntityMixin

java.lang.Object
software.bluelib.mixin.variant.LivingEntityMixin
All Implemented Interfaces:
IVariantAccessor

public class LivingEntityMixin extends Object implements IVariantAccessor
A public Mixin class that injects functionality into the LivingEntity class to provide variant management support within the BlueLib framework.

This mixin adds functionality to define, save, and retrieve an entity's variant information using NBT (Named Binary Tag) data. It implements the IVariantAccessor interface, which allows setting and getting the variant name of a LivingEntity.

Key Methods:

Since:
1.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag pCompound, org.spongepowered.asm.mixin.injection.callback.CallbackInfo pCi)
    A public void that injects into the addAdditionalSaveData method of LivingEntity to store the entity's variant in NBT data when saving the entity.
    A public String method that retrieves the entity's current variant name.
    void
    A public void method that sets the entity's variant name.
    protected void
    defineSynchedData(@NotNull net.minecraft.network.syncher.SynchedEntityData.Builder pBuilder, org.spongepowered.asm.mixin.injection.callback.CallbackInfo pCi)
    A public void that injects into the defineSynchedData method of LivingEntity to define the synchronized data that will hold the entity's variant information.
    A public String method that retrieves the variant name of the entity.
    void
    readAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag pCompound, org.spongepowered.asm.mixin.injection.callback.CallbackInfo pCi)
    A public void that injects into the readAdditionalSaveData method of LivingEntity to read the entity's variant from NBT data when loading the entity.
    void
    A public void method that sets the variant name of the entity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LivingEntityMixin

      public LivingEntityMixin()
  • Method Details

    • defineSynchedData

      protected void defineSynchedData(@NotNull net.minecraft.network.syncher.SynchedEntityData.Builder pBuilder, org.spongepowered.asm.mixin.injection.callback.CallbackInfo pCi)
      A public void that injects into the defineSynchedData method of LivingEntity to define the synchronized data that will hold the entity's variant information.
      Parameters:
      pBuilder - SynchedEntityData.Builder - The builder to define entity data.
      pCi - CallbackInfo - Callback information for the injection process.
      Since:
      1.0.0
    • addAdditionalSaveData

      public void addAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag pCompound, org.spongepowered.asm.mixin.injection.callback.CallbackInfo pCi)
      A public void that injects into the addAdditionalSaveData method of LivingEntity to store the entity's variant in NBT data when saving the entity.
      Parameters:
      pCompound - CompoundTag - The NBT tag to save the entity's variant information.
      pCi - CallbackInfo - Callback information for the injection process.
      Since:
      1.0.0
    • readAdditionalSaveData

      public void readAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag pCompound, org.spongepowered.asm.mixin.injection.callback.CallbackInfo pCi)
      A public void that injects into the readAdditionalSaveData method of LivingEntity to read the entity's variant from NBT data when loading the entity.
      Parameters:
      pCompound - CompoundTag - The NBT tag containing the entity's variant information.
      pCi - CallbackInfo - Callback information for the injection process.
      Since:
      1.0.0
    • bluelib$setVariantName

      public void bluelib$setVariantName(String pName)
      A public void method that sets the entity's variant name.
      Parameters:
      pName - String - The variant name to assign to the entity.
      Since:
      1.0.0
    • bluelib$getVariantName

      public String bluelib$getVariantName()
      A public String method that retrieves the entity's current variant name.
      Returns:
      The current variant name of the entity as a String.
      Since:
      1.0.0
    • setEntityVariantName

      public void setEntityVariantName(String pVariantName)
      A public void method that sets the variant name of the entity. This method overrides the IVariantAccessor.setEntityVariantName(String) interface method.
      Specified by:
      setEntityVariantName in interface IVariantAccessor
      Parameters:
      pVariantName - String - The variant name to set for the entity.
      Since:
      1.0.0
    • getEntityVariantName

      public String getEntityVariantName()
      A public String method that retrieves the variant name of the entity. This method overrides the IVariantAccessor.getEntityVariantName() interface method.
      Specified by:
      getEntityVariantName in interface IVariantAccessor
      Returns:
      The current variant name of the entity as a String.
      Since:
      1.0.0