Skip to content
RustPluginGenerator

How to make a Rust no fall damage plugin (permission based)

Removes or scales fall damage in OnEntityTakeDamage for players, optionally only for holders of a permission, with a configurable multiplier and a short chat notice.

Fall damage kills players at the worst times: jumping off a base roof while building, hopping down a cliff after a fight, or dropping from a minicopter that clipped the ground. Vanilla Rust applies fall damage through the Rust.DamageType.Fall damage type, so a plugin can neutralise it without touching health values directly.

This plugin hooks OnEntityTakeDamage with a BasePlayer parameter, so Oxide only calls it for player entities and skips vehicles, animals and structures entirely. It reads the fall multiplier from config and, if the hit is a fall, scales only that damage type. When the multiplier is 0 the hit is cancelled and the player gets a short notice; anything between 0 and 1 keeps a proportional amount of damage. A permission gates the whole effect, and a chat command lets holders switch the plugin on and off while testing.

The plugin code

NoFallDamage.cs
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("No Fall Damage", "RustPluginGenerator", "1.0.0")]
    [Description("Removes or scales fall damage for players, optionally gated by permission.")]
    public class NoFallDamage : RustPlugin
    {
        private const string PermUse = "nofalldamage.use";
        private const string PermToggle = "nofalldamage.toggle";

        private PluginConfig config;
        private readonly Dictionary<ulong, float> lastNotice = new Dictionary<ulong, float>();

        private class PluginConfig
        {
            [JsonProperty("Enabled")]
            public bool Enabled { get; set; } = true;

            [JsonProperty("Require Permission")]
            public bool RequirePermission { get; set; } = true;

            [JsonProperty("Fall Multiplier")]
            public float FallMultiplier { get; set; } = 0f;

            [JsonProperty("Show Chat Notice")]
            public bool ShowNotice { get; set; } = true;

            [JsonProperty("Notice Cooldown")]
            public float NoticeCooldown { get; set; } = 15f;
        }

        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);

        protected override void LoadDefaultMessages()
        {
            lang.RegisterMessages(new Dictionary<string, string>
            {
                ["FallBlocked"] = "Fall damage cancelled.",
                ["FallReduced"] = "Fall damage reduced.",
                ["ToggledOn"] = "Fall damage protection enabled.",
                ["ToggledOff"] = "Fall damage protection disabled.",
                ["NoPermission"] = "You do not have permission to use this command."
            }, this);
        }

        private string Msg(string key, string userId = null, params object[] args) =>
            string.Format(lang.GetMessage(key, this, userId), args);

        private void Init()
        {
            permission.RegisterPermission(PermUse, this);
            permission.RegisterPermission(PermToggle, this);
        }

        [ChatCommand("nofall.toggle")]
        private void CmdToggle(BasePlayer player, string command, string[] args)
        {
            if (player == null || !permission.UserHasPermission(player.UserIDString, PermToggle))
            {
                if (player != null) SendReply(player, Msg("NoPermission", player.UserIDString));
                return;
            }

            config.Enabled = !config.Enabled;
            SaveConfig();
            SendReply(player, Msg(config.Enabled ? "ToggledOn" : "ToggledOff", player.UserIDString));
        }

        private object OnEntityTakeDamage(BasePlayer player, HitInfo hitInfo)
        {
            if (player == null || hitInfo == null || hitInfo.damageTypes == null) return null;
            if (!config.Enabled || player.IsNpc) return null;
            if (config.RequirePermission && !permission.UserHasPermission(player.UserIDString, PermUse)) return null;

            if (hitInfo.damageTypes.GetMajorityDamageType() != Rust.DamageType.Fall) return null;

            float fallDamage = hitInfo.damageTypes.Get(Rust.DamageType.Fall);
            if (fallDamage <= 0f) return null;

            float multiplier = Mathf.Clamp(config.FallMultiplier, 0f, 1f);
            hitInfo.damageTypes.Scale(Rust.DamageType.Fall, multiplier);

            if (config.ShowNotice) Notify(player, multiplier <= 0f ? "FallBlocked" : "FallReduced");

            // Fully cancelled fall damage: kill the remaining zero-value hit.
            if (multiplier <= 0f && hitInfo.damageTypes.Total() <= 0f) return false;

            return null;
        }

        private void Notify(BasePlayer player, string key)
        {
            float now = UnityEngine.Time.realtimeSinceStartup;
            float last;
            if (lastNotice.TryGetValue(player.userID, out last) && now - last < config.NoticeCooldown) return;

            lastNotice[player.userID] = now;
            SendReply(player, Msg(key, player.UserIDString));
        }

        private void Unload()
        {
            lastNotice.Clear();
        }
    }
}

Hooks used: OnEntityTakeDamage

Config file

Created automatically on first load at oxide/config/NoFallDamage.json.

NoFallDamage.json
{
  "Enabled": true,
  "Require Permission": true,
  "Fall Multiplier": 0,
  "Show Chat Notice": true,
  "Notice Cooldown": 15
}

Commands and permissions

Chat and console commands
CommandWhat it doesPermission
/nofall.toggleEnable or disable the plugin globally without reloading it.nofalldamage.toggle
Permissions
PermissionGrants
nofalldamage.useGrants the configured fall damage reduction or immunity.
nofalldamage.toggleAllows toggling the plugin on and off with /nofall.toggle.

