How do I give particle effects to my dog in Minecraft?
First of all, those are wolves, not dogs.
Wolves walking detection
There exists a scoreboard variable that detects if entities walked one cm.
scoreboard objectives add walk custom:walk_one_cm
Adding a walking variable called walk
I would suggest for you to create a datapack in this case, since this involves constant manipulation of variables which would be laggy and hard to accomplish by using in-game command blocks. The general plan:
Repeat Unconditional
execute as @e[type=wolf,scores={walk=1..}] run say ParticleEffect
Chained Conditional
execute as @e[type=wolf] run scoreboard players reset @s walk
Attacking
Similarly, create an attack objective
scoreboard objectives add attack custom:damage_dealt
Repeat Unconditional
execute as @e[type=wolf,scores={attack=1..}] run say PetAttackingParticle
chained Conditional
execute as @e[type=wolf] run scoreboard players reset @s attack
Feeding I am not quite sure about this one since I cannot find a scoreboard obj associated with the action of feeding. Perhaps you should use objectives to detect the health change of the wolf, which would require 2 objectives one recording the health value of the wolf from the previous tick and see if the current objective matches the previous objective value. I assume that only by feeding can you increase the wolf's health in vanilla (save for health potions) so that should do the task for you. It would be pretty difficult to actually execute but I can provide you help if you are hell-bent on getting a feeding particle effect.
How to use /particle
WIth the addition of several new particles in 1.17 and 1.18 the syntax and arguments required for some specific particles such as dust and vibration is more complex, but generally you have to fill in particle name
, position at which to execute the particle effect (relative)
, the coordinates displacements in x y z from the origin to the ending point of the particle
, speed of particle
, particle count
. I believe the Minecraft Wiki would be better if you are looking for detailed explanations.