First, look all the way on the left of your screen. There's a tab that says "Global variables". Click it.
Press "Add new variable".
Give it a name. Variable type = Logic. Variable scope = Global_session.
Now go back to the Mod Element tab.
Press the green + symbol and select "Procedure". Give it a name.
You should see a green thing saying: "Event Trigger - triggered by external call or when: No additional trigger".
Change "No additional trigger" to "Player joins the world".
[Inside Logic and Loops] Drag in the "If do".
[inside Logic Operations] Drag in the purple thing that goes like this: "empty = empty". Click it inside of the "If" part.
[Inside Custom Variables] Drag in the purple "Get" inside of the first empty slot of your purple "empty = empty".
[Inside Math] Select the top option, which is simply a number. In this case 0. Drag it to the 2nd empty slot of "empty = empty".
Now we come to the "do" part of the "If, do".
[Inside Player Procedures] Drag in "Add 1 empty to provided (entity)players inventory". Place this inside of your "do" part. If you want multiple type of items in someone's inventory, copy this part multiple times. Inside the yellow empty block you can select WHAT block you want to give the player. In the number before it, you can select how many of that item.
If you've been copying and pasting this part until you have all the items you want to give the player, do the following:
[Inside Custom Variables] Drag in the purple "Set ... to:". Place it inside of the "do" part.
[Inside Math] drag in another number and set it to 1. Click it inside of the "Set ... to" 1.
Inside of the purple Get and Set, make sure you have selected the name of the global variable you created at the very start.
Use on player joins the world procedure global trigger and give item to the player using procedures.
I suggest you to check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei
First, look all the way on the left of your screen. There's a tab that says "Global variables". Click it.
Press "Add new variable".
Give it a name. Variable type = Logic. Variable scope = Global_session.
Now go back to the Mod Element tab.
Press the green + symbol and select "Procedure". Give it a name.
You should see a green thing saying: "Event Trigger - triggered by external call or when: No additional trigger".
Change "No additional trigger" to "Player joins the world".
[Inside Logic and Loops] Drag in the "If do".
[inside Logic Operations] Drag in the purple thing that goes like this: "empty = empty". Click it inside of the "If" part.
[Inside Custom Variables] Drag in the purple "Get" inside of the first empty slot of your purple "empty = empty".
[Inside Math] Select the top option, which is simply a number. In this case 0. Drag it to the 2nd empty slot of "empty = empty".
Now we come to the "do" part of the "If, do".
[Inside Player Procedures] Drag in "Add 1 empty to provided (entity)players inventory". Place this inside of your "do" part. If you want multiple type of items in someone's inventory, copy this part multiple times. Inside the yellow empty block you can select WHAT block you want to give the player. In the number before it, you can select how many of that item.
If you've been copying and pasting this part until you have all the items you want to give the player, do the following:
[Inside Custom Variables] Drag in the purple "Set ... to:". Place it inside of the "do" part.
[Inside Math] drag in another number and set it to 1. Click it inside of the "Set ... to" 1.
Inside of the purple Get and Set, make sure you have selected the name of the global variable you created at the very start.
You procedure should now look like this:
--------------------------------------------------------------------------------------------------------------------------------
Event trigger when Player join the world.
if Get globalvariable = 0
do add 1 (item you want) to provided (entity)players inventory
add 1 (item you want) to provided (entity)players inventory
add 1 (item you want) to provided (entity)players inventory
add 1 (item you want) to provided (entity)players inventory
add 1 (item you want) to provided (entity)players inventory
Set globalvariable to 1
--------------------------------------------------------------------------------------------------------------------------------
Save your mod element and you're finished!
Watch this 1 minute tutorial:
https://www.youtube.com/watch?v=NNR1PeLW3uw
Better to use entity nbt than global variables.
StellaeLux, nice tutorial :) Sir cookie is right, if you use NBT variables, it will work for each entity, not just once.
I will add some of your tutorials from YouTube to our tutorials collection.
As I see you like doing tutorials like this, if you are interested, you can submit for a wiki contributor here: https://mcreator.net/page/wiki-contributors
Take what you like (:
I'll consider wiki contributer when I have better recording quality and/or a mic. Currently I'm using an outdated mac, haha
Cool, although the wiki is text based, but can contain videos too.