Update 1.20 commands to 1.21.5
execute as @a[nbt={Inventory:[{tag:{Enchantments:[{id:"minecraft:thorns"}]}}]}] at @s run function anticheat:cooldown
execute as @a[nbt={Inventory:[{id:"minecraft:knowledge_book"}]}] at @s run function anticheat:main
execute as @a unless data entity @s Inventory[{tag:{Enchantments:[{id:"minecraft:thorns"}]}}] run scoreboard players set @s cooldown 1