0

I am trying to make a shop. This is my code but it's not working

/execute as @a unless entity @s[team=blue,nbt={Inventory:[{id:"minecraft:diamond",Count:2b}]}] unless entity @s[team=blue,nbt={Inventory:[{id:"minecraft:diamond",Count:1b}]}] unless entity @s[team=blue,nbt={Inventory:[{id:"minecraft:diamond",Count:3b}]}] if entity @s[team=blue,nbt={Inventory:[{id:"minecraft:diamond"}]}]

Expanded:

/execute as @a
    unless entity @s[team=blue,nbt=
    {
        Inventory:[{id:"minecraft:diamond",Count:2b}]
    }]
    unless entity @s[team=blue,nbt=
    {
        Inventory:[{id:"minecraft:diamond",Count:1b}]
    }]
    unless entity @s[team=blue,nbt=
    {
        Inventory:[{id:"minecraft:diamond",Count:3b}]
    }]
    if entity @s[team=blue,nbt=
    {
        Inventory:[{id:"minecraft:diamond"}]
    }]

What that is supposed to do is give an output when you have at least 4 items. It just doesn't work.

  • Well, the first problem is there's now run <second command>, so I'm not surprised this command isn't doing anything to begin with. More importantly though, this isn't how you count how the number of a particular item a player has. – MBraedley Sep 25 '19 at 19:23
  • 1
    I didn't have a run command because i was using a comparator from it. How do you count the number of items a player has @MBraedley? – tanner Sep 25 '19 at 19:59
  • 3