Interface IVariantEntity
- All Superinterfaces:
IVariantEntityBase
A
public Interface representing an entity that supports multiple variants.
This interface extends IVariantEntityBase to include methods specific to handling entity variants, including
random selection of variants.
Key Methods:
getRandomVariant(List, String)- Retrieves a random variant name from a provided list or defaults if the list is empty.
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.util.RandomSourceARandomSourceinstance used for generating random variants. -
Method Summary
Methods inherited from interface software.bluelib.interfaces.variant.base.IVariantEntityBase
getEntityVariants, getTextureLocation
-
Field Details
-
random
static final net.minecraft.util.RandomSource randomARandomSourceinstance used for generating random variants.- Since:
- 1.0.0
-
-
Method Details
-
getRandomVariant
AdefaultStringthat selects a random variant name from the provided list of variant names.This method uses the
RandomSourceto pick a random variant from the list. If the list is empty, the default variant name is returned.- Parameters:
pVariantNamesList-List<String>- AList<String>of variant names available for the entity.pDefaultVariant-String- The default variant name to return ifpVariantNamesListis empty.- Returns:
- A random variant name from the list, or the default variant if the list is empty.
- Since:
- 1.0.0
-