Class FurnaceFuelBurnTimeEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.furnace.FurnaceFuelBurnTimeEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
public class FurnaceFuelBurnTimeEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
FurnaceFuelBurnTimeEvent
is fired when determining the fuel value for an ItemStack. To set the burn time of your own item, use
IItemExtension.getBurnTime(ItemStack, RecipeType, FuelValues)
instead.This event is fired from
EventHooks.getItemBurnTime(ItemStack, int, RecipeType, FuelValues)
.This event is
ICancellableEvent
to prevent later handlers from changing the value.This event is fired on the
NeoForge.EVENT_BUS
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private final net.minecraft.world.level.block.entity.FuelValues
private final net.minecraft.world.item.ItemStack
private final @Nullable net.minecraft.world.item.crafting.RecipeType
<?> -
Constructor Summary
ConstructorsConstructorDescriptionFurnaceFuelBurnTimeEvent
(net.minecraft.world.item.ItemStack itemStack, int burnTime, @Nullable net.minecraft.world.item.crafting.RecipeType<?> recipeType, net.minecraft.world.level.block.entity.FuelValues fuelValues) -
Method Summary
Modifier and TypeMethodDescriptionint
The resulting value of this event, the burn time for the ItemStack.net.minecraft.world.level.block.entity.FuelValues
Get theFuelValues
populated from thedata map
net.minecraft.world.item.ItemStack
Get the ItemStack "fuel" in question.@Nullable net.minecraft.world.item.crafting.RecipeType
<?> Get the recipe type for which to obtain the burn time, if known.void
setBurnTime
(int burnTime) Set the burn time for the given ItemStack.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
itemStack
private final net.minecraft.world.item.ItemStack itemStack -
recipeType
@Nullable private final @Nullable net.minecraft.world.item.crafting.RecipeType<?> recipeType -
fuelValues
private final net.minecraft.world.level.block.entity.FuelValues fuelValues -
burnTime
private int burnTime
-
-
Constructor Details
-
FurnaceFuelBurnTimeEvent
public FurnaceFuelBurnTimeEvent(net.minecraft.world.item.ItemStack itemStack, int burnTime, @Nullable @Nullable net.minecraft.world.item.crafting.RecipeType<?> recipeType, net.minecraft.world.level.block.entity.FuelValues fuelValues)
-
-
Method Details
-
getItemStack
public net.minecraft.world.item.ItemStack getItemStack()Get the ItemStack "fuel" in question. -
getRecipeType
@Nullable public @Nullable net.minecraft.world.item.crafting.RecipeType<?> getRecipeType()Get the recipe type for which to obtain the burn time, if known. -
getFuelValues
public net.minecraft.world.level.block.entity.FuelValues getFuelValues()Get theFuelValues
populated from thedata map
-
setBurnTime
public void setBurnTime(int burnTime) Set the burn time for the given ItemStack. Setting it to 0 will prevent the item from being used as fuel, overriding vanilla's decision. -
getBurnTime
public int getBurnTime()The resulting value of this event, the burn time for the ItemStack. A value of 0 will prevent the item from being used as fuel, overriding vanilla's decision.The initial burn time can come from either the
extension method
or thedata map
throughFuelValues
.
-