- Thread starter
- Admin
- #1
Here I would love to give some examples how the byType()-method is working. This method is from the JavaFX engine
byType(EntityType)
With the byType method you can get a list of entities with the given type.
You can get the first element with
You can check if there is one spawned entity from this type
You can run something on each entity
Syntax
Parameters
EntityType - Type of the entity you would like to get.
You do not have permission to view link
Log in or register now.
.byType(EntityType)
With the byType method you can get a list of entities with the given type.
You can get the first element with
Java:
var firstEntity = byType(EntityType).get(0);
Java:
byType(EntityType).isEmpty() //Returns true if the list is empty
Java:
byType(EntityType).forEach(entity -> {
entity.removeFromWorld(); // removes entity from world
});
Java:
byType(EntityType)
EntityType - Type of the entity you would like to get.