Files
TarnaWijaya 26ed99fda6
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
up3
2026-07-09 08:33:57 +08:00

67 lines
2.2 KiB
Go

package entity
import (
"github.com/df-mc/dragonfly/server/world"
"time"
)
// SwingArmAction is a world.EntityAction that makes an entity or player swing its arm.
type SwingArmAction struct{ action }
// HurtAction is a world.EntityAction that makes an entity display the animation for being hurt. The entity will be
// shown as red for a short duration.
type HurtAction struct{ action }
// CriticalHitAction is a world.EntityAction that makes an entity display critical hit particles. This will show stars
// around the entity.
type CriticalHitAction struct {
action
// Count is the count of particles around the entity.
Count int
}
// EnchantedHitAction is a world.Action that makes an entity display enchanted hit particles. This will show circles
// around the entity.
type EnchantedHitAction struct {
action
// Count is the count of particles around the entity.
Count int
}
// DeathAction is a world.EntityAction that makes an entity display the death animation. After this animation, the
// entity disappears from viewers watching it.
type DeathAction struct{ action }
// EatAction is a world.EntityAction that makes an entity display the eating particles at its mouth to viewers with the
// item in its hand being eaten.
type EatAction struct{ action }
// ArrowShakeAction makes an arrow entity display a shaking animation for the given duration.
type ArrowShakeAction struct {
// Duration is the duration of the shake.
Duration time.Duration
action
}
// PickedUpAction is a world.EntityAction that makes an item get picked up by a collector. After this animation, the
// item disappears from viewers watching it.
type PickedUpAction struct {
// Collector is the entity that collected the item.
Collector world.Entity
action
}
// FireworkExplosionAction is a world.EntityAction that makes a Firework rocket display an explosion particle.
type FireworkExplosionAction struct{ action }
// TotemUseAction is a world.EntityAction that displays the totem use particles and animation.
type TotemUseAction struct{ action }
// action implements the Action interface. Structures in this package may embed it to gets its functionality
// out of the box.
type action struct{}
func (action) EntityAction() {}