Class TEntityElement.EntityProvider

java.lang.Object
com.thecsdev.commonmc.api.client.gui.misc.TEntityElement.EntityProvider
Enclosing class:
TEntityElement

@Internal public static final class TEntityElement.EntityProvider extends Object
Utility class for providing Entity instances for rendering in GUIs. These entities do not exist in a "real" Level. Instead, this uses a sandbox Level to create entities in.
  • Method Details

    • getOrCreate

      @NotNull public static final <E extends net.minecraft.world.entity.Entity> E getOrCreate(@NotNull @NotNull net.minecraft.world.entity.EntityType<E> entityType) throws NullPointerException, RuntimeException
      Returns an instance of the given EntityType.
      Type Parameters:
      E - The type of the Entity.
      Parameters:
      entityType - The EntityType to create an instance of.
      Returns:
      An instance of the given EntityType.
      Throws:
      NullPointerException - If the argument is null.
      RuntimeException - If an error occurs during Entity instance creation.