execute at @s run summon area_effect_cloud ^ ^-1 ^1.5 {Duration:1200,PersistenceRequired:1,CustomName:"\"stick\"",Silent:1,NoAI:1,Invisible:1b,NoBasePlate:1b,NoGravity:1b}

execute at @s run fill ~2 ~ ~2 ~-2 ~3 ~-2 air replace barrier
execute at @s[nbt={SelectedItem:{tag:{type:1}}}] if block ~ ~-1 ~ barrier run particle witch ~ ~-0.3 ~ 0.3 0 0.3 0.1 3 force @a
execute at @s[nbt={SelectedItem:{tag:{type:2}}}] if block ~ ~-1 ~ barrier run particle flame ~ ~-0.3 ~ 0.3 0 0.3 0.1 3 force @a
execute at @s[nbt={SelectedItem:{tag:{type:3}}}] if block ~ ~-1 ~ barrier run particle item ice ~ ~-0.3 ~ 0.3 0 0.3 0.1 3 force @a

execute at @s if block ~ ~-1 ~ barrier run effect give @s speed 1 3 true
execute at @s[scores={asneak=1..},nbt={SelectedItem:{tag:{type:1}}}] run function aop1:sneak
execute at @s[scores={asneak=1..},nbt={SelectedItem:{tag:{type:2}}}] run function aop1:sneak1
execute at @s[scores={asneak=1..},nbt={SelectedItem:{tag:{type:3}}}] run function aop1:sneak2