added persistence to entity API (read and write)

This commit is contained in:
gnembon committed 2020-06-29 12:25:12 -03:00
1 parent b9daf50236
commit 9b439270f1
4 files changed
+43 -4

No files matched your search

+12 -2
View File
@@ -128,6 +128,10 @@ query(e,'type') => villager
Returns a valid string to be used in commands to address an entity. Its UUID for all entities except
player, where its their name.
## `query(e, 'persistence')`
Returns if a mob has a persistence tag or not. Returns `null` for non-mob entities.
<pre>
run('/kill ' + e~'command_name');
</pre>
@@ -411,9 +415,15 @@ Sets the corresponding component of the motion vector.
Adds a vector to the motion vector. Most realistic way to apply a force to an entity.
### `modify(e, 'custom_name'), modify(e, 'custom_name', name)`
### `modify(e, 'custom_name')`, `modify(e, 'custom_name', name)`, `modify(e, 'custom_name', name, visible)`
Sets the custom name of the entity.
Sets the custom name of the entity. Without arguments - clears current custom name. Optional visible affects
if the custom name is always visible, even through blocks.
### `modify(e, 'persistence', bool?)`
Sets the entity persistence tag to `true` (default) or `false`. Only affects mobs. Persistent mobs
don't despawn and don't count towards the mobcap.
### `modify(e, 'age', number)`