🎄 Holiday Sale is live — 30% off all plugins 🎅 Loading…
Unwrap Commands

Unwrap Commands 1.0.0

Sign in to download
Run commands when items are unwrapped
Unwrap Commands transforms the simple act of unwrapping gifts into powerful server events. When a player unwraps an item (such as a Christmas present), the plugin can execute any server, chat, or client commands you define. With profile-based configuration, you can create completely different behavior for different wrapped items, skins, and player permissions. This opens possibilities for custom reward systems, event triggers, announcements, and more.

Common use cases include:
  • Custom rewards - Give players specific items when unwrapping presents instead of random loot
  • Event triggers - Run special commands when key items are unwrapped
  • Economy integration - Give currency or points for unwrapping achievements

Permissions

  • unwrapcommands.use -- Allows players to use the unwrap commands feature (required if "Require Permission To Use" is enabled in config)
  • unwrapcommands.bypass.cooldown -- Allows players to bypass cooldown restrictions
Additionally, any custom permissions defined in unwrap profiles are available (e.g., unwrapcommands.vip)

Configuration

JSON:
{
  "Version": "1.0.0",
  "Log Executed Commands To Server Console": true,
  "Require Permission To Use (unwrapcommands.use)": false,
  "Unwrap Profiles": [...]
}
  • Log Executed Commands To Server Console -- When enabled, all executed commands are logged to the server console with the player name. Useful for debugging and auditing.
  • Require Permission To Use (unwrapcommands.use) -- When enabled, only players with the unwrapcommands.use permission can trigger unwrap commands. Disabled players will trigger default unwrap behavior instead.

Unwrap Profiles

Each profile controls behavior for a specific item or item variant. Profiles are matched in order by item shortname, optional skin ID, and optional display name.
JSON:
{
  "Enable This Profile": true,
  "Item Shortname": "xmas.present.small",
  "Match Skin ID (0 = Any Skin)": 0,
  "Match Display Name (Empty = Any Name)": "",
  "Required Permission (Empty = None)": "",
  "Cooldown Between Uses (Seconds, 0 = None)": 0,
  "Block Unwrap While On Cooldown": false,
  "Command Selection Mode (All, Random, Weighted)": "Weighted",
  "Block Default Loot (Only Give Custom Rewards)": false,
  "Commands To Execute": [...],
  "Send Notification To Player": true,
  "Notification Message (Supports Placeholders)": "You unwrapped a {itemname}!"
}
  • Enable This Profile -- Toggle this profile on/off without removing it from config. Default: true
  • Item Shortname -- The item identifier (e.g., xmas.present.small, xmas.present.medium). Profiles are matched by shortname first. Required field.
  • Match Skin ID (0 = Any Skin) -- Optionally match a specific item skin. Use 0 to match any skin. Allows you to create different behaviors for different skins of the same item.
  • Match Display Name (Empty = Any Name) -- Optionally match a specific custom display name. Leave empty to match any name. Case-insensitive matching.
  • Required Permission (Empty = None) -- Optional permission required for players to trigger this profile (e.g., unwrapcommands.vip, unwrapcommands.exclusive.gift). Leave empty for no permission requirement. If a player lacks this permission, the default unwrap behavior occurs.
  • Cooldown Between Uses (Seconds, 0 = None) -- Cooldown duration in seconds between unwraps for the same profile per player. Set to 0 for no cooldown. Cooldowns are tracked per profile per player and persist across server restarts.
  • Block Unwrap While On Cooldown -- When enabled, blocks the unwrap action completely while on cooldown (returns true to prevent default loot). When disabled, allows the unwrap but shows an error message.
  • Command Selection Mode-- How to select which commands to execute:
    • All -- Execute every command in the list sequentially
    • Random -- Execute one random command from the list
    • Weighted -- Execute one command selected by weighted probability (higher weight = more likely)
  • Block Default Loot (Only Give Custom Rewards) -- When enabled, prevents default item loot from being given. Combined with your custom commands, this lets you completely replace the default unwrap behavior. When disabled, default loot is given in addition to your custom commands.
  • Commands To Execute-- Array of command entries to execute. See section below for details.
    Send Notification To Player -- When enabled, sends a message to the player after successfully unwrapping.
  • Notification Message (Supports Placeholders) -- Message sent to the player. Supports all placeholders listed in the Placeholders section.

Command Entries

