If Global tag = true then give player item when key is pressed otherwise dont.

Started by BlaBlaSillySheep on Tue, 09/01/2020 - 22:16

Topic category: Help with modding (Java Edition)

Last seen on 17:20, 26. Oct 2020
Joined Apr 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
If Global tag = true then give player item when key is pressed otherwise dont.
Tue, 09/01/2020 - 22:16

Hey there!

So i'm trying to make a mod that makes it so that if you are infected it lets you summon an item by pressing a key. I know it is possible with procedures and nbt tags im just not sure how i have got the body done its just the nbt tag bit im stuck on. Heres what it looks like:
 

If -  (The bit im stuck on, I've tried global variables but i think that will affect ALL players if 1 player is infected)

do- If - true

      do - Add 1 (item) to players inventory.

Else - If - false

          do - print - "You do not have correct permissions!" <------- (not sure about this cause it will print in the console [I think])

 

Any ideas?

 

Last seen on 17:20, 26. Oct 2020
Joined Apr 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Dont worry figured it out, i…
Wed, 09/02/2020 - 01:39

Dont worry figured it out, i added the nbt tag to player when it ate something and its working just fine, now i have to find out how to make it so that if more than one of the same item is in the inventory it will remove it