I request to make this check one level higher, make it work for all selection tools.
Most modded selection tools, like the vanilla ones, are free to create using the shortcut bar. If they are created this way this value will already be set to true even though it is not one of the above types:

So would be nice to have this same behaviour when the item is created elsewhere.
Usecase:
The following code
Code: Select all
player.clear_cursor()
local inventory = player.get_main_inventory()
local item_stack = inventory.find_item_stack(selection_tool)
if item_stack then
item_stack.swap_stack(player.cursor_stack)
else
player.cursor_stack.set_stack({name=selection_tool})
end
Code: Select all
player.clear_cursor()
player.cursor_stack.set_stack({name=selection_tool})
player.cursor_stack_temporary=true