View difference between Paste ID: BshEYEHb and t7JYNz3R
SHOW: | | - or go back to the newest paste.
1
--[[
2
Demonstration of remove_item bug
3
--]]
4
5
minetest.register_node("testmod:test", {
6-
minetest.register_node("tricorder:test", {
6+
7
	groups = { snappy = 3 },
8
	on_use=function(itemstack, user, pointed_thing)
9
	--    READ THE DOCS!!!
10
	--    inv=minetest.get_inventory({type="player",name=user:get_player_name()})
11
	--    inv:remove_item("main",ItemStack("testmod:test"))
12-
	--    inv:remove_item("main",ItemStack("tricorder:test"))
12+
13
	end,
14
})
15
16
--[[
17
To see the bug save this as the init.lua of a mod, then in game do /giveme testmod:test 20
18
It should be that upon left click a single "test" item is removed from player inv.
19
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.
20
--]]

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×