github.com/df-mc/dragonfly@v0.9.13/server/entity/action.go (about) 1 package entity 2 3 import ( 4 "github.com/df-mc/dragonfly/server/world" 5 "time" 6 ) 7 8 // SwingArmAction is a world.EntityAction that makes an entity or player swing its arm. 9 type SwingArmAction struct{ action } 10 11 // HurtAction is a world.EntityAction that makes an entity display the animation for being hurt. The entity will be 12 // shown as red for a short duration. 13 type HurtAction struct{ action } 14 15 // CriticalHitAction is a world.EntityAction that makes an entity display critical hit particles. This will show stars 16 // around the entity. 17 type CriticalHitAction struct{ action } 18 19 // DeathAction is a world.EntityAction that makes an entity display the death animation. After this animation, the 20 // entity disappears from viewers watching it. 21 type DeathAction struct{ action } 22 23 // EatAction is a world.EntityAction that makes an entity display the eating particles at its mouth to viewers with the 24 // item in its hand being eaten. 25 type EatAction struct{ action } 26 27 // ArrowShakeAction makes an arrow entity display a shaking animation for the given duration. 28 type ArrowShakeAction struct { 29 // Duration is the duration of the shake. 30 Duration time.Duration 31 32 action 33 } 34 35 // PickedUpAction is a world.EntityAction that makes an item get picked up by a collector. After this animation, the 36 // item disappears from viewers watching it. 37 type PickedUpAction struct { 38 // Collector is the entity that collected the item. 39 Collector world.Entity 40 41 action 42 } 43 44 // FireworkExplosionAction is a world.EntityAction that makes a Firework rocket display an explosion particle. 45 type FireworkExplosionAction struct{ action } 46 47 // action implements the Action interface. Structures in this package may embed it to gets its functionality 48 // out of the box. 49 type action struct{} 50 51 func (action) EntityAction() {}