Item at the beginning of the game.

Started by Demon_Cry on Sun, 09/08/2019 - 06:24

Topic category: Help with MCreator's application

Last seen on 09:08, 13. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Item at the beginning of the game.
Sun, 09/08/2019 - 06:24

How to make sure that the item was in the inventory at the beginning of the game.

Use on player joins the…
Sun, 09/08/2019 - 09:37

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

Last seen on 19:03, 14. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
First, look all the way on…
Sun, 09/08/2019 - 16:38

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!

Last seen on 19:28, 14. Oct 2019
Joined Jun 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Better to use entity nbt…
Mon, 09/09/2019 - 15:24

Better to use entity nbt than global variables.

StellaeLux, nice tutorial :)…
Mon, 09/09/2019 - 16:26

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

Last seen on 19:03, 14. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Take what you like (: I'll…
Sun, 09/15/2019 - 07:01

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…
Sun, 09/15/2019 - 08:20

Cool, although the wiki is text based, but can contain videos too.