Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AquaAffinity aquaAffinity
AquaAffinity is a helmet enchantment that increases underwater mining speed.
var BlastProtection blastProtection
BlastProtection is an armour enchantment that reduces damage from explosions.
var CurseOfVanishing curseOfVanishing
CurseOfVanishing is an enchantment that causes the item to disappear on death.
var DepthStrider depthStrider
DepthStrider is a boot enchantment that increases underwater movement speed.
var Efficiency efficiency
Efficiency is an enchantment that increases mining speed.
var FeatherFalling featherFalling
FeatherFalling is an enchantment to boots that reduces fall damage. It does not affect falling speed.
var FireAspect fireAspect
FireAspect is a sword enchantment that sets the target on fire.
var FireProtection fireProtection
FireProtection is an armour enchantment that decreases fire damage.
var Flame flame
Flame turns your arrows into flaming arrows allowing you to set your targets on fire.
var Infinity infinity
Infinity is an enchantment to bows that prevents regular arrows from being consumed when shot.
var Knockback knockback
Knockback is an enchantment to a sword that increases the sword's knock-back.
var Mending mending
Mending is an enchantment that repairs the item when experience orbs are collected.
var Power power
Power is a bow enchantment which increases arrow damage.
var ProjectileProtection projectileProtection
ProjectileProtection is an armour enchantment that reduces damage from projectiles.
var Protection protection
Protection is an armour enchantment which increases the damage reduction.
var Punch punch
Punch increases the knock-back dealt when hitting a player or mob with a bow.
var QuickCharge quickCharge
QuickCharge is an enchantment for quickly reloading a crossbow.
var Respiration respiration
Respiration extends underwater breathing time by +15 seconds per enchantment level in addition to the default time of 15 seconds.
var Sharpness sharpness
Sharpness is an enchantment applied to a sword or axe that increases melee damage.
var SilkTouch silkTouch
SilkTouch is an enchantment that allows many blocks to drop themselves instead of their usual items when mined.
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.
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.
var Thorns thorns
Thorns is an enchantment that inflicts damage on attackers.
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
Source Files
¶
- aqua_affinity.go
- blast_protection.go
- damage.go
- depth_strider.go
- efficiency.go
- feather_falling.go
- fire_aspect.go
- fire_protection.go
- flame.go
- infinity.go
- knockback.go
- mending.go
- power.go
- projectile_protection.go
- protection.go
- punch.go
- quick_charge.go
- register.go
- respiration.go
- sharpness.go
- silk_touch.go
- soul_speed.go
- swift_sneak.go
- thorns.go
- unbreaking.go
- vanishing.go