Cuberite Forum
Independant function calls? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Independant function calls? (/thread-1731.html)

Pages: 1 2


RE: Independant function calls? - tigerw - 01-18-2015

For SpawnItemPickups, add stuff to a cItems by either:

cItems:Add(cItem(ItemType, Count, Damage, EnchantmentString, CustomName, Lore)) or
cItems:Add(ItemType, ItemCount, ItemDamage)

for a created cItems object.

Try this link for sound effects.


RE: Independant function calls? - DiamondToaster - 01-18-2015

I would try that, but I always get errors in the console.
Here's the code I used to replicate it:

Code:
local items = cItems()
items:Add(E_ITEM_DIAMOND_SWORD, 1, 100)

Here's the exact console error I get:

Warn [20:15:45] Stack trace:
Warn [20:15:45] [C](-1): Add
Warn [20:15:45] Plugins/MCSmash/hooks.lua(136): (no name)
Warn [20:15:45] Stack trace end
Warn [20:15:45] Error in plugin MCSmash calling function <callback>()
Warn [20:15:45] LUA: Plugins/MCSmash/hooks.lua:136: error in function 'Add'.
argument #1 is 'class cItems'; 'cItems' expected.



Oh never mind, my bad, I just downloaded the latest binary and it fixed itself. I was using a version over a month old.