Auto adding stuff to players inventory upon joining

Post Reply
jeremyericson
Member
Posts: 21
Joined: Mon May 20, 2019 22:51
GitHub: CodingPsych
IRC: alepfwxz
In-game: 6789alepfwxz
Location: On my chair

Auto adding stuff to players inventory upon joining

by jeremyericson » Post

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: 123
Joined: Fri May 03, 2019 16:46

Re: Auto adding stuff to players inventory upon joining

by Eran » Post

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: 21
Joined: Mon May 20, 2019 22:51
GitHub: CodingPsych
IRC: alepfwxz
In-game: 6789alepfwxz
Location: On my chair

Re: Auto adding stuff to players inventory upon joining

by jeremyericson » Post

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

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

Re: Auto adding stuff to players inventory upon joining

by Eran » Post

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: 21
Joined: Mon May 20, 2019 22:51
GitHub: CodingPsych
IRC: alepfwxz
In-game: 6789alepfwxz
Location: On my chair

Re: Auto adding stuff to players inventory upon joining

by jeremyericson » Post

Ah, thanks a lot!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests