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

DoctorFool
Member
 
Posts: 20
Joined: Sat May 04, 2013 20:49
GitHub: shamoanjac
IRC: shamoanjac
In-game: shamoanjac

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

by DoctorFool » Sun May 05, 2013 17:31

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?
Last edited by DoctorFool on Sun May 05, 2013 17:40, edited 1 time in total.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sun May 05, 2013 17:59

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
Last edited by Evergreen on Sun May 05, 2013 18:10, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sun May 05, 2013 18:11

No, I edited my post, try again (and you were right about aluminium)
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

DoctorFool
Member
 
Posts: 20
Joined: Sat May 04, 2013 20:49
GitHub: shamoanjac
IRC: shamoanjac
In-game: shamoanjac

by DoctorFool » Sun May 05, 2013 18:19

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
    })

 

DoctorFool
Member
 
Posts: 20
Joined: Sat May 04, 2013 20:49
GitHub: shamoanjac
IRC: shamoanjac
In-game: shamoanjac

by DoctorFool » Sun May 05, 2013 18:19

lol I just saw now that I was right about aluminium spelling. I'll have to change it again xD
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun May 05, 2013 18:26

The drawtype is called "allfaces" and not "all_faces".
 

DoctorFool
Member
 
Posts: 20
Joined: Sat May 04, 2013 20:49
GitHub: shamoanjac
IRC: shamoanjac
In-game: shamoanjac

by DoctorFool » Sun May 05, 2013 18:36

PilzAdam wrote:The drawtype is called "allfaces" and not "all_faces".

Ah, ok. Thanks.
Last edited by DoctorFool on Sun May 05, 2013 18:37, edited 1 time in total.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests

cron