added 'ping'

This commit is contained in:
gnembon committed 2020-04-01 13:09:02 -03:00
1 parent 652ca7d6a0
commit c2dfaca1b8
3 files changed
+17

No files matched your search

+4
View File
@@ -2502,6 +2502,10 @@ Returns `null` if the argument is not a player, otherwise:
* `shadow`: any carpet-shadowed real player
* `realms`: ?
### `query(e,'ping')`
Player's ping in milliseconds, or `null` if its not a player.
### `query(e,'permission_level')`
Player's permission level, or `null` if not applicable for this entity.
+4
View File
@@ -265,6 +265,10 @@ Returns `null` if the argument is not a player, otherwise:
* `shadow`: any carpet-shadowed real player
* `realms`: ?
### `query(e,'ping')`
Player's ping in milliseconds, or `null` if its not a player.
### `query(e,'permission_level')`
Player's permission level, or `null` if not applicable for this entity.
@@ -331,6 +331,15 @@ public class EntityValue extends Value
return Value.NULL;
});
put("ping", (e, a) -> {
if (e instanceof ServerPlayerEntity)
{
ServerPlayerEntity spe = (ServerPlayerEntity) e;
return new NumericValue(spe.pingMilliseconds);
}
return Value.NULL;
});
//spectating_entity
// isGlowing
put("effect", (e, a) ->