Minecraft effect command 1.15.2 inventory check?

ha
- in Servers
16

Dear community!

I want to use a specific command on my server, but somehow I can't get it to work.

I want every player who has stick {Enchantments: [{id: knockback, lvl: 3}]} in their inventory to get minecraft: jump_boost 999999 4.

I've been chopping there for several hours now and just can't make it.

an

Execute as @a [nbt = {Inventory: [{id: "minecraft: stick", Count: 1b, Enchantments: [{id: knockback, lvl: 3}]}]}] run effect @s jumpboost 999999 4

something like that - I'm sure not quite true, was out of my head, but it should look something like this.

ha

Many thanks for the answer!
It doesn't show any errors in the CommandBlock, but unfortunately it still doesn't work: /

Maybe that's because of the server.

Have the command block on Always Active and repeat

an

Try it piece by piece.

So delete that with "Enchantments:." get out and see if it just goes with a stick.

ha

Now it works!

gl

Are you sure there's a jumpboost effect? Also in 1.15.2?

gl

How can you make it so that when a player wears diamond shoes, they get the effect?

an

/ execute as @a [nbt = {Inventory: [{Slot: 100b, id: "minecraft: diamond_boots"}]}] run effect @s minecraft: jump_boost 10 4

gl

Honor
How do you know that the shoe slot is 100b?

an

Googled it. "Minecraft execute if player wearing shoes"

gl

How can you make it so that if the diamond shoes have the name "Yeezys" that you wear, you will get an effect? The command doesn't work for me

Be

/ execute as @a [nbt = {Inventory: [{id: "minecraft: stick", tag: {Enchantments: [{id: "minecraft: knockback", lvl: 3s}]}}]}] run effect give @ s minecraft: jump_boost 255 4 false

Oh yes Jump Boost 999999 makes no sense. 255 is the maximum that goes with effects.

an

I think he found out himself when he replied to me "now it works"

an

/ execute as @a [nbt = {Inventory: [{Slot: 100b, id: "minecraft: diamond_boots", tag: {display: {Name: "{\" text \ ": \" Yeezys \ "}"}}} }]}] run effect @s minecraft: jump_boost 10 4

Be

So I see it differently

It doesn't show any errors in the CommandBlock, but unfortunately it still doesn't work: /

an

Two answers below.

Reading has to be learned 🤷🏻♂️

Be

Huch the comment was not displayed at first