Updating logger to support different types (#452) fixes #437

* Updating logger to support different types

* changing to ouptut info by default

* updating docs with air

* adding air modify definition
This commit is contained in:
Ghoulboy authored and GitHub committed 2020-09-07 15:19:28 -03:00
1 parent d072e4946a
commit 26169f042e
5 files changed
+63 -14

No files matched your search

+17 -5
View File
@@ -2826,6 +2826,9 @@ Number indicating remaining entity health, or `null` if not applicable.
Retrieves player hunger related information. For non-players, returns `null`.
### `query(e, 'air')`
Number indicating remaining entity health, or `null` if not applicable.
### `query(e, 'holds', slot?)`
@@ -3118,6 +3121,10 @@ Will set entity on fire for `ticks` ticks. Set to 0 to extinguish.
Modifies directly player raw hunger components. Has no effect on non-players
### `modify(e, 'air', ticks)`
Modifies entity air
### `modify(e, 'add_exhaustion', value)`
adds exhaustion value to the current player exhaustion level - that's the method you probably want to use
@@ -3692,13 +3699,18 @@ Example usages:
// not a problem in apps
</pre>
### `logger(expr)`
### `logger(msg), logger(type, msg)`
Prints the message to system logs, and not to chat.
Prints the message to system logs, and not to chat. By default prints an info, unless you specify otherwise in the `type` parameter.
### read_file(resource, type)
### delete_file(resource, type)
### write_file(resource, type, data, ...)
Available output types:
`'debug'`, `'warn'`, `'fatal'`, `'info'` and `'error'`
### `read_file(resource, type)`
### `delete_file(resource, type)`
### `write_file(resource, type, data, ...)`
With the specified `resource` in the scripts folder, of a specific `type`, writes/appends `data` to it, reads its
content, or deletes the resource.
+10 -5
View File
@@ -245,13 +245,18 @@ Example usages:
// not a problem in apps
</pre>
### `logger(expr)`
### `logger(msg), logger(type, msg)`
Prints the message to system logs, and not to chat.
Prints the message to system logs, and not to chat. By default prints an info, unless you specify otherwise in the `type` parameter.
### read_file(resource, type)
### delete_file(resource, type)
### write_file(resource, type, data, ...)
Available output types:
`'debug'`, `'warn'`, `'fatal'`, `'info'` and `'error'`
### `read_file(resource, type)`
### `delete_file(resource, type)`
### `write_file(resource, type, data, ...)`
With the specified `resource` in the scripts folder, of a specific `type`, writes/appends `data` to it, reads its
content, or deletes the resource.
+9 -1
View File
@@ -361,6 +361,10 @@ Number indicating remaining entity health, or `null` if not applicable.
Retrieves player hunger related information. For non-players, returns `null`.
### `query(e, 'air')`
Number indicating remaining entity health, or `null` if not applicable.
### `query(e, 'holds', slot?)`
Returns triple of short name, stack count, and NBT of item held in `slot`, or `null` if nothing or not applicable. Available options for `slot` are:
@@ -654,7 +658,11 @@ Will set entity on fire for `ticks` ticks. Set to 0 to extinguish.
### `modify(e, 'saturation', value)`
### `modify(e, 'exhaustion', value)`
Modifies player raw hunger components. Has no effect on non-players.
Modifies directly player raw hunger components. Has no effect on non-players
### `modify(e, 'air', ticks)`
Modifies entity air
### `modify(e, 'add_exhaustion', value)`