Skip to content
RustPluginGenerator

CanMannequinChangePose

CanMannequinChangePose is called when a player requests a pose change on a Mannequin, before the server advances or cycles the pose. Returning a non-null value cancels the change.

Signature
object CanMannequinChangePose(Mannequin mannequin, BasePlayer player)

Parameters

Hook parameters
ParameterTypeDescription
mannequinMannequinThe Mannequin entity whose pose the player is trying to change. Use it to read pose state, position, owner or attached storage.
playerBasePlayerThe BasePlayer who sent the pose-change RPC. Already passed a building-authorization check, so this is the player interacting with the mannequin.

Return value

Returning null lets the game proceed and advance the mannequin to the next pose. Returning any non-null object (for example true) suppresses the original method body, so the pose never changes and no RPC result is applied.

How it works

The hook fires inside Mannequin.Server_ChangePose, the RPC handler invoked when a player interacts with a mannequin to cycle its pose. The game first checks that the RPC came from a real player who passes CanBuild(cached: true) near the mannequin, then calls this hook. If the hook returns null, the server continues: it increments PoseIndex, wraps back to zero when it runs past AvailablePoses.Length, and applies the new pose.

mannequin is the target entity, useful for checking ownership, position, its container, or the pose it currently holds. player is the requesting player. Because both parameters are already declared as Mannequin and BasePlayer, you cannot narrow further than these types; a differing argument would not reach the hook at all. The hook is only reached after the vanilla build-permission check passes, so you do not need to re-check that yourself unless you want stricter rules. Cancelling the change here stops the pose from advancing without blocking the player's movement or other interactions with the mannequin.

Example plugin: Restrict mannequin pose changes to the owner or admins

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

namespace Oxide.Plugins
{
    [Info("Mannequin Pose Owner Lock", "RustPluginGenerator", "1.0.0")]
    [Description("Restricts mannequin pose changes to the owner, admins or a permitted group.")]
    public class MannequinPoseOwnerLock : RustPlugin
    {
        private const string PermBypass = "mannequinposeownerlock.bypass";

        private PluginConfig config;

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

            [JsonProperty("Allow admins")]
            public bool AllowAdmins { get; set; } = true;
        }

        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>
            {
                ["NotAllowed"] = "You cannot change the pose of someone else's mannequin."
            }, 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(PermBypass, this);
        }

        private object CanMannequinChangePose(Mannequin mannequin, BasePlayer player)
        {
            if (!config.Enabled || mannequin == null || player == null)
                return null;

            if (config.AllowAdmins && player.IsAdmin)
                return null;

            if (permission.UserHasPermission(player.UserIDString, PermBypass))
                return null;

            if (mannequin.OwnerID == player.userID.Get())
                return null;

            player.ChatMessage(Msg("NotAllowed", player.UserIDString));
            return true;
        }
    }
}

The plugin keeps a configurable toggle and permission. When CanMannequinChangePose fires, it checks whether the setting is enabled and whether the requesting player holds the bypass permission. If the player is not an admin, lacks the permission, and is not the mannequin's owner, the hook sends a localized chat message and returns true, which cancels the pose change. Otherwise it returns null and the mannequin cycles normally. All player-facing text is loaded from the language file, and the config is read and written with the standard Oxide config overrides.

Common use cases

  • Owner-only mannequins

    Lock pose changes to the mannequin's owner so visitors cannot rearrange a shop or display mannequin while the owner is away.

  • Staff-controlled displays

    Allow only a permission group to change poses on event or arena mannequins, keeping set poses consistent during a round.

  • Anti-grief on public servers

    Block pose spam or tampering on decorative mannequins placed around a public map without removing the entity.

Pitfalls

  • Only fires on pose change

    The hook does not cover opening the mannequin's storage or clothing it. Use CanLootEntity or container hooks for those separate interactions.

  • Return value must be non-null to block

    Returning false still cancels the change because any non-null object stops the original method. Return null to allow it.

  • Build check already passed

    The game only reaches this hook after the requester passes the cached build check. If you need stricter area rules, enforce them here rather than relying on the vanilla check.

Build a plugin with CanMannequinChangePose

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

Prompt: Owner-only mannequins using the CanMannequinChangePose 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 CanMannequinChangePose

Generate