damage

package
v0.0.0-...-d1826b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2022 License: AGPL-3.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source interface {
	// ReducedByArmour checks if the source of damage may be reduced if the receiver of the damage is wearing
	// armour.
	ReducedByArmour() bool
}

Source represents the source of the damage dealt to an entity. This source may be passed to the Hurt() method of an entity in order to deal damage to an entity with a specific source.

type SourceCustom

type SourceCustom struct{}

SourceCustom is a cause used for dealing any kind of custom damage. Armour reduces damage of this source, but otherwise no enchantments have an additional effect.

func (SourceCustom) ReducedByArmour

func (SourceCustom) ReducedByArmour() bool

ReducedByArmour ...

type SourceEntityAttack

type SourceEntityAttack struct {
	// Attacker holds the attacking entity. The entity may be a player or any other entity.
	Attacker world.Entity
}

SourceEntityAttack is used for damage caused by other entities, for example when a player attacks another player.

func (SourceEntityAttack) ReducedByArmour

func (SourceEntityAttack) ReducedByArmour() bool

ReducedByArmour ...

type SourceFall

type SourceFall struct{}

SourceFall is a source that is used if the player fell.

func (SourceFall) ReducedByArmour

func (SourceFall) ReducedByArmour() bool

ReducedByArmour ...

type SourceFire

type SourceFire struct{}

SourceFire is used for damage caused by being in fire.

func (SourceFire) ReducedByArmour

func (SourceFire) ReducedByArmour() bool

ReducedByArmour ...

type SourceFireTick

type SourceFireTick struct{}

SourceFireTick is used for damage caused by being on fire.

func (SourceFireTick) ReducedByArmour

func (SourceFireTick) ReducedByArmour() bool

ReducedByArmour ...

type SourceInstantDamageEffect

type SourceInstantDamageEffect struct{}

SourceInstantDamageEffect is used for damage caused by an effect.InstantDamage applied to an entity.

func (SourceInstantDamageEffect) ReducedByArmour

func (SourceInstantDamageEffect) ReducedByArmour() bool

ReducedByArmour ...

type SourceLava

type SourceLava struct{}

SourceLava is used for damage caused by being in lava.

func (SourceLava) ReducedByArmour

func (SourceLava) ReducedByArmour() bool

ReducedByArmour ...

type SourceLightning

type SourceLightning struct{}

SourceLightning is used for damage caused by being struck by lightning.

func (SourceLightning) ReducedByArmour

func (SourceLightning) ReducedByArmour() bool

ReducedByArmour ...

type SourcePoisonEffect

type SourcePoisonEffect struct {
	// Fatal specifies if the damage was caused by effect.FatalPoison or not.
	Fatal bool
}

SourcePoisonEffect is used for damage caused by an effect.Poison or effect.FatalPoison applied to an entity.

func (SourcePoisonEffect) ReducedByArmour

func (SourcePoisonEffect) ReducedByArmour() bool

ReducedByArmour ...

type SourceStarvation

type SourceStarvation struct{}

SourceStarvation is used for damage caused by a completely depleted food bar.

func (SourceStarvation) ReducedByArmour

func (SourceStarvation) ReducedByArmour() bool

ReducedByArmour ...

type SourceVoid

type SourceVoid struct{}

SourceVoid is used for damage caused by an entity being in the void.

func (SourceVoid) ReducedByArmour

func (SourceVoid) ReducedByArmour() bool

ReducedByArmour ...

type SourceWitherEffect

type SourceWitherEffect struct{}

SourceWitherEffect is used for damage caused by an effect.Wither applied to an entity.

func (SourceWitherEffect) ReducedByArmour

func (SourceWitherEffect) ReducedByArmour() bool

ReducedByArmour ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL