-
-
Save GreenXenith/69679abeeb0d3b3cf4762f701d3dc8c5 to your computer and use it in GitHub Desktop.
remove item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minetest.register_craftitem("waffles:toaster_waffle_pack_2", { | |
description = "Pack of 2 Toaster Waffles", | |
inventory_image = "toaster_waffle_pack_2.png", | |
on_use = function(itemstack, user, pointed_thing) | |
if pointed_thing.type ~= "node" then | |
return | |
end | |
local pos = pointed_thing.under | |
local pname = user:get_player_name() | |
if minetest.is_protected(pos, pname) then | |
minetest.record_protection_violation(pos, pname) | |
return | |
end | |
local node = minetest.get_node(pos) | |
if node.name == "homedecor:toaster" | |
or node.name == "waffles:toaster" then | |
itemstack:take_item() | |
minetest.set_node(pos, {name = "waffles:toaster_with_waffle", param2 = node.param2}) | |
return itemstack | |
end | |
end, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment