Here I would love to give some examples how the byType()-method is working. This method is from the JavaFX engine FXGL.
byType(EntityType)
With the byType method you can get a list of entities with the given type.
You can get the first element with
var firstEntity = byType(EntityType).get(0)...