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

Started by BlaBlaSillySheep on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If Global tag = true then give player item when key is pressed otherwise dont.

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?

 

Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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