Home Getting Started With Scripts Commands Examples
BracketDumpers BracketHandlers BracketValidators

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
ParameterTypeDescription
Parameter
level
Type
Level
Description
No Description Provided

Return Type: Entity

script.zs
EntityType.create(param0 as ServerLevel, param1 as MapData, param2 as Component, param3 as Player, param4 as BlockPos, param5 as MobSpawnType, alignPosition as boolean, invertY as boolean) as Entity
ParameterTypeDescription
Parameter
param0
Type
ServerLevel
Description
No Description Provided
Parameter
param1
Type
MapData
Description
No Description Provided
Parameter
param2
Type
Component
Description
No Description Provided
Parameter
param3
Type
Player
Description
No Description Provided
Parameter
param4
Type
BlockPos
Description
No Description Provided
Parameter
param5
Type
MobSpawnType
Description
No Description Provided
Parameter
alignPosition
Type
boolean
Description
No Description Provided
Parameter
invertY
Type
boolean
Description
No Description Provided

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: float

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

Return Type: boolean

script.zs
EntityType.isBlockDangerous(state as BlockState) as boolean
ParameterTypeDescription
Parameter
state
Type
BlockState
Description
No Description Provided

Return Type: boolean

script.zs
EntityType.isIn(tag as MCTag<EntityType>) as boolean
ParameterTypeDescription
Parameter
tag
Type
MCTag<EntityType>
Description
No Description Provided

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
ParameterTypeDescription
Parameter
level
Type
ServerLevel
Description
No Description Provided
Parameter
data
Type
MapData
Description
No Description Provided
Parameter
displayName
Type
Component
Description
No Description Provided
Parameter
spawningPlayer
Type
Player
Description
No Description Provided
Parameter
pos
Type
BlockPos
Description
No Description Provided
Parameter
spawnType
Type
MobSpawnType
Description
No Description Provided
Parameter
alignPosition
Type
boolean
Description
No Description Provided
Parameter
invertY
Type
boolean
Description
No Description Provided

Return Type: string

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

Properties

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