Merge pull request #250 from Ghoulboy78/category
Allow to query mob category
This commit is contained in:
3 files changed
+8
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user