SHARE
TWEET

Untitled

a guest Jul 15th, 2012 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. Demonstration of remove_item bug
  3. --]]
  4.  
  5. minetest.register_node("testmod:test", {
  6.     description = "test",
  7.     groups = { snappy = 3 },
  8.     on_use=function(itemstack, user, pointed_thing)
  9.         inv=minetest.get_inventory({type="player",name=user:get_player_name()})
  10.         inv:remove_item("main",ItemStack("testmod:test"))
  11.     end,
  12. })
  13.  
  14. --[[
  15. To see the bug save this as the init.lua of a mod, then in game do /giveme testmod:test 20
  16. It should be that upon left click a single "test" item is removed from player inv.
  17. But that does not happen unless there is a stack of the "test" item at some point AFTER the player's currently selected inventory slot.
  18. --]]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top