mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
Update Hooks.md
This commit is contained in:
1 parent
1ba636a6e6
commit
debe130fe1
1 file changed
+8
-4
@@ -1,3 +1,7 @@
|
||||
# Event Hooks
|
||||
|
||||
## registerHook
|
||||
|
||||
Event hooks allow 3rd party resources to define new behaviour without modifying the inventory code directly.
|
||||
|
||||
```lua
|
||||
@@ -20,7 +24,7 @@ Return:
|
||||
|
||||
- hookId: `number`
|
||||
|
||||
## swapItems
|
||||
### swapItems
|
||||
|
||||
Triggered when moving any item from one slot to another, or when "giving" an item.
|
||||
By returning `false`, you can cancel the action and revert the inventory state.
|
||||
@@ -57,7 +61,7 @@ end, {
|
||||
|
||||
Blacklists "water" from being moved into or from gloveboxes and trunks.
|
||||
|
||||
## openInventory
|
||||
### openInventory
|
||||
|
||||
**Payload:**
|
||||
|
||||
@@ -85,7 +89,7 @@ end, {
|
||||
|
||||
Disables gloveboxes and trunks.
|
||||
|
||||
## createItem
|
||||
### createItem
|
||||
|
||||
**Payload:**
|
||||
|
||||
@@ -115,7 +119,7 @@ end, {
|
||||
|
||||
Sets the label for "water" to "Mineral Water".
|
||||
|
||||
## buyItem
|
||||
### buyItem
|
||||
|
||||
**Payload:**
|
||||
- source: `number`
|
||||
|
||||
Reference in new issue
Block a user