EntityType
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.entity.EntityType;
Implements
Operators
myEntityType | myCTEntityIngredient
Parameters:
Return Type:
EntityIngredient
Members
myEntityType as CTEntityIngredient
Return Type:
EntityIngredient
myEntityType.canSpawnFarFromPlayer
Return Type:
bool
Returns: True if the entity can spawn far from the player.
myEntityType.canSpawnFarFromPlayer();
Return Type:
bool
myEntityType.canSummon
Return Type:
bool
Returns: True if the entity can be summoned.
myEntityType.canSummon();
Return Type:
bool
Returns: The category of the entity.
myEntityType.category();
Return Type:
MobCategory
myEntityType.commandString
Return Type:
string
myEntityType.defaultLootTable
Return Type:
ResourceLocation
myEntityType.descriptionId
Return Type:
string
Returns: The description ID of the entity.
myEntityType.descriptionId();
Return Type:
string
Returns: The dimensions of the entity.
myEntityType.dimensions();
Return Type:
EntityDimensions
myEntityType.fireImmune
Return Type:
bool
Returns: True if the entity is fire immune.
myEntityType.fireImmune();
Return Type:
bool
myEntityType.height
Return Type:
float
Returns: The height of the entity.
myEntityType.height();
Return Type:
float
Returns: True if the entity is dangerous to blocks.
myEntityType.isBlockDangerous(myBlockState);
Parameters:
Return Type:
bool
Returns: True if the entity is in the tag.
myEntityType.isIn(myKnownTag);
Parameters:
Return Type:
bool
myEntityType.registryName
Return Type:
ResourceLocation
Returns: The registry name of the entity.
myEntityType.registryName();
Return Type:
ResourceLocation
Returns: The spawned entity.
// EntityType<T : Entity>.spawn(level as ServerLevel, spawnStack as IItemStack, spawningPlayer as Player, position as BlockPos, spawnType as MobSpawnType, alignPosition as bool, invertY as bool) as Entity;myEntityType.spawn(myServerLevel, myIItemStack, myPlayer, myBlockPos, myMobSpawnType, myBool, myBool);
Parameters:
alignPosition: bool
Type: bool
- Whether to align the position of the entity. invertY: bool
Type: bool
- Whether to offset the y position of the entity.
Return Type:
Entity
Returns: The spawned entity.
// EntityType<T : Entity>.spawn(level as ServerLevel, position as BlockPos, spawnType as MobSpawnType) as Entity;myEntityType.spawn(myServerLevel, myBlockPos, myMobSpawnType);
Parameters:
Return Type:
Entity
Returns: The spawned entity.
// EntityType<T : Entity>.spawn(level as ServerLevel, onSpawn as function(t as Entity) as void, position as BlockPos, spawnType as MobSpawnType, alignPosition as bool, invertY as bool) as Entity;myEntityType.spawn(myServerLevel, myConsumer, myBlockPos, myMobSpawnType, myBool, myBool);
Parameters:
Return Type:
Entity
myEntityType.toShortString
Return Type:
string
Returns: The short string representation of the entity.
myEntityType.toShortString();
Return Type:
string