Page 1 of 1

[Help] Item not loaded, using method minetest.register_craftitem

PostPosted: Sun May 05, 2013 17:31
by DoctorFool
First of all, hello.
I decided to add aluminium to the mod "MoreOres". Tools, ores, etc. works perfectly. Problem came when I wanted to add some aluminium items. I wanted to add aluminium bars, so I wrote that:
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_craftitem("moreores:aluminium_bars", {
        description = "Aluminium bars",
    inventory_image = {"moreores_aluminium_bars.png"},
})

And here is the craft recipe:
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_craft({
    output="'moreores:aluminium_bars' 16",
    recipe = {{"moreores:aluminium_ingot", "", ""},
               {"moreores:aluminium_ingot", "", ""},
               {"", "", ""}}
})


When I put 2 aluminium ingots together and craft them, I obtain an "unknown item". Pressing right button of the mouse when having the item in my hand makes the server broadcast this message: ERROR[ServerThread]:Item "moreores:aluminium_bars" not defined.
I tried to search if someone had this issue, but I couldn't find anything on the Internet. Any idea?

PostPosted: Sun May 05, 2013 17:59
by Evergreen
1. This:
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_craftitem("moreores:aluminium_bars", {
    description = "Aluminium bars",
    inventory_image = {"moreores_aluminium_bars.png"},
})


Should be this:

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_craftitem("moreores:aluminium_bars", {
    description = "Aluminium bars",
    inventory_image = "moreores_aluminium_bars.png",
})


2.This:

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_craft({
    output="'moreores:aluminium_bars' 16",
    recipe = {{"moreores:aluminium_ingot", "", ""},
               {"moreores:aluminium_ingot", "", ""},
               {"", "", ""}}
})


Should be this:

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_craft({
    output='moreores:aluminium_bars 16',
    recipe = {
                {'moreores:aluminium_ingot', '', ''},
                {'moreores:aluminium_ingot', '', ''},
                {'', '', ''},
    }         
})


Hope it helped. :D

PostPosted: Sun May 05, 2013 18:11
by Evergreen
No, I edited my post, try again (and you were right about aluminium)

PostPosted: Sun May 05, 2013 18:19
by DoctorFool
It seems to be working, thanks a lot :D
Now I have a problem with rendering xD
Image
This is the node declaration:
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("moreores:aluminum_scaffold",
    {
        tiles={"moreores_aluminum_scaffold.png"},
        groups={snappy=1, choppy=1, oddly_breakable_by_hand=1, flammable=0},
        drawtype = "all_faces",
        use_alpha_channel=true,
        climbable=true
    })


PostPosted: Sun May 05, 2013 18:19
by DoctorFool
lol I just saw now that I was right about aluminium spelling. I'll have to change it again xD

PostPosted: Sun May 05, 2013 18:26
by PilzAdam
The drawtype is called "allfaces" and not "all_faces".

PostPosted: Sun May 05, 2013 18:36
by DoctorFool
PilzAdam wrote:The drawtype is called "allfaces" and not "all_faces".

Ah, ok. Thanks.