Each command in the Commands To Execute array has these properties:
JSON:
{
  "Command (Supports Placeholders)": "inventory.giveto {steamid} scrap 50",
  "Command Type (Server, Chat, Client)": "Server",
  "Weight (Higher = More Likely To Be Picked)": 70,
  "Execute Chance (0-100 Percent)": 100
}
  • Command -- The command to execute. Supports all placeholders listed in the Placeholders section. The command is sanitized to remove dangerous characters before execution.
  • Command Type-- How the command is executed:
    • Server -- Executed as a server command
    • Chat -- Executed as a chat command from the player (with / prefix)
    • Client -- Executed as a client console command on the player
  • Weight -- Used only in Weighted selection mode. Higher weight = more likely to be selected. Actual probability is weight / total_weight. Minimum weight of 1 is applied even if set to 0.
  • Execute Chance -- Probability (0-100) that this command executes. Set to 50 for a 50% chance, 100 for guaranteed execution. Useful for creating variable rewards.

Profile Matching Priority

When an item is unwrapped, profiles are matched in order of specificity:
  1. Item shortname (required)
  2. Skin ID match (2 points if specified and matched, 0 if not applicable)
  3. Display name match (1 point if specified and matched, 0 if not applicable)
The most specific profile (highest score) is selected. If multiple profiles have the same score, the first matching profile is used.
Example:
  • Profile A: xmas.present.small, any skin, any name → score 0
  • Profile B: xmas.present.small, skin 12345, any name → score 2
  • Profile C: xmas.present.small, any skin, "Special Gift" → score 1
If player unwraps xmas.present.small with skin 12345, Profile B is selected (highest score).
Placeholders

Placeholders

Commands and notification messages support dynamic placeholders that are replaced at runtime. All placeholders are case-sensitive.

Player Placeholders

  • {playername} -- Player's display name (sanitized)
  • {playerid} -- Player's ID (same as Steam ID)

Position Placeholders

  • {position} -- Player position as "X Y Z" (e.g., "150.50 100.25 200.75")
  • {position.x} -- X coordinate
  • {position.y} -- Y coordinate
  • {position.z} -- Z coordinate
  • {grid} -- Grid position on the map (e.g., "J5")

Item Placeholders

  • {itemname} -- Item's display name (sanitized)
  • {itemshortname} -- Item's shortname (e.g., "xmas.present.small")
  • {itemid} -- Item's definition ID
  • {itemamount} -- Quantity of items unwrapped
  • {itemuid} -- Item's unique ID
  • {skinid} -- Item's skin ID

Random Placeholders

  • {random:MIN:MAX} -- Random integer between MIN and MAX (inclusive)
Example: {random:1:10} generates a random number between 1 and 10

Stored Data

JSON:
{
  "Player Cooldowns": {
    "76561198000000000": {
      "xmas.present.small_0_": 1703123456.0,
      "xmas.present.medium_0_": 1703123400.0
    }
  }
}
The key format is ItemShortname_SkinId_DisplayName. Each value is a Unix timestamp of when the player last unwrapped that item. When a cooldown expires (current time exceeds stored time plus cooldown duration), the player can unwrap again.

Localization

JSON:
{
  "Error.Cooldown": "You must wait {0} seconds before unwrapping another {1}."
}

Command Execution Types

Server Commands

Commands executed directly on the server. Most common for giving items, managing resources, or calling other plugin functionality.
Example: inventory.giveto {steamid} scrap 100

Chat Commands

Commands executed as if the player typed them in chat with a / prefix. Useful for triggering player-facing commands or chat-based functionality.
Example: home (executed as /home)

Client Commands

Commands sent to the player's client console. Less common, but useful for client-side operations.
Example: A custom client command defined by another plugin
Author
VisEntities
Downloads
2
First release
Last update

Ratings

0.00 star(s) 0 reviews

Also by VisEntities

Back
Top
Chat commands start with a /, while console commands can be entered directly in the F1 console or server console. Use find <keyword> in console to search for available commands related to the plugin. Parameters in < > are required, while [ ] are optional.
This plugin uses Oxide's permission system. Grant or revoke permissions using oxide.grant and oxide.revoke. You can assign them to individual players or groups using their Steam id or group name.
Settings are stored in the config file found under the config/ directory. You can edit this file manually, then reload the plugin to apply your changes.
Persistent data is saved in the data/ directory. This includes things like saved settings, usage stats, or player progress depending on the plugin. Deleting a data file will reset stored progress or customizations.
Language files are located in the lang/ folder. To translate messages, copy the en.json file into your target language folder (e.g. fr, de) and edit the values. Reload the plugin after changes to apply new messages.
This section lists public methods exposed by the plugin for use in other plugins. You can call these via the CallHook method. Ensure the plugin is loaded before calling its API to avoid null reference errors.
These are custom hooks that other plugins can listen for. Simply define a method with the same name and expected parameters in your plugin to handle the event. Hooks are triggered at key moments and are useful for extending or reacting to plugin behavior.
These hooks are injected into the game's code using Harmony. They let the plugin run code at key points in the game's internal logic. You can return values to block or modify behavior. Use with caution — these are powerful and can affect core mechanics.
Cart