{"action":"closed","issue":{"url":"https://api.github.com/repos/minetest/minetest/issues/6195","repository_url":"https://api.github.com/repos/minetest/minetest","labels_url":"https://api.github.com/repos/minetest/minetest/issues/6195/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/6195/comments","events_url":"https://api.github.com/repos/minetest/minetest/issues/6195/events","html_url":"https://github.com/minetest/minetest/issues/6195","id":247197920,"number":6195,"title":"on_rightclick callback is not called if node has a formspec","user":{"login":"Wuzzy2","id":1675853,"avatar_url":"https://avatars1.githubusercontent.com/u/1675853?v=4","gravatar_id":"","url":"https://api.github.com/users/Wuzzy2","html_url":"https://github.com/Wuzzy2","followers_url":"https://api.github.com/users/Wuzzy2/followers","following_url":"https://api.github.com/users/Wuzzy2/following{/other_user}","gists_url":"https://api.github.com/users/Wuzzy2/gists{/gist_id}","starred_url":"https://api.github.com/users/Wuzzy2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wuzzy2/subscriptions","organizations_url":"https://api.github.com/users/Wuzzy2/orgs","repos_url":"https://api.github.com/users/Wuzzy2/repos","events_url":"https://api.github.com/users/Wuzzy2/events{/privacy}","received_events_url":"https://api.github.com/users/Wuzzy2/received_events","type":"User","site_admin":false},"labels":[{"id":73368983,"url":"https://api.github.com/repos/minetest/minetest/labels/@%20Script%20API","name":"@ Script API","color":"009800","default":false},{"id":73368921,"url":"https://api.github.com/repos/minetest/minetest/labels/@%20Server%20/%20Client%20/%20Env.","name":"@ Server / Client / Env.","color":"009800","default":false},{"id":6769538,"url":"https://api.github.com/repos/minetest/minetest/labels/Bug","name":"Bug","color":"ff5050","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-08-01T20:52:45Z","updated_at":"2017-08-13T20:48:08Z","closed_at":"2017-08-13T20:48:08Z","body":"The `on_rightclick` callback of a node does *not* get called if the node is rightclick and it has a formspec assigned to it via metadata (`\"formspec\"`).\r\n\r\nHere is a test mod:\r\n\r\n```\r\n\r\nminetest.register_node(\"test_rightclick:rightclick\", {\r\n\tdescription = \"on_rightclick Test Node Without Formspec\",\r\n\ttiles = {\"default_stone.png^default_grass_side.png\"},\r\n\tgroups = {dig_immediate=3},\r\n\tis_ground_content = false,\r\n\ton_rightclick = function(pos, node, clicker)\r\n\t\tminetest.chat_send_player(clicker:get_player_name(), \"You rightclicked an on_rightclick Test Node Without Formspec!\")\r\n\tend,\r\n})\r\n\r\nminetest.register_node(\"test_rightclick:formspec\", {\r\n\tdescription = \"on_rightclick Test Node With Formspec\",\r\n\ttiles = {\"default_stone.png^(default_grass_side.png^[colorize:#FF0000:128)\"},\r\n\tgroups = {dig_immediate=3},\r\n\tis_ground_content = false,\r\n\ton_construct = function(pos)\r\n\t\tlocal meta = minetest.get_meta(pos)\r\n\t\tmeta:set_string(\"formspec\", \"field[test;;${text}]\")\r\n\tend,\r\n\r\n\ton_rightclick = function(pos, node, clicker)\r\n\t\tminetest.chat_send_player(clicker:get_player_name(), \"You rightclicked an on_rightclick Test Node With Formspec!\")\r\n\tend,\r\n})\r\n\r\n```\r\n\r\n**Test description**:\r\nThis adds 2 nodes. Both nodes have `on_rightclick` set which should post a simple chat message when rightclicked. One node gets a formspec after construction, the other one doesn't.\r\n\r\n**Expected behaviour**:\r\nWhen rightclicked, both nodes display a chat message. The node with the formspec shows the formspec as well.\r\n\r\n**Real behaviour**:\r\nIf you rightclick the formspec node, you only get the formspec, but no chat. Which is incorrect.\r\nIf you rightclick the other node, you get the chat message, which is correct.\r\n\r\n**Documentation**:\r\nThe documentation does not have any indication that `on_rightclick` may not be called when the node is rightclicked.\r\n\r\n\r\n**Test environment**:\r\n* Minetest 0.4.16\r\n* Minetest Game 0.4.16\r\n* No further mods except the test mod above"}}
{"actor":{"display_login":"paramat"}}