@@ -2447,6 +2447,14 @@ Call these functions only at load time!
2447
2447
* `minetest.register_on_item_eat(func(hp_change, replace_with_item, itemstack, user, pointed_thing))`
2448
2448
* Called when an item is eaten, by `minetest.item_eat`
2449
2449
* Return `true` or `itemstack` to cancel the default item eat response (i.e.: hp increase)
2450
+ * `minetest.register_on_priv_grant(function(name, granter, priv))`
2451
+ * Called when `granter` grants the priv `priv` to `name`.
2452
+ * Note that the callback will be called twice if it's done by a player, once with granter being the player name,
2453
+ and again with granter being nil.
2454
+ * `minetest.register_on_priv_revoke(function(name, revoker, priv))`
2455
+ * Called when `revoker` revokes the priv `priv` from `name`.
2456
+ * Note that the callback will be called twice if it's done by a player, once with revoker being the player name,
2457
+ and again with revoker being nil.
2450
2458
2451
2459
### Other registration functions
2452
2460
* `minetest.register_chatcommand(cmd, chatcommand definition)`
@@ -2464,8 +2472,9 @@ Call these functions only at load time!
2464
2472
`granter_name` will be nil if the priv was granted by a mod.
2465
2473
* `on_revoke(name, revoker_name)`: Called when taken from player `name` by `revoker_name`.
2466
2474
`revoker_name` will be nil if the priv was revoked by a mod
2467
- * Note that the above two callbacks will be called twice if a player is responsible -
2475
+ * Note that the above two callbacks will be called twice if a player is responsible -
2468
2476
once with the player name, and then with a nil player name.
2477
+ * Return true in the above callbacks to stop register_on_priv_grant or revoke being called.
2469
2478
* `minetest.register_authentication_handler(handler)`
2470
2479
* See `minetest.builtin_auth_handler` in `builtin.lua` for reference
2471
2480
0 commit comments