Legal, but incredible nodenames #6947

Open
opened 2024-06-13 17:23:55 +00:00 by AliasAlreadyTaken · 5 comments

These nodenames are unexpectedly legal:

minetest.register_node("::", {})
minetest.register_node("::::::::", {})
minetest.register_node(":% %", {}) -- There's a space between the %
minetest.register_node(":图是由若干给定的", {})
minetest.register_node(": ", {}) -- There's a space after the colon
minetest.register_node(":\"", {})
These nodenames are unexpectedly legal: ``` minetest.register_node("::", {}) minetest.register_node("::::::::", {}) minetest.register_node(":% %", {}) -- There's a space between the % minetest.register_node(":图是由若干给定的", {}) minetest.register_node(": ", {}) -- There's a space after the colon minetest.register_node(":\"", {}) ```
minetest.register_node(":\n", {})
minetest.register_node(":	", {}) -- tab key
minetest.register_node(":😍", {})
``` minetest.register_node(":\n", {}) minetest.register_node(": ", {}) -- tab key minetest.register_node(":😍", {}) ```
Author
Owner

To place them in the world, do

//lua core.set_node({x=-3, y= 10, z= 368},{name = "\""})
To place them in the world, do ``` //lua core.set_node({x=-3, y= 10, z= 368},{name = "\""}) ```
AliasAlreadyTaken added the
1. kind/meme
label 2024-06-13 17:31:46 +00:00
Author
Owner

According to https://github.com/minetest/minetest/blob/master/doc/lua_api.md?plain=1#L293 there is a node naming convention, which is "enforced by the mod loader". Allowed are modname:[a-zA-Z0-9_]

According to https://github.com/minetest/minetest/blob/master/doc/lua_api.md?plain=1#L293 there is a node naming convention, which is "enforced by the mod loader". Allowed are `modname:[a-zA-Z0-9_]`
Member

Surprising that there is such an explicitly stated convention. But it's also good that it's there. Splitting a node name by : and checking which mod it comes from is pretty common in my mods. The nodenames listed in the issue would be troublesome.

Surprising that there is such an explicitly stated convention. But it's also good that it's there. Splitting a node name by : and checking which mod it comes from is pretty common in my mods. The nodenames listed in the issue would be troublesome.

is it possible to name the node " "(only a space)?

is it possible to name the node " "(only a space)?
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#6947
No description provided.