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.PlacementType;

Extending Enum<PlacementType>

Link to extending-enumplacementtype

PlacementType extends Enum<PlacementType>. That means all methods available in Enum<PlacementType> are also available in PlacementType

Static Properties

Link to static-properties

名称类型可获得可设置描述
名称
IN_LAVA
类型
PlacementType
可获得
true
可设置
false
描述
No Description Provided
名称
IN_WATER
类型
PlacementType
可获得
true
可设置
false
描述
No Description Provided
名称
NO_RESTRICTIONS
类型
PlacementType
可获得
true
可设置
false
描述
No Description Provided
名称
ON_GROUND
类型
PlacementType
可获得
true
可设置
false
描述
No Description Provided

Name: canSpawnAt

Checks if a specific entity type can spawn in the world at the given position with this PlacementType.

Returns: True if the entity type can spawn. False otherwise.
Return Type: boolean

ZenScript
Copy
// PlacementType.canSpawnAt(world as MCWorld, pos as BlockPos, entityType as MCEntityType) as boolean

myPlacementType.canSpawnAt(world, new BlockPos(1,2,3), <entitytype:minecraft:pig>);
参数类型描述
参数
world
类型
MCWorld
描述
A World object.
参数
类型
BlockPos
描述
The position to check at.
参数
entityType
类型
MCEntityType #MC实体类型
描述
The EntityType to check for.