Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

EntityType

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.entity.EntityType;

Casters

Result TypeIs Implicit
Result Type
EntityIngredient
Is Implicit
true

Methods

Return Type: boolean

script.zs
// EntityType.canSpawnFarFromPlayer() as boolean
myEntityType.canSpawnFarFromPlayer();

Return Type: boolean

script.zs
// EntityType.canSummon() as boolean
myEntityType.canSummon();

Return Type: Entity?

script.zs
EntityType.create(level as Level) as Entity?
ParameterType
Parameter
level
Type
Level

Return Type: Entity?

script.zs
EntityType.create(level as ServerLevel, data as MapData?, displayName as Component?, spawningPlayer as Player?, pos as BlockPos, spawnType as MobSpawnType, alignPosition as boolean, invertY as boolean) as Entity?
ParameterType
Parameter
level
Type
ServerLevel
Parameter
data
Type
MapData?
Parameter
displayName
Type
Component?
Parameter
spawningPlayer
Type
Player?
Parameter
pos
Type
BlockPos
Parameter
spawnType
Type
MobSpawnType
Parameter
alignPosition
Type
boolean
Parameter
invertY
Type
boolean

Return Type: boolean

script.zs
// EntityType.fireImmune() as boolean
myEntityType.fireImmune();

Return Type: MobCategory

script.zs
// EntityType.getCategory() as MobCategory
myEntityType.getCategory();

Return Type: ResourceLocation

script.zs
// EntityType.getDefaultLootTable() as ResourceLocation
myEntityType.getDefaultLootTable();

Return Type: Component

script.zs
// EntityType.getDescription() as Component
myEntityType.getDescription();

Return Type: string

script.zs
// EntityType.getDescriptionId() as string
myEntityType.getDescriptionId();

Return Type: EntityDimensions

script.zs
// EntityType.getDimensions() as EntityDimensions
myEntityType.getDimensions();

Return Type: float

script.zs
// EntityType.getHeight() as float
myEntityType.getHeight();

Return Type: ResourceLocation

script.zs
// EntityType.getRegistryName() as ResourceLocation
myEntityType.getRegistryName();

Return Type: float

script.zs
// EntityType.getWidth() as float
myEntityType.getWidth();

Return Type: boolean

script.zs
EntityType.isBlockDangerous(state as BlockState) as boolean
ParameterType
Parameter
state
Type
BlockState

Return Type: boolean

script.zs
EntityType.isIn(tag as KnownTag<EntityType<Entity>>) as boolean
ParameterType
Parameter
tag
Type
KnownTag<EntityType<Entity>>

Return Type: Entity?

script.zs
EntityType.spawn(level as ServerLevel, data as MapData?, displayName as Component?, spawningPlayer as Player?, pos as BlockPos, spawnType as MobSpawnType, alignPosition as boolean, invertY as boolean) as Entity?
ParameterType
Parameter
level
Type
ServerLevel
Parameter
data
Type
MapData?
Parameter
displayName
Type
Component?
Parameter
spawningPlayer
Type
Player?
Parameter
pos
Type
BlockPos
Parameter
spawnType
Type
MobSpawnType
Parameter
alignPosition
Type
boolean
Parameter
invertY
Type
boolean

Return Type: string

script.zs
// EntityType.toShortString() as string
myEntityType.toShortString();

Properties

NameTypeHas GetterHas Setter
Name
canSpawnFarFromPlayer
Type
boolean
Has Getter
true
Has Setter
false
Name
canSummon
Type
boolean
Has Getter
true
Has Setter
false
Name
category
Type
MobCategory
Has Getter
true
Has Setter
false
Name
commandString
Type
string
Has Getter
true
Has Setter
false
Name
defaultLootTable
Type
ResourceLocation
Has Getter
true
Has Setter
false
Name
description
Type
Component
Has Getter
true
Has Setter
false
Name
descriptionId
Type
string
Has Getter
true
Has Setter
false
Name
dimensions
Type
EntityDimensions
Has Getter
true
Has Setter
false
Name
fireImmune
Type
boolean
Has Getter
true
Has Setter
false
Name
height
Type
float
Has Getter
true
Has Setter
false
Name
registryName
Type
ResourceLocation
Has Getter
true
Has Setter
false
Name
toShortString
Type
string
Has Getter
true
Has Setter
false
Name
width
Type
float
Has Getter
true
Has Setter
false