Add an allow_shot field to throwing.register_bow definition table

And make the throwing.throw_arrow function able to throw any item
This commit is contained in:
upsilon
2017-06-20 16:23:04 +02:00
parent 4fe2a0c88c
commit 1778b89597
2 changed files with 59 additions and 35 deletions

View File

@ -36,6 +36,11 @@ Definition: definition table, containing:
* description (highly recommended): description of the bow.
* texture (essential): texture of the bow, shown in inventory.
* groups (optional): groups of the item.
* allow_shot (optional): function(player, itemstack):
- player: the player using the bow
- itemstack: the itemstack of the bow
- should return true if the shot can be made, and false otherwise
- default for this is function(player, itemstack) return throwing.is_arrow(itemstack) end
]]
-- Example: