minetest.raillike group

Creates or retrieves a rating value based on a name, for use with the  group in minetest.register_node.

Description
When defining a node, the  group requires a numeric rating value, so that nodes with the same rating can connect together (like rails do when placing them next to each other). This function registers (if it does not exist) or retrieves (if it already exists) a rating value based on a name, and returns it. That name can be shared by multiple mods, so that all mods that use the same name will be assigned the same rating value.

Example
This code will create a node "my_mod:my_gunpowder" that will be able to connect to any nodes that used the name "gunpowder" to invoke this function, like the TNT mod in the Minetest game, but won't be able to connect to any nodes that used a different name, even if adjacent: