Auto adding stuff to players inventory upon joining

jeremyericson
Member
 
Posts: 12
Joined: Mon May 20, 2019 22:51
Location: VE-servers
GitHub: CodingPsych
IRC: alepfwxz
In-game: 6789alepfwxz

Auto adding stuff to players inventory upon joining

by jeremyericson » Tue Aug 20, 2019 23:28

Hey, lots of servers I've joined automatically add stuff to my inv, like a set of steel tools or sticks or something. I was wondering how to do that to my own server. can someone tell me how??
 

Eran
Member
 
Posts: 58
Joined: Fri May 03, 2019 16:46

Re: Auto adding stuff to players inventory upon joining

by Eran » Wed Aug 21, 2019 07:42

You can use the give_initial_stuff mod which is included in minetest game.
To enable it go to your minetest.conf file and add the line
Code: Select all
give_initial_stuff=true


To change the items you get, you can change the initial stuff setting in your minetest.conf to a comma separated list of ItemStrings.
An ItemString has this format: <identifier> [amount [wear]]
<identifier> is the technical name of an item. Its format is modname:itemname, so for example default:stone. You can look them up on the wiki for minetest game mods or by guessing, digging in the code or by asking.
amount and wear are both optional as signified by the square brackets. You can only specify a wear if it's a tool and if you also specify an amount. There is a paragraph about how wear works in the Minetest Modding Book

Some example ItemStrings woud be default:pick_diamond 1 32767(one half broken diamond pick)
default:stone 10(10 stone)
ItemStrings are also used for /give so you can try out if they work more easily that way.

To give these example items as initial stuff put this in your minetest.conf:
Code: Select all
initial_stuff=default:pick_diamond 1 32767,default:stone 10
 

jeremyericson
Member
 
Posts: 12
Joined: Mon May 20, 2019 22:51
Location: VE-servers
GitHub: CodingPsych
IRC: alepfwxz
In-game: 6789alepfwxz

Re: Auto adding stuff to players inventory upon joining

by jeremyericson » Wed Aug 21, 2019 15:59

Hey, thanks a lot, that was a huge help ;)
Also, how do I auto-add privs to a new player?
 

Eran
Member
 
Posts: 58
Joined: Fri May 03, 2019 16:46

Re: Auto adding stuff to players inventory upon joining

by Eran » Wed Aug 21, 2019 18:10

In your minetest.conf write default_privs = priv1, priv2, priv3...
You can look up a bunch of settings like this in the minetest.conf.example file.
 

jeremyericson
Member
 
Posts: 12
Joined: Mon May 20, 2019 22:51
Location: VE-servers
GitHub: CodingPsych
IRC: alepfwxz
In-game: 6789alepfwxz
 


Return to Problems



Who is online

Users browsing this forum: No registered users and 3 guests