How the code works

  1. Restrict the hook to players

    The hook is declared as object OnEntityTakeDamage(BasePlayer player, HitInfo hitInfo). Oxide's dispatch checks that every argument matches the declared parameter type, so this method only runs when the damaged entity is a BasePlayer. Animals, buildings, vehicles and NPCs of another type are ignored without extra casts. Returning null leaves vanilla damage untouched.

  2. Detect fall damage

    Inside the hook, hitInfo.damageTypes.GetMajorityDamageType() returns the dominant Rust.DamageType. The code compares it to Rust.DamageType.Fall and bails out with null for anything else. It then reads the fall share with hitInfo.damageTypes.Get(Rust.DamageType.Fall) and stops if that value is zero, so non-fall hits and empty fall entries never reach the scaling step.

  3. Scale instead of replacing damage

    The config value Fall Multiplier is clamped to the 0 to 1 range with Mathf.Clamp and passed to hitInfo.damageTypes.Scale(Rust.DamageType.Fall, multiplier). Only the fall portion of the hit is multiplied, so any other damage types in the same hit are left as they were. A multiplier of 0.0 removes fall damage completely, 0.5 halves it and 1.0 changes nothing.

  4. Permission and global switch

    Both permissions, nofalldamage.use and nofalldamage.toggle, are registered in Init. When Require Permission is true the hook checks permission.UserHasPermission(player.UserIDString, PermUse) and returns null for players who lack it. The Enabled config key is a global switch flipped by /nofall.toggle, which writes the config file so the state survives a reload. NPCs are always skipped.

  5. Cancel the hit cleanly

    After scaling, if the multiplier was 0 and hitInfo.damageTypes.Total() is now 0, the hook returns false. Oxide treats that return value as a cancellation, so the hit is dropped entirely instead of running through the damage pipeline with zero values. In every other case the method returns null, which keeps the normal damage handling and lets any remaining non-fall damage apply.

  6. Notice with a cooldown

    Feedback is throttled so repeated falls do not flood chat. The dictionary lastNotice maps a player id to the UnityEngine.Time.realtimeSinceStartup value of their last message, and Notify only sends when Notice Cooldown seconds have passed. The text comes from the lang keys FallBlocked and FallReduced, and the whole notice can be disabled with Show Chat Notice.

  7. Config persistence

    LoadDefaultConfig instantiates the nested PluginConfig class, and LoadConfig/SaveConfig round-trip it through Config.ReadObject<PluginConfig>() and Config.WriteObject(config). An invalid or partial file falls back to defaults and prints a warning instead of throwing. All tunables (enabled flag, permission requirement, multiplier, notice flag, cooldown) live in oxide/config/NoFallDamage.json.

Install it on your server

  1. Save NoFallDamage.cs

    Keep the file name exactly as the class name. Oxide matches them.
  2. Upload it to the plugins folder

    Oxide: oxide/plugins/. Carbon: carbon/plugins/. The server compiles and loads it within a few seconds, no restart needed.
  3. Edit the config if you want

    On first load the default config is written to oxide/config/NoFallDamage.json (Carbon: carbon/configs/NoFallDamage.json). After editing, reload it:oxide.reload NoFallDamage c.reload NoFallDamage # Carbon
  4. Grant the permission

    Give it to every player, or swap default for a group such as vip:oxide.grant group default nofalldamage.use c.grant group default nofalldamage.use # Carbon

Variations

Each one opens the generator with a ready prompt you can tweak.

  • Safe zone only

    Only skip fall damage while the player stands inside a building privilege or monument safe zone.

    Generate this version
  • Fall damage by height

    Scale fall damage based on the distance fallen instead of a flat multiplier.

    Generate this version
  • Team-wide immunity

    Grant fall immunity to every member of a team when one member has a permission.

    Generate this version

FAQ

Does this cover fall damage on animals and NPCs too?

No. The hook declares BasePlayer as the damaged type, so Oxide only calls it for players, and the code additionally skips anything where IsNpc is true. If you also want to protect horses or scientists, add a second overload such as object OnEntityTakeDamage(BaseEntity entity, HitInfo hitInfo) and filter by type there.

How do I install it on Oxide or Carbon?

Drop the compiled .cs file into oxide/plugins on an Oxide server, or the same folder on Carbon (Carbon loads Oxide plugins). The plugin compiles on the next reload and writes oxide/config/NoFallDamage.json plus oxide/lang/en/NoFallDamage.json.

Does it also block suicide or bleeding?

No, only the fall damage type is touched. Bleeding from the same hit is applied by Rust's metabolism system after the damage event and can still kill a player, so consider pairing this with a metabolism settings plugin if you want full safety.

Will it interfere with PvP balance?

It can, because a player can jump off a cliff mid-fight with no penalty. The permission system is the usual answer: give nofalldamage.use to VIPs or staff only, or set Fall Multiplier to 0.5 so fall damage still exists but is less punishing.

How do I turn it off temporarily?

Run /nofall.toggle in chat with the nofalldamage.toggle permission. The command flips Enabled, saves the config file and replies with a confirmation fetched from the lang file, so the state survives a plugin reload.

Customize it for your server

Change the reward, add a cooldown, restrict it to VIPs. Start from this prompt and edit anything.

Prompt: Write a Rust Oxide plugin that disables fall damage for players with the nofalldamage.use permission, configurable multiplier default 0, notice cooldown 15 seconds, plus a /nofall.toggle command.
Customize for my server

Edit the prompt on the next screen. 2 free plugins a month, no card.

Last updated Oct 26, 2026.

Customize no fall damage

Customize