public class RobotUsedToolEvent extends RobotEvent
Modifier and Type | Class and Description |
---|---|
static class |
RobotUsedToolEvent.ApplyDamageRate
Fired when a robot used a tool and the previously fired damage rate
computation returned a value smaller than one.
|
static class |
RobotUsedToolEvent.ComputeDamageRate
Fired when a robot used a tool and is about to apply the damage rate to
partially undo the durability loss.
|
Modifier and Type | Field and Description |
---|---|
protected double |
damageRate |
net.minecraft.item.ItemStack |
toolAfterUse
The tool that was used, before and after use.
|
net.minecraft.item.ItemStack |
toolBeforeUse
The tool that was used, before and after use.
|
agent
Modifier | Constructor and Description |
---|---|
protected |
RobotUsedToolEvent(Agent agent,
net.minecraft.item.ItemStack toolBeforeUse,
net.minecraft.item.ItemStack toolAfterUse,
double damageRate) |
Modifier and Type | Method and Description |
---|---|
double |
getDamageRate()
The rate at which the used tool should lose durability, where one means
it loses durability at full speed, zero means it doesn't lose durability
at all.
|
public final net.minecraft.item.ItemStack toolBeforeUse
public final net.minecraft.item.ItemStack toolAfterUse
protected double damageRate
protected RobotUsedToolEvent(Agent agent, net.minecraft.item.ItemStack toolBeforeUse, net.minecraft.item.ItemStack toolAfterUse, double damageRate)