Created
March 11, 2023 13:13
-
-
Save Niklp09/4b2ce566215f6e4450387665058d4990 to your computer and use it in GitHub Desktop.
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
-- Run this script via qa_block (or similar); This checks if on_rightclick crashes without a valid ItemStack | |
local player = minetest.get_player_by_name("Niklp") -- change this to your name | |
local pos = vector.new(0,0,0) | |
local count = 0 | |
for _, node in pairs(minetest.registered_nodes) do | |
if not node.name then | |
minetest.log("warning", dump(node)) | |
end | |
minetest.set_node(pos, {name = node.name}) | |
local right_click_action = minetest.registered_nodes[node.name].on_rightclick | |
if right_click_action then | |
count = count +1 | |
minetest.log("warning", count) | |
local gnode = minetest.get_node_or_nil(pos) | |
minetest.log("warning", dump(node.name)) | |
right_click_action(pos, gnode, player) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment