Skip to content

monogutsy/RandomMobDrops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

RandomMobDrops

.NET TShock Terraria License

A TShock plugin that replaces Terraria's vanilla NPC item drops with completely random items from the entire game database. Every enemy killed drops one random item — it could be anything.


What It Does

When any NPC dies, the plugin blocks its normal item drops and spawns a single random item from Terraria's full item pool instead. Coins still drop normally.

  • A Green Slime dies → you get a Rocket Launcher
  • A Zombie dies → you get a Diamond
  • A Demon Eye dies → you get Luminite Bars
  • A Skeleton dies → you get Wings

Every kill is a surprise. The same enemy type will give different items every time.


Features

  • True random drops — any item in Terraria can drop from any enemy
  • Vanilla drops replaced — NPC-specific loot tables are suppressed
  • Coins preserved — copper, silver, gold, and platinum coins still drop normally
  • One item per kill — clean, no spam
  • Works immediately — no setup commands, no permissions to configure
  • Critter filtering — bunnies, birds, and other passive creatures are ignored
  • Statue spawn filtering — prevents abuse from statue farms
  • Town NPC protection — NPCs like the Guide or Nurse never trigger drops
  • Exclusion list — block specific NPC IDs from the system
  • Hot-reload — change config without restarting the server
  • Full logging — every drop is logged to server console for debugging

Installation

  1. Download the latest RandomMobDrops.dll from Releases
  2. Drop it into your TShock server's ServerPlugins/ folder
  3. Restart the server
  4. Kill something — random items start dropping immediately

No commands to run. No permissions to set up. Just install and play.


Commands

Command Permission Description
/randomdrops reload randomdrops.admin Reload configuration from disk
/randomdrops test randomdrops.admin Preview a random drop without spawning it

Configuration

Generated at tshock/RandomMobDrops.json on first run.

{
  "Enabled": true,
  "SuppressVanillaDrops": true,
  "MinDropsPerKill": 1,
  "MaxDropsPerKill": 1,
  "IgnoreCritters": true,
  "IgnoreStatueSpawns": true,
  "IgnoreTownNPCs": true,
  "UseAllItems": true,
  "MinStack": 1,
  "MaxStack": 1,
  "ExcludedNPCs": []
}

Config Options

Option Default What it does
Enabled true Master toggle for the entire plugin
SuppressVanillaDrops true Block vanilla NPC item drops (coins still pass through)
UseAllItems true Pick from every item in Terraria's database
MinDropsPerKill 1 Minimum items dropped per kill
MaxDropsPerKill 1 Maximum items dropped per kill
MinStack 1 Minimum stack size
MaxStack 1 Maximum stack size
IgnoreCritters true Don't give drops for killing passive creatures
IgnoreStatueSpawns true Don't give drops for statue-spawned enemies
ExcludedNPCs [] Array of NPC net IDs to exclude from the system

How It Works

The plugin hooks into two TShock events:

  1. NpcLootDrop — fires when an NPC tries to drop an item. The plugin intercepts this and blocks everything except coins. This prevents vanilla loot from spawning.

  2. NpcKilled — fires when an NPC dies. The plugin picks a random item ID from 1 to ItemID.Count, spawns it at the NPC's death position, and syncs it to all connected clients.

The random selection uses Random.Shared.Next(1, ItemID.Count) which covers every valid item in Terraria 1.4.5.6 — weapons, armor, accessories, blocks, furniture, materials, everything.


Building From Source

Requirements:

  • .NET 9 SDK
  • TShock 6.1.0 NuGet package (pulled automatically)
git clone https://github.com/MonoGutsy/RandomMobDrops.git
cd RandomItems
dotnet build RandomMobDrops/RandomMobDrops.csproj -c Release

Output: RandomMobDrops/bin/Release/net9.0/RandomMobDrops.dll


Compatibility

Version
Terraria 1.4.5.6
TShock 6.1.0
.NET 9.0
API TSAPI 2.1

License

MIT

About

A TShock plugin that gives players guaranteed random item rewards whenever they kill an enemy. Every kill generates a new random drop, making combat more rewarding and unpredictable. Compatible with Terraria 1.4.5.6, TShock 6.1.0, and .NET 9.0.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages