[1.20.1 Forge] Using the getEntities function with a predicate requires a specified entity type and results in a NullPointerException, when entitiy types are specified as optional
pinkygrocket opened this issue ยท 0 comments
Issue description
In CraftTweaker's documentation, ServerLevel has a function for getting all entities in a given level via a predicate (getEntities): https://docs.blamejared.com/1.20.1/en/vanilla/api/world/ServerLevel/
The CraftTweaker documentation states that the arguments are a required predicate and an optional entity type. However, the entity type is required; if not specified, Crafttweaker returns a NullPointerException when the code attempts to run. Explicitly passing null results in the same error.
e.g. the first will run, the second will error:
var bowelsEntities = level.getEntities((entity as Entity) => true, <entitytype:minecraft:player>);
var bowelsEntities = level.getEntities((entity as Entity) => true);
Steps to reproduce
No response
Script used
https://hst.sh/neruxakela.typescript
The crafttweaker.log file
Minecraft version
1.20.1
Modloader
Forge
Modloader version
47.4.0
CraftTweaker version
14.0.57
Other relevant information
Script requires Cracker's Wither Storm Mod and Gravity Control.