Want Help In Commands For A Datapack
So, I am new in the datapack field never made any but I am making one for a server and I need help in how the commands work and stuff like i know basics of commands how they work but its not enough to make my datapack.
I want to make a datapack where when a player dies he loses 0.1 strength using the attributes command, and drops a custom book when picked up by a player it will clear the book from the inv and give that player +0.1 strength, but i cant seem to figure out the commands and and stuff for it it tried using this:
First I tried to summon a book with this cmd -
/execute as @r unless items entity @s inventory.* minecraft:knowledge_book[minecraft:custom_data={display:{Name:'{"text":"+0.1 Strength"}'},CustomTag:"first"}] run tellraw @a "hi test"
Then i tried to detect it in the players inv and run a test command but it passes the condition and still runs the test cmd even though I don't have any book -
/execute as @r unless items entity @s inventory.* minecraft:knowledge_book[minecraft:custom_data={display:{Name:'{"text":"+0.1 Strength"}'},CustomTag:"first"}]
also i am trying to make it so that a player cant go above 2.0 health if he reaches that point he can't gain more strength and the book will just store in his inv and lowest the strength can get is 0.4
Continue to help post