Class AnvilRepairEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.player.PlayerEvent
net.neoforged.neoforge.event.entity.player.AnvilRepairEvent
Fired when the player removes a "repaired" item from the Anvil's Output slot.
breakChance specifies as a percentage the chance that the anvil will be "damaged" when used.
ItemStacks are the inputs/output from the anvil. They cannot be edited.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.player.PlayerEvent
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerChangeGameModeEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.TabListNameFormat
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
private final net.minecraft.world.item.ItemStack
private final net.minecraft.world.item.ItemStack
private final net.minecraft.world.item.ItemStack
-
Constructor Summary
ConstructorsConstructorDescriptionAnvilRepairEvent
(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack left, net.minecraft.world.item.ItemStack right, net.minecraft.world.item.ItemStack output) -
Method Summary
Modifier and TypeMethodDescriptionfloat
net.minecraft.world.item.ItemStack
getLeft()
Get the first item input into the anvilnet.minecraft.world.item.ItemStack
Get the output result from the anvilnet.minecraft.world.item.ItemStack
getRight()
Get the second item input into the anvilvoid
setBreakChance
(float breakChance) Methods inherited from class net.neoforged.neoforge.event.entity.player.PlayerEvent
getEntity
-
Field Details
-
left
private final net.minecraft.world.item.ItemStack left -
right
private final net.minecraft.world.item.ItemStack right -
output
private final net.minecraft.world.item.ItemStack output -
breakChance
private float breakChance
-
-
Constructor Details
-
AnvilRepairEvent
public AnvilRepairEvent(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack left, net.minecraft.world.item.ItemStack right, net.minecraft.world.item.ItemStack output)
-
-
Method Details
-
getOutput
public net.minecraft.world.item.ItemStack getOutput()Get the output result from the anvil- Returns:
- the output
-
getLeft
public net.minecraft.world.item.ItemStack getLeft()Get the first item input into the anvil- Returns:
- the first input slot
-
getRight
public net.minecraft.world.item.ItemStack getRight()Get the second item input into the anvil- Returns:
- the second input slot
-
getBreakChance
public float getBreakChance() -
setBreakChance
public void setBreakChance(float breakChance)
-