Module api
Slingshot mod API.
Functions
slingshot.register_ammo (name, damage) | Register an item as ammunition for slingshot. |
slingshot.register (name, def) | Registers a new slingshot. |
Function Definition Tables
slingshot.register.def | Slingshot definition table. |
Functions
- slingshot.register_ammo (name, damage)
-
Register an item as ammunition for slingshot.
Any item can be thrown, but registering as ammo allows custom attack value to be set.
Parameters:
- name string Item technical name.
- damage int Damage value addon.
- slingshot.register (name, def)
-
Registers a new slingshot.
'def' should include 'description', 'damage_groups', & 'velocity'.
Parameters:
- name string Name of the slingshot (e.g. "iron").
- def table Slingshot definition table (see slingshot.register.def).
Function Definition Tables
- slingshot.register.def
-
Slingshot definition table.
Fields:
- description string Human-readable description of slingshot (e.g. "Wooden Slinghot").
- damage_groups
table
- Same as minetest.registertool.toolcapabilities.damage_groups
- Default: {fleshy=1}
- velocity int Speed & distance at which items will be thrown.
- wear_rate int Rate at which the slingshot will wear & break.
See also: