Merge pull request #250 from Ghoulboy78/category

Allow to query mob category
This commit is contained in:
gnembon authored and GitHub committed 2020-04-25 16:24:20 -04:00
commit 30e33c9d65
3 files changed
+8

No files matched your search

+3
View File
@@ -2532,6 +2532,9 @@ Returns `null` if the argument is not a player, otherwise:
* `shadow`: any carpet-shadowed real player
* `realms`: ?
### `query(e, 'category')`
Returns a lowercase string containing the category of the entity (hostile, passive, water, ambient, misc)
### `query(e, 'team')`
Team name for entity, or `null` if no team is assigned.
+3
View File
@@ -275,6 +275,9 @@ Returns `null` if the argument is not a player, otherwise:
* `shadow`: any carpet-shadowed real player
* `realms`: ?
### `query(e, 'category')`
Returns a lowercase string containing the category of the entity (hostile, passive, water, ambient, misc)
### `query(e, 'team')`
Team name for entity, or `null` if no team is assigned.
@@ -479,6 +479,8 @@ public class EntityValue extends Value
return new NBTSerializableValue(nbttagcompound);
return new NBTSerializableValue(nbttagcompound).get(a);
});
put("category",(e,a)->{return new StringValue(e.getType().getCategory().toString().toLowerCase(Locale.ROOT));});
}};
public void set(String what, Value toWhat)