OnExplosiveFuseSet
OnExplosiveFuseSet is called from TimedExplosive.SetFuse right before the explosion timer is scheduled, letting you read or change the fuse duration of an explosive entity.
object OnExplosiveFuseSet(TimedExplosive timedExplosive, float fuseLength)Parameters
| Parameter | Type | Description |
|---|---|---|
timedExplosive | TimedExplosive | The TimedExplosive entity whose fuse is being set, such as a thrown C4, satchel, grenade or other explosive object. Use it to inspect the prefab, owner and position. |
fuseLength | float | The fuse duration in seconds that the game is about to schedule. The explosion is invoked with this value after the hook returns. |
Return value
Return a float to override the fuse duration passed to the explosion timer. Return null (or any non-float value) to let the game use its original fuseLength unchanged.
How it works
The hook fires inside TimedExplosive.SetFuse, which the server calls when an explosive's timer is armed. That covers thrown items (C4, satchels, grenades) and any entity that schedules Explode through its timed explosive component. The method is called on the server only, and the hook runs after the game has decided the fuse length but before it invokes the explosion.
timedExplosive is the entity itself, so you can check ShortPrefabName, OwnerID, position or a BasePlayer owner before letting the fuse run. fuseLength is the delay in seconds as the game intends to schedule it.
Return a float to replace that delay: longer for a detect-and-disarm feel, shorter for a quicker blast. Returning null or any other type leaves the original value. Because the hook receives the concrete TimedExplosive type, it fires for every timed explosive in the world, so filter by prefab name before applying rules.
Example plugin: Lengthen the fuse on thrown explosives
using System;
using Newtonsoft.Json;
using Oxide.Core;
namespace Oxide.Plugins
{
[Info("Explosive Fuse Control", "RustPluginGenerator", "1.0.0")]
[Description("Scales the fuse length of timed explosives using a configurable multiplier.")]
public class ExplosiveFuseControl : RustPlugin
{
private class PluginConfig
{
[JsonProperty("Fuse multiplier")]
public float FuseMultiplier = 1.5f;
[JsonProperty("Minimum fuse seconds")]
public float MinimumFuse = 0f;
[JsonProperty("Maximum fuse seconds")]
public float MaximumFuse = 30f;
}
private PluginConfig config;
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 object OnExplosiveFuseSet(TimedExplosive timedExplosive, float fuseLength)
{
if (timedExplosive == null) return null;
if (config.FuseMultiplier <= 0f) return null;
float adjusted = fuseLength * config.FuseMultiplier;
if (adjusted < config.MinimumFuse) adjusted = config.MinimumFuse;
if (config.MaximumFuse > 0f && adjusted > config.MaximumFuse) adjusted = config.MaximumFuse;
// Nothing changed, let the game keep its own value.
if (Math.Abs(adjusted - fuseLength) < 0.01f) return null;
return adjusted;
}
}
}The plugin stores a configurable multiplier and a minimum fuse in oxide/config, then uses OnExplosiveFuseSet to scale the game's fuse length. When a timed explosive is armed, it multiplies the incoming value, clamps it to the configured minimum, and returns the result so TimedExplosive.SetFuse schedules the longer timer. A value of 1.0 with a minimum of 0 disables the effect entirely, and the hook simply returns the original float so the scheduler behaves normally. Because the hook does not touch player-facing text there are no messages, but the config is validated on load and defaults are written back so admins can tune it without editing code.
Common use cases
Longer C4 fuses for raid defense
Treat fuses differently by prefab: give satchels a longer delay so defenders have a chance to react while leaving grenades untouched. Filter on
timedExplosive.ShortPrefabNamebefore returning.Instant-detonation traps
Shorten the fuse on specific server-spawned explosives (for example lootable or scripted entities) so they blow up almost on contact, gated by a permission check on the owner.
Chance-based dud or delay effects
Roll a random chance in the hook and return a very long fuse, or a short one, to create randomized raid tension on special events. Keep it deterministic per player if fairness matters.
Pitfalls
It fires for every timed explosive
The hook is not limited to player-thrown items; scripted and world entities that call SetFuse are included. Always filter by prefab name or owner before changing the value.
Return null to keep the original fuse
Returning a non-float value is treated the same as returning null by the injection, but returning a float such as
0fwill schedule the explosion immediately. Be explicit about when you intend to override.The hook runs every time the fuse is re-armed
If server code resets a fuse, the hook fires again and your multiplier applies each time. Avoid cumulative scaling that would grow the fuse on every call.
Build a plugin with OnExplosiveFuseSet
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 OnExplosiveFuseSet
Generate