Easiest way to find out the node name?

User avatar
JMR
Member
 
Posts: 32
Joined: Sun May 19, 2013 11:31

Easiest way to find out the node name?

by JMR » Sun Dec 08, 2013 22:43

For barter shops Etc, you need to know the node name. If the tekkit mod isn't enabled, then I can't find a way to easily find the node name.

I know you can look inside the lua files, but that takes a while and if the mod isn't on your local machine then what?

Does anyone know an easy method to get a node's name?
 

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

by Evergreen » Sun Dec 08, 2013 22:57

JMR wrote:For barter shops Etc, you need to know the node name. If the tekkit mod isn't enabled, then I can't find a way to easily find the node name.

I know you can look inside the lua files, but that takes a while and if the mod isn't on your local machine then what?

Does anyone know an easy method to get a node's name?
None that I know of. There should be a command which gets the pointed block and prints the node name into the chat.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Mon Dec 09, 2013 01:57

There's also Dan Duncombe's currency mod which allows to edit the shop visually by dragging the items around instead of having to enter the item name.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Mon Dec 09, 2013 09:44

Evergreen wrote:There should be a command which gets the pointed block and prints the node name into the chat.

I wanted to do a mod like that some time ago, but the problem is, that there is no way I know of on how to get the pointed node. (Except punching.)

For items in the inventory take 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_chatcommand("getinfo_item", {
    params = "",
    description = "name of item in hand",
    privs = {},
    func = function(name, param)
        local player = minetest.get_player_by_name(name)
        if player == nil then
            minetest.log("error", "Unable to get info, player is nil")
            return true -- Handled chat message
        end
        if player:get_wielded_item():is_empty() then
            minetest.chat_send_player(name, 'Unable to get info, no item in hand.')
        else
            local item_name = player:get_wielded_item():get_name()
            local item_count = player:get_wielded_item():get_count()
            local item_wear = player:get_wielded_item():get_wear()
            minetest.chat_send_player(name, 'get info: name = '.. item_name ..', count = '.. item_count ..', wear = '.. item_wear ..'')
        end
    end,
})
Last edited by Casimir on Mon Dec 09, 2013 10:00, edited 1 time in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Mon Dec 09, 2013 15:33

Or add an item, which is pointable to everything, could easily work with: on_use = { send nodename to player }
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

by Evergreen » Mon Dec 09, 2013 16:15

Krock wrote:Or add an item, which is pointable to everything, could easily work with: on_use = { send nodename to player }
Someone already made a mod that has a tool which gets the node name, but I was thinking of a command. I think there should be some sort of minetest.get_pointed_thing()
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 


Return to Minetest General

Who is online

Users browsing this forum: Bing [Bot] and 13 guests

cron