Page 1 of 1

Item Nodebox

PostPosted: Wed Oct 19, 2016 16:24
by jordan4ibanez
Is there any way to sneak code into an item's definition to give it a nodebox?

Re: Item Nodebox

PostPosted: Wed Oct 19, 2016 17:01
by bigfoot547
Do you mean having the inventory image look like a nodebox?

If so, I have a cheaty way of doing it.
Define a node, then define the item and set the inventory and wield image to the respective images with the node. Example:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("example:node", {
   drawtype = "nodebox",
   tiles = {--[[insert the tiles here--]]},
   paramtype = "light",
   node_box = {
      type = "fixed",
      fixed = {
         {--[[insert the nodebox definition here--]]}
      }
   },
   groups = {not_in_creative_inventory = true}
})

minetest.register_craftitem("example:item", {
   --Insert the definition here
   wield_image = minetest.registered_nodes["example:node"].wield_image,
   inventory_image = minetest.registered_nodes["example:node"].inventory_image,
})

This may or may not work.
It is kind of a cheaty way of doing this.