Importare la Classe

Link to importare-la-classe

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.

ZenScript
Copy
import crafttweaker.api.entity.MCEntityType;

Interfacce Implementate

Link to interfacce-implementate

MCEntityType implements the following interfaces. That means all methods defined in these interfaces are also available in MCEntityType

Link to setNameplateHandler

Name: setNameplateHandler

Sets the global nameplate handler for all EntityTypes.

Return Type: void

ZenScript
Copy
// MCEntityType.setNameplateHandler(function as INameplateFunction) as void

MCEntityType.setNameplateHandler((entity, result) => {
 result.setAllow();
 result.content = "Custom name! Position: " + entity.position;
 }));
ParametroTipoDescrizione
Parametro
function
Tipo
INameplateFunction
Descrizione
The function that controls how all EntityType's nameplate are rendered.
Tipo RisultatoImplicito
Tipo Risultato
EntityIngredient
Implicito

Name: create

Creates a new entity in the world.

Returns: The newly created Entity
Return Type: MCEntity

ZenScript
Copy
MCEntityType.create(world as MCWorld) as MCEntity
ParametroTipoDescrizione
Parametro
world
Tipo
MCWorld
Descrizione
World for the entity to be created in

Name: getRegistryName

Gets the registry name of this EntityType

Returns: The registry name of this EntityType as a ResourceLocation
Return Type: MCResourceLocation

ZenScript
Copy
// MCEntityType.getRegistryName() as MCResourceLocation

myMCEntityType.getRegistryName();

Name: setNameplate

Sets the nameplate handler for this EntityType.

Return Type: void

ZenScript
Copy
// MCEntityType.setNameplate(function as INameplateFunction) as void

myMCEntityType.setNameplate((entity, result) => {
 result.setAllow();
 result.content = "Custom name! Position: " + entity.position;
 }));
ParametroTipoDescrizione
Parametro
function
Tipo
INameplateFunction
Descrizione
The function that controls how this EntityType's nameplate is rendered.

Name: OR

ZenScript
Copy
myMCEntityType | other as EntityIngredient
NomeTipoHa GetterHa SetterDescrizione
Nome
classification
Tipo
MCEntityClassification
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
commandString
Tipo
string
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
height
Tipo
float
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
immuneToFire
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
lootTable
Tipo
string
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
nome
Tipo
string
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
registryName
Tipo
MCResourceLocation
Ha Getter
Ha Setter
no
Descrizione
Gets the registry name of this EntityType
Nome
serializable
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
summonable
Tipo
boolean
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
translationKey
Tipo
string
Ha Getter
Ha Setter
no
Descrizione
No Description Provided
Nome
width
Tipo
float
Ha Getter
Ha Setter
no
Descrizione
No Description Provided