Started by
ItzYaBoiMyth
on
Topic category: Help with Minecraft modding (Java Edition)
How would one go about granting an item on world generation? Ive taken a look through procedures and nothing really pokes out that should work. Im more than likely missing something here but any help would be appreciated.
Edited by ItzYaBoiMyth on Fri, 02/19/2021 - 10:31
Make a new procedure and set the global trigger to "Player joins the world" then add the (set 1 item is slot of provided itemstack) procedure, so it will detect the player's inventory upon spawn and grant the item in the specified slot. Hope this helped :)
ive done this, but it grants the item every time the player logs on.
you can create a player persistent logic variable in the variables tab of the workspace. make it so your give code is inside of an if block detecting whether or not the variable is false. if it is false, give the player the item and set the variable to true.
Makes an global variable with Type Logic and choose Player Persistent in the Variable Scope.
Here I take an Screenshot to show you how do you grant Items on player join the world once:
It checks if the global variable with Type Logic and has Variable Scope Player Persistent is false it will add Items and set the variable to true to prevent Procedure to Grant Item again.
worked perfectly. thanks!
And I give an extra tip: To make variables they change in GUI, make sure that the variable has Variable Scope Global Map, because Player Persistent will give every Player this Variable.