Substances & brewing
Narcotics
A configuration-first engine for fictional substances, addiction, withdrawal, alcohol brewing, and driving impairment.
01
What it handles
Multiple use routes
Eating, snorting, smoking, and drinking have distinct item, tool, durability, and byproduct rules.
Addiction tracks
Configurable rolls progress dependence from minor to moderate to severe with persistent withdrawal.
Brewing stations
Ingredient sets, fermentation time, servings, aging, spoilage, and quality-scaled effects support a brewer economy.
Vehicle impairment
Vehicles reads a public status API and modifies server-side control input without fabricated packets.
Health treatment
An optional bridge lets genuine medical treatments address addiction while Narcotics owns persistence.
Ignition service
Other modules can identify real lighters and atomically consume their configured uses.
Custom content
Names, routes, effects, probabilities, withdrawal, recipes, and messages are fully configurable.
Item security
Namespaced data, unique durable tools, bounded uses, deduplicated interactions, and protected breweries resist spoofing.
02
Detailed guide
Narcotics is a configuration-first substance engine for Paper 1.21.11. The bundled names are fictional examples, not hardcoded mechanics. Server owners can replace every display name, material, route, effect, addiction chance, withdrawal schedule, recipe, and message.
Player loop
EATENsubstances are used directly.SNORTEDsubstances consume one genuine held substance and the configured amount of plain paper from inventory.SMOKEDsubstances require a genuine pipe and lighter. Both tools have independently configured, bounded durability.DRINKis reserved for alcohol and returns an empty bottle after consumption.- Successful addiction rolls raise the configured track from minor to moderate to severe. Death clears current intoxication/impairment but never dependence.
Brewery design
Give or craft a fermentation barrel, place it, and add an exact configured ingredient set. Sneak-right-click with an empty hand to begin fermentation. After the minimum ferment time, use glass bottles to draw the configured servings. Quality rises toward the ideal age and falls toward the stale age. Effects marked with the optional :QUALITY modifier scale from 50% duration at quality 0 to 100% at quality 100; side effects can remain fixed.
This gives alcohol an economic and gameplay purpose: skilled brewers make longer-lasting configured buffs and can sell reliably aged batches. The default cider demonstrates LUCK as a modest reward, but production servers can use other potion effects or omit rewards entirely. Repeated drinking still carries addiction and driving risk.
Optional bridges
The plugin registers two Bukkit services:
NarcoticsApiexposes read-only addiction status and current driving impairment.AddictionTreatmentApiis registered whenintegrations.healthis enabled. A Health treatment item or surgery flow can calltreat/treatCategory; this keeps Health optional and addiction persistence in one owner.IgnitionApiidentifies genuine lighters and atomically consumes a use. A future arson plugin should callignite(Player)instead of duplicating or trusting item names.
Vehicles discovers NarcoticsApi without a hard dependency and alters server-side control input according to the current impairment factor. No packets are fabricated or intercepted.
Security model
Custom items use namespaced persistent data, not names or lore. Durable tools also require an unstacked UUID instance and a use count within the configured maximum. Consumption is validated before mutation, interactions are main-hand/off-hand deduplicated, brewery blocks cannot be moved by pistons or destroyed by explosions, and brewery inventory access/automation is blocked by default. Database paths are confined to the plugin data directory.
Commands: /narcotics status, /narcotics treat, /narcotics reload, and /brewery help. Issue substances and tools through /skylines give narcotics:<item> [player] [amount].
Using each substance route
Every working substance must be a genuine namespaced Narcotics item. Renaming a vanilla item does not grant effects.
EATEN: use the substance directly; one item is consumed after validation.SNORTED: hold and use the genuine substance while carrying the configured amount of plain paper. Both the dose and required paper are consumed on success.SMOKED: carry the genuine pipe and lighter with remaining uses. A successful dose consumes the substance and one use from each configured tool.DRINK: drink the substance; the configured bottle behavior returns an empty bottle.
Main/off-hand duplicate events are collapsed so one physical action cannot apply two doses. Death clears current intoxication and driving impairment but intentionally preserves addiction progress and withdrawal state.
Addiction and withdrawal
Each successful use rolls the substance's configured addiction chance against its addiction track. Dependence advances through minor, moderate, and severe states. Withdrawal schedules, effects, and timing come from configuration and advance under the plugin's online-time model. /narcotics status reports the player's current state; treatment requires the configured permission and integration path.
Health can treat a specific track or category only through the registered treatment bridge. Narcotics remains the owner of dependence persistence, so Health should never directly edit its database.
Brewery operation
- Craft or issue a genuine fermentation barrel and place it where automation and explosion protection are appropriate.
- Insert the exact configured ingredient multiset. Similar-looking custom items are not interchangeable.
- Sneak-right-click the barrel with an empty hand to start fermentation.
- Wait at least the recipe's minimum age. Drawing early is rejected.
- Use glass bottles to draw the configured number of servings.
Quality climbs toward the ideal age and then declines toward stale age. Effects marked QUALITY scale their duration from 50% at quality 0 to 100% at quality 100. Fixed side effects do not have to scale. Pistons, explosions, hoppers, and unauthorized inventory access are blocked according to the security policy so a running batch cannot be duplicated through automation.
Durable tools
Pipes and lighters carry a server-authoritative unstacked instance UUID and bounded remaining-use count. Duplicating names or lore does not duplicate a valid tool. The public ignition service consumes lighter use atomically for another suite plugin; callers should use that service rather than editing item metadata.
Narcotics testing checklist
- Issue every configured substance and test its route with correct and missing prerequisites.
- Exhaust a pipe and lighter and verify invalid, stacked, renamed, or over-max-use tools are rejected.
- Trigger each addiction stage, die while intoxicated, and confirm dependence persists while impairment clears.
- Test the complete withdrawal schedule using online and offline time.
- Ferment each configured recipe, draw before minimum age, at ideal age, and near stale age, and compare quality-scaled effects.
- Attempt piston movement, explosion destruction, hopper automation, and unauthorized barrel access.
- With Health installed, test treatment success and the disabled-integration case.
- With Vehicles installed, compare control behavior at multiple impairment factors.
03
Commands
| Command | Usage | Description | Permission |
|---|---|---|---|
/narcoticsAliases: substances | /narcotics <status|treat|reload> | Substance status and administration. | Subcommand-based |
/brewery | /brewery help | Brewery help and station administration. | Subcommand-based |
04
Permissions
| Node | Default | Description / children |
|---|---|---|
narcotics.use | No additional description. | |
narcotics.status | No additional description. | |
narcotics.status.others | No additional description. | |
narcotics.brew | No additional description. | |
narcotics.treat | No additional description. | |
narcotics.reload | No additional description. | |
narcotics.bypass.cooldown | No additional description. | |
narcotics.admin | No additional description.Includes narcotics.use, narcotics.status, narcotics.status.others, narcotics.brew, narcotics.treat, narcotics.reload, narcotics.bypass.cooldown |
Command and permission references reflect the current plugin.yml manifests in this workspace.