enchantment

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AquaAffinity aquaAffinity

AquaAffinity is a helmet enchantment that increases underwater mining speed.

View Source
var BlastProtection blastProtection

BlastProtection is an armour enchantment that reduces damage from explosions.

View Source
var CurseOfVanishing curseOfVanishing

CurseOfVanishing is an enchantment that causes the item to disappear on death.

View Source
var DepthStrider depthStrider

DepthStrider is a boot enchantment that increases underwater movement speed.

View Source
var Efficiency efficiency

Efficiency is an enchantment that increases mining speed.

View Source
var FeatherFalling featherFalling

FeatherFalling is an enchantment to boots that reduces fall damage. It does not affect falling speed.

View Source
var FireAspect fireAspect

FireAspect is a sword enchantment that sets the target on fire.

View Source
var FireProtection fireProtection

FireProtection is an armour enchantment that decreases fire damage.

View Source
var Flame flame

Flame turns your arrows into flaming arrows allowing you to set your targets on fire.

View Source
var Infinity infinity

Infinity is an enchantment to bows that prevents regular arrows from being consumed when shot.

View Source
var Knockback knockback

Knockback is an enchantment to a sword that increases the sword's knock-back.

View Source
var Mending mending

Mending is an enchantment that repairs the item when experience orbs are collected.

View Source
var Power power

Power is a bow enchantment which increases arrow damage.

View Source
var ProjectileProtection projectileProtection

ProjectileProtection is an armour enchantment that reduces damage from projectiles.

View Source
var Protection protection

Protection is an armour enchantment which increases the damage reduction.

View Source
var Punch punch

Punch increases the knock-back dealt when hitting a player or mob with a bow.

View Source
var QuickCharge quickCharge

QuickCharge is an enchantment for quickly reloading a crossbow.

View Source
var Respiration respiration

Respiration extends underwater breathing time by +15 seconds per enchantment level in addition to the default time of 15 seconds.

View Source
var Sharpness sharpness

Sharpness is an enchantment applied to a sword or axe that increases melee damage.

View Source
var SilkTouch silkTouch

SilkTouch is an enchantment that allows many blocks to drop themselves instead of their usual items when mined.

View Source
var SoulSpeed soulSpeed

SoulSpeed is an enchantment that can be applied on boots and allows the player to walk more quickly on soul sand or soul soil.

View Source
var SwiftSneak swiftSneak

SwiftSneak is a non-renewable enchantment that can be applied to leggings and allows the player to walk more quickly while sneaking.

View Source
var Thorns thorns

Thorns is an enchantment that inflicts damage on attackers.

View Source
var Unbreaking unbreaking

Unbreaking is an enchantment that gives a chance for an item to avoid durability reduction when it is used, effectively increasing the item's durability.

Functions

func ProtectionFactor added in v0.8.6

func ProtectionFactor(src world.DamageSource, enchantments []item.Enchantment) float64

ProtectionFactor calculates the combined protection factor for a slice of item.Enchantment. The factor depends on the world.DamageSource passed and is in a range of [0, 0.8], where 0.8 means incoming damage would be reduced by 80%.

Types

type AffectedDamageSource added in v0.8.6

type AffectedDamageSource interface {
	world.DamageSource
	// AffectedByEnchantment specifies if a world.DamageSource is affected by
	// the item.EnchantmentType passed.
	AffectedByEnchantment(e item.EnchantmentType) bool
}

AffectedDamageSource represents a world.DamageSource whose damage may be affected by an enchantment. A world.DamageSource does not need to implement AffectedDamageSource to let protection affect the damage. This happens depending on the (world.DamageSource).ReducedByResistance() method.

type DamageModifier added in v0.8.6

type DamageModifier interface {
	Modifier() float64
}

DamageModifier is an item.EnchantmentType that can reduce damage through a modifier if an AffectedDamageSource returns true for it.

type ThornsDamageSource added in v0.8.6

type ThornsDamageSource struct {
	// Owner is the owner of the armour with the thorns enchantment.
	Owner world.Entity
}

ThornsDamageSource is used for damage caused by thorns.

func (ThornsDamageSource) Fire added in v0.8.6

func (ThornsDamageSource) Fire() bool

func (ThornsDamageSource) ReducedByArmour added in v0.8.6

func (ThornsDamageSource) ReducedByArmour() bool

func (ThornsDamageSource) ReducedByResistance added in v0.8.6

func (ThornsDamageSource) ReducedByResistance() bool

Jump to

Keyboard shortcuts

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