Skip to content
RustPluginGenerator

OnPlayerLand

OnPlayerLand is called when a player hits the ground with enough downward velocity to trigger fall handling, before bleeding and fall damage are applied.

Signature
object OnPlayerLand(BasePlayer player, float impactScale)

Parameters

Hook parameters
ParameterTypeDescription
playerBasePlayerThe BasePlayer who landed. May be null-checked for safety, though the game call passes a valid player.
impactScalefloatNormalized fall severity in the range 0-1, computed by InverseLerp between -15 and -100 vertical velocity. 0 means no fall damage would occur; 1 means the hardest recorded fall.

Return value

Return null (or let the method end) to keep vanilla fall damage and bleeding. Return any non-null value to skip the original fall handling entirely for that landing, preventing both the bleeding addition and the fall damage.

How it works

The hook fires inside BasePlayer.ApplyFallDamageFromVelocity, which the game calls when a player's landing velocity crosses the fall threshold. The scale is Mathf.InverseLerp(-15f, -100f, velocity), so values near 0 are soft landings and values near 1 are long drops. God players return before the hook is reached, and if the scale is exactly 0 the hook does not fire at all.

Use player for permission checks and feedback messages, and impactScale to scale your own effects: stagger, sound, stamina drain, or notifications about how hard the landing was. Approximate raw damage as impactScale * 500f if you need a threshold, but treat it as an estimate.

Returning a non-null value from the hook suppresses the vanilla fall handling for that landing: no bleeding is added and no fall damage is applied. That makes this a clean way to implement immunity zones, custom fall damage rules, or soft-landing items without touching other damage paths. You cannot return a different damage number; the hook is all-or-nothing.

Narrowing to a more specific type does not help here because Rust always passes a full BasePlayer.

Example plugin: Reduce fall damage while a custom item is held

SoftLandingBoots.cs
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;

namespace Oxide.Plugins
{
    [Info("Soft Landing Boots", "RustPluginGenerator", "1.0.0")]
    [Description("Lets players holding a chosen item ignore fall damage with a configurable chance.")]
    public class SoftLandingBoots : RustPlugin
    {
        private const string PermUse = "softlandingboots.use";

        private PluginConfig config;

        private class PluginConfig
        {
            [JsonProperty("Item shortname that grants soft landing")]
            public string ItemShortname = "attire.bunnyears";

            [JsonProperty("Chance to ignore fall damage (0-1)")]
            public float Chance = 0.75f;

            [JsonProperty("Minimum fall scale to trigger (0-1)")]
            public float MinimumScale = 0.3f;
        }

        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>
            {
                ["SoftLanding"] = "Your boots absorbed the impact.",
                ["HardLanding"] = "That landing hurt ({0:P0} impact)."
            }, 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);
        }

        private object OnPlayerLand(BasePlayer player, float impactScale)
        {
            if (player == null || impactScale < config.MinimumScale) return null;
            if (!player.IsConnected || player.IsDead()) return null;
            if (!permission.UserHasPermission(player.UserIDString, PermUse)) return null;

            var active = player.GetActiveItem();
            if (active?.info == null || active.info.shortname != config.ItemShortname) return null;

            if (UnityEngine.Random.Range(0f, 1f) <= config.Chance)
            {
                player.ChatMessage(Msg("SoftLanding", player.UserIDString));
                return true;
            }

            player.ChatMessage(Msg("HardLanding", player.UserIDString, impactScale));
            return null;
        }
    }
}

The plugin gives players who hold a specific item (by default the attire.bunnyears shortname, configurable) a configurable chance to ignore fall handling completely. On every landing with a scale above the configured minimum, it rolls a chance, and on success sends a chat message and returns true from OnPlayerLand, which stops the game from applying bleeding and fall damage for that impact. A second branch explains the hit to the player when the roll fails, using the lang file. Config controls the item shortname, the chance and the minimum fall scale so tiny hops are not announced.

Common use cases

  • Safe-landing zones

    Return a non-null value when the player lands near a protected monument or event zone so participants can jump from heights without dying.

  • Custom fall damage scaling

    Use the impact scale to apply your own Hurt amount when the fall exceeds your threshold, then return non-null to replace the vanilla calculation.

  • Landing feedback and stats

    Record hard landings per player or play a sound and chat line when the scale is above a set value, without altering damage at all.

Pitfalls

  • Non-null return removes all fall damage

    The hook cannot output a modified damage value. Any non-null return disables bleeding and damage for that landing entirely, so use it deliberately.

  • It does not fire for gentle falls

    When the computed scale is exactly 0 the hook is never called, so you cannot use it as a general 'player touched ground' event.

  • God players skip it

    The method returns before calling the hook for players in god mode, so do not rely on OnPlayerLand for admin testing.

Build a plugin with OnPlayerLand

Describe what should happen and get a compiled plugin that uses this hook.

Prompt: Safe-landing zones using the OnPlayerLand hook, with a config file and a permission
Generate this plugin

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 OnPlayerLand

Generate