CanYouDigIt
Items v1.4.0

CanYouDigIt

by bmgjet · updated 29 days ago · 12 downloads · ★★★★★ 5 (1)
CanYouDigIt banner

Change the items you get when using the metal detector

# CanYouDigIt

CanYouDigIt lets you completely customize the loot players receive from Rust's diggable entities and metal detector dig spots.

You can replace the normal loot system with your own weighted loot table, control which environments items can appear in, use completely random items, or make digging instant.

Features

* 🎯 Custom weighted loot tables
* 🌍 Biome and topology-based loot selection
* 🎲 Completely random item mode
* ⚡ Optional instant digging
* 🎨 Custom item names
* 🖼️ Custom item SkinIDs
* 📦 Configurable minimum and maximum item quantities
* 🧰 Optional random-item tier restrictions
* 🛡️ Permission-based loot access
* 🔎 Admin/debug command for locating diggable spots
* 📏 Configurable draw distance
* 🎨 Configurable debug sphere size, duration and color
* 🔄 Automatically falls back to a default item when no loot-table entry matches
* ⚙️ Loot tables are cached for efficient item selection

Permissions

CanYouDigIt.Yes

Required for players to receive custom loot from the plugin.

Players without this permission will use the normal Rust digging behaviour.

CanYouDigIt.Draw

Used for the diggable-location drawing command when Draw: Require Permission Instead Of Admin Only is enabled.

Commands

/showdiggables

Displays the nearby locations where diggable entities can be found using debug spheres.

Running the command again stops the display.

You can optionally specify a viewing distance:

/showdiggables 250

The distance is limited by the configured maximum.

By default, the command is admin-only. It can instead be permission-based using the configuration option:

"Draw: Require Permission Instead Of Admin Only": true

Loot Modes

Custom Loot Table

By default, the plugin uses the configured loot table to determine what players receive.

Loot entries use weights, meaning higher-weight items are more likely to be selected.

Each entry can also specify:

* Minimum amount
* Maximum amount
* Custom display name
* SkinID
* Jungle
* Arid
* Normal
* Tundra
* Arctic
* River
* Lake
* Beach
* Monument

The plugin checks the biome/topology at the dig location and selects an appropriate loot entry.

Completely Random Items

Set:

"Dig Up Completely Random Items (False = use loot table)": true

The plugin will instead select a random item from the available Rust item pool.

Random items can optionally be restricted by workbench tier:

"Limit Random Items To Tier 1": true,
"Limit Random Items To Tier 2": true,
"Limit Random Items To Tier 3": false

Instant Digging

Enable:

"Instant Dig Up Items": true

Players with the required permission can receive their custom loot immediately when the dig spot is successfully scanned, rather than having to complete the normal digging process.

Default Item

If no suitable loot-table item can be selected, the plugin can provide a configurable fallback item.

Default:

"Default Item To Spawn When No Matching Loot Table Item": "metal.fragments",
"Default Item Custom Name": "",
"Default Item Custom SkinID": 0,
"Min Amount To Give": 10,
"max Amount To Give": 20

The fallback amount is randomly selected between the configured minimum and maximum.

Configuration

The configuration file is generated automatically in:

oxide/config/CanYouDigIt.json

General Settings

| Setting | Description |
| -------------------------------- | --------------------------------------------------------------------- |
| Show Console Debug Messages | Enables additional debug output in the server console. |
| Item Selection Max Retrys | Maximum attempts to find a loot-table item matching the dig location. |
| Instant Dig Up Items | Gives the custom item immediately when a valid scan is completed. |
| Dig Up Completely Random Items | Uses random Rust items instead of the configured loot table. |
| Limit Random Items To Tier 1 | Allows Tier 1 items in random mode. |
| Limit Random Items To Tier 2 | Allows Tier 2 items in random mode. |
| Limit Random Items To Tier 3 | Allows Tier 3 items in random mode. |

Draw Settings

| Setting | Default | Description |
| ------------------------------------------------ | -----------------: | ------------------------------------------------------------ |
| Draw: Chat Command Name | showdiggables | Changes the chat command used to display diggable locations. |
| Draw: Require Permission Instead Of Admin Only | false | Uses the draw permission instead of requiring admin status. |
| Draw: Permission Needed | canyoudigit.draw | Permission required when permission mode is enabled. |
| Draw: Default View Distance | 100 | Default distance used by the draw command. |
| Draw: Max Allowed View Distance | 500 | Maximum distance that can be requested. |
| Draw: Refresh Interval (Seconds) | 3 | How often the diggable locations are refreshed. |
| Draw: Sphere Duration (Seconds) | 3 | How long each debug sphere remains visible. |
| Draw: Sphere Size | 0.7 | Size of the debug spheres. |
| Draw: Sphere Color RGBA | 0, 0, 1, 1 | RGBA color of the debug spheres. |

Loot Table Configuration

Each loot-table entry supports:

{
  "ShortName": "scrap",
  "CustomName": "",
  "Amount": 4,
  "AmountMax": 10,
  "Weight": 13,
  "Jungle": true,
  "Arid": true,
  "Normal": true,
  "Tundra": true,
  "Arctic": false,
  "River": true,
  "Lake": true,
  "Beach": true,
  "Monument": true,
  "SkinID": 0
}

Loot Table Fields

| Field | Description |
| ------------ | ---------------------------------------------------- |
| ShortName | Rust item shortname to spawn. |
| CustomName | Optional custom name applied to the spawned item. |
| Amount | Minimum amount to give. |
| AmountMax | Maximum amount to give. |
| Weight | Controls how frequently the item is selected. |
| Jungle | Allow this item in jungle biome locations. |
| Arid | Allow this item in arid biome locations. |
| Normal | Allow this item in normal/temperate biome locations. |
| Tundra | Allow this item in tundra biome locations. |
| Arctic | Allow this item in arctic biome locations. |
| River | Allow this item around rivers. |
| Lake | Allow this item around lakes. |
| Beach | Allow this item around beaches. |
| Monument | Allow this item at monuments. |
| SkinID | Optional custom SkinID for the item. |

Example Custom Loot

For example, to make a dig spot give between 5 and 15 Scrap with a higher selection chance:

{
  "ShortName": "scrap",
  "CustomName": "",
  "Amount": 5,
  "AmountMax": 15,
  "Weight": 25,
  "Jungle": true,
  "Arid": true,
  "Normal": true,
  "Tundra": true,
  "Arctic": false,
  "River": true,
  "Lake": true,
  "Beach": true,
  "Monument": true,
  "SkinID": 0
}

Permissions Summary

CanYouDigIt.Yes
CanYouDigIt.Draw

CanYouDigIt.Draw is only required when the draw command is configured to use permissions instead of admin access.

Notes

The plugin builds and caches its loot pools when the server is initialized, including a filtered random-item pool when random mode is enabled. This avoids repeatedly rebuilding the available item lists while players are digging.

Loot selection also checks the biome and topology at the dig location before selecting from the configured loot table.

Video