The new 1.2.0-alpha contains two new features. Now you can query for entities, and you can modify the nbt data of an entity.
This will print the number of all players currently logged in:
found = Entities.find( "@e[type=Player]")
print( #found)
This will print the NBT data of the spell’s owner:
print( str( spell.owner.nbt))
Setting the health of all bats to 1.
for _,e in Entities.find("@e[type=Bat]") do
e:putNbt({Health=1})
end