OnFindBurnable
OnFindBurnable is called when an oven (campfire, furnace, barbecue, lantern) needs to pick the next fuel item from its inventory. Returning an Item overrides the game's own pick.
object OnFindBurnable(BaseOven oven)Parameters
| Parameter | Type | Description |
|---|---|---|
oven | BaseOven | The BaseOven instance (campfire, furnace, barbecue, lantern, small/large furnace and their deployables) whose FindBurnable call is being resolved. Use it to read inventory contents, flags and position. |
Return value
Return null (or any non-Item value) to let the vanilla fuel-search run unchanged. Return an Item to short-circuit BaseOven.FindBurnable and supply that item as the fuel to consume; the game skips its own itemList scan entirely.
How it works
The hook fires inside BaseOven.FindBurnable, the method the game calls whenever a fueled entity decides which item to consume next: while burning, when the oven ticks its fuel consumption, and when it checks whether it can start or stay lit. The single oven argument is the BaseOven being evaluated, so you can inspect oven.inventory.itemList, oven.transform.position, oven.OwnerID, or flags such as BaseEntity.Flags.On.
The game reads the return value, not a mutation of the argument, so this is one of the few item hooks where you must return something. Return an Item and the oven consumes that item instead of the one the game would have chosen; return null and the vanilla priority order (wood before other fuels, etc.) applies. Because the parameter type is already the concrete BaseOven, declaring a more specific type is not useful — but you can branch inside the hook on oven.ShortPrefabName (e.g. campfire, furnace, bbq, lantern) to treat each fuelable differently.
Note the hook can run frequently for every lit oven, including NPC-placed and player-owned ones, so keep the body cheap and never print to console inside it. Cache anything expensive in OnServerInitialized or Loaded.
Example plugin: Consume only wood, refuse other fuels in campfires
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("Campfire Wood Only", "RustPluginGenerator", "1.0.0")]
[Description("Forces campfires to burn only a configured fuel item and leaves furnaces on vanilla behavior.")]
public class CampfireWoodOnly : RustPlugin
{
private const string PermBypass = "campfirewoodonly.bypass";
private PluginConfig config;
private class PluginConfig
{
[JsonProperty("Only affect campfires")]
public bool OnlyCampfires { get; set; } = true;
[JsonProperty("Allowed fuel shortname")]
public string AllowedFuel { get; set; } = "wood";
[JsonProperty("Skip refuel when oven is off")]
public bool SkipWhenOff { get; set; } = false;
}
protected override void LoadDefaultConfig() => config = new PluginConfig();
protected override void LoadConfig()
{
base.LoadConfig();
try
{
config = Config.ReadObject<PluginConfig>();
if (config == null) throw new Exception();
}
catch
{
PrintWarning("Configuration file is invalid, using defaults");
LoadDefaultConfig();
}
SaveConfig();
}
protected override void SaveConfig() => Config.WriteObject(config);
private void Init()
{
permission.RegisterPermission(PermBypass, this);
}
private object OnFindBurnable(BaseOven oven)
{
if (oven == null || oven.inventory == null) return null;
var prefab = oven.ShortPrefabName;
if (config.OnlyCampfires && prefab != "campfire") return null;
if (config.SkipWhenOff && !oven.IsOn()) return null;
// Owners with permission keep vanilla fuel selection.
if (oven.OwnerID != 0 && permission.UserHasPermission(oven.OwnerID.ToString(), PermBypass)) return null;
var items = oven.inventory.itemList;
if (items == null) return null;
for (int i = 0; i < items.Count; i++)
{
var item = items[i];
if (item?.info == null) continue;
if (item.info.shortname != config.AllowedFuel) continue;
return item;
}
// No allowed fuel present; let vanilla handle the rest (which will find nothing useful here).
return null;
}
}
}The plugin scans each campfire's inventory when FindBurnable runs and returns the first stack of wood it finds. If the campfire has no wood, it returns null so the vanilla scan proceeds unchanged and the fire simply runs out — the config flag OnlyCampfires keeps furnaces and lanterns on vanilla behavior. The config also lets admins choose the allowed fuel shortname (wood by default) and an optional RequireFullBurn toggle that skips refueling when the oven is already off, so fires cannot be silently restarted. The check is cheap: a short-circuit float/bool compare before iterating oven.inventory.itemList. No messages are sent and nothing is logged inside the hook.
Common use cases
Restrict oven fuel to a whitelist
Return only items whose
info.shortnameis in a configured list, forcing players to burn one specific resource and letting other fuels sit in the inventory untouched.Prioritize expensive fuels
Return low-grade fuel only when high-grade fuel is absent, or invert the vanilla order to consume charcoal/sulfur before wood in furnaces for a server meta shift.
Server-wide fuel economy
Combine with a custom fuel item (e.g. a
scrap-like token) by returning that stack from the inventory so furnaces consume it first while it lasts.
Pitfalls
Returning a non-fuel item
The returned
Itemis used directly; if it has nofuelAmountin itsItemDefinitionthe burn may not tick as expected. Prefer returning items already recognized as fuel and usenullto defer.Called for every lit oven on every tick
The hook runs per oven per check — iterate
itemListwith an early exit and avoid LINQ or allocations. Do not callPutsorPrintWarninginside it.Lanterns share the hook
lanternandjackolanternare alsoBaseOven; if you filter by fuel type, make sure your rule doesn't stop lanterns that players rely on for light.
Build a plugin with OnFindBurnable
Describe what should happen and get a compiled plugin that uses this hook.
Edit the prompt on the next screen. 2 free plugins a month, no card.
Last updated Oct 26, 2026. Found a mistake? Email support@rustplugingenerator.com.
Build a plugin with OnFindBurnable
Generate