DriftShowcase
Try a rank on before you buy it.
Try a rank on before you buy it, for Paper and Folia 26.3.
Players right-click an NPC at spawn and pick a rank from a menu. For a few seconds the NPC turns into them, wearing the rank's armour with the rank's prefix above its head, and they see the items that come with it. Then everything goes back to normal and they get a clickable link to the store. Nothing is ever really given: no group, no permission, no item and no command.
Features
The NPC
/showcase npc create <id>puts a showcase NPC where you stand. It can't move, be hurt or be pushed, and it wears the skin of any player you choose. Change its skin and the name above it, move it, list them or teleport to one.- NPCs are saved in
data/npcs.yml. Every time an NPC's chunk loads (and when the server starts) it's checked, so each NPC is there exactly once: duplicates are removed and missing NPCs come back. - Spam-clicking does nothing: clicks closer together than
npc.click-cooldownare ignored.
Trying a rank on
- The ranks menu shows every rank with its prefix, price and perks, and whether the player can try it, already has it or has to wait a few seconds. Left-click to try it on, right-click to just look at its items.
- While a rank is tried on, the player sees their own copy of the NPC: their skin, the rank's armour and held
items, and
<prefix> <name>above its head. Nobody else sees it; they keep seeing the normal NPC, so several players can use one NPC at the same time. - The rank's items show in a read-only window, or (with PacketEvents) in the player's own inventory, as if they had them. Only what they see changes: the real inventory is never touched.
- A pink countdown bar on the action bar, a sound each second, and a store link with the price at the end.
- The preview stops early if the player walks away, gets hurt, teleports, changes world, dies, leaves, closes the window or clicks the NPC again.
- Ranks can't be tried on during combat, while vanished, in staff mode, in spectator mode or in bed.
Ranks
- Each rank in
ranks.ymlhas a name, LuckPerms group, prefix, menu icon, price, store link, perks, armour and items. - Prefixes come from LuckPerms when the rank doesn't set its own, and players already in a rank's group see "You have this rank".
- Items can be a DriftEssentials kit, a list in
ranks.yml, or saved in game with/showcase setitemsand/showcase setarmour(enchantments, names and trims kept).
Requirements
- Paper or Folia on Minecraft 26.3
- Java 25 or newer
- Optional: LuckPerms (prefixes and owned ranks), PacketEvents (the inventory items mode), PlaceholderAPI, DriftCombat, DriftStaff, DriftEssentials (kits)
Installation
- Drop
DriftShowcase-<version>.jarinto your server'splugins/folder. - Start the server. DriftShowcase creates
plugins/DriftShowcase/withconfig.yml,ranks.yml,commands.yml,messages.ymlandmenus.yml. - Set up your ranks in
ranks.yml(or put on a rank's gear and run/showcase setarmour <rank>), then run/showcase reload. - Stand at spawn and run
/showcase npc create spawn.
Commands
The name, aliases, permission and usage can be changed in commands.yml. The admin parts always need
driftshowcase.admin.
| Command | Permission | What it does |
|---|---|---|
/showcase | driftshowcase.open | Open the ranks menu |
/showcase try <rank> | driftshowcase.open | Try a rank on straight away (at the closest NPC, or in front of you) |
/showcase help | driftshowcase.open | Show the commands |
/showcase npc create <id> | driftshowcase.admin | Make an NPC where you stand |
/showcase npc remove <id> | driftshowcase.admin | Remove an NPC |
/showcase npc move <id> | driftshowcase.admin | Move an NPC to where you stand |
/showcase npc skin <id> <player|none> | driftshowcase.admin | Change whose skin it wears |
/showcase npc name <id> <text|none> | driftshowcase.admin | Change the name above it (MiniMessage) |
/showcase npc list | driftshowcase.admin | List every NPC (click one to teleport) |
/showcase npc tp <id> | driftshowcase.admin | Teleport to an NPC |
/showcase setitems <rank> | driftshowcase.admin | Save your inventory and armour as the rank's items and armour |
/showcase setarmour <rank> | driftshowcase.admin | Save what you're wearing and holding as the rank's armour |
/showcase reload | driftshowcase.admin | Reload every file |
/showcase version | driftshowcase.admin | Show the version |
Aliases: /tryrank and /dshowcase. With open-without-npc: false under features in config.yml, players can only use the
NPC; /showcase and /showcase try then only work for staff.
Permissions
| Permission | Default | What it allows |
|---|---|---|
driftshowcase.open | everyone | Open the ranks menu with /showcase and try ranks on |
driftshowcase.bypass.cooldown | op | Try ranks on again straight away |
driftshowcase.admin | op | Manage NPCs and ranks, reload and see the version |
Right-clicking an NPC works for everyone.
Turning features on and off
The features section at the top of config.yml turns parts of the showcase on or off. Run /showcase reload after changing one (placeholders need a restart).
| Switch | Default | What it covers |
|---|---|---|
open-without-npc | true | Let players open the ranks menu with /showcase, and use /showcase try, anywhere. false means they have to walk up to a showcase NPC. Staff with driftshowcase.admin can always use the commands. |
try-on-look | true | While a rank is tried on, the NPC turns into the player wearing the rank's armour, with the rank's prefix over its head. |
item-preview | true | While a rank is tried on, the player sees the rank's items (in a window or their own inventory, see items-mode below). |
countdown-bar | true | The countdown bar on the action bar while a rank is tried on. |
store-link | true | The clickable store link when a preview ends (needs store-url set on the rank in ranks.yml). |
placeholders | true | The %driftshowcase_...% placeholders for PlaceholderAPI. |
open-without-npc used to be on its own further down the file. Servers that had it keep their value: it's moved into features on the next start.
Ranks
ranks:
vip:
display-name: "<color:#4ade80><bold>VIP"
luckperms-group: vip # used for the prefix and the "You have this rank" check
prefix: "" # empty = take the group's prefix from LuckPerms
icon: EMERALD
price: "$9.99"
store-url: "https://store.example.com/vip"
perks:
- "<gray>/fly in the lobby"
- "<gray>2 extra homes"
armour: # what the NPC wears
helmet: DIAMOND_HELMET
chestplate: DIAMOND_CHESTPLATE
leggings: DIAMOND_LEGGINGS
boots: DIAMOND_BOOTS
main-hand: DIAMOND_SWORD
off-hand: ""
glow: true # make the armour shimmer
leather-colour: "" # for leather armour, like "#f472b6"
kit: "" # show a DriftEssentials kit's items instead of the list below
items:
- DIAMOND_PICKAXE
- GOLDEN_APPLE:8
- An item is a material (
DIAMOND_SWORD), a material and amount (GOLDEN_APPLE:8), or a saved item. Saved items are the long codes/showcase setitemsand/showcase setarmourwrite; they keep names, enchantments and trims. kit:reads the kit straight fromplugins/DriftEssentials/kits.yml. DriftEssentials doesn't have to be running.- A player has a rank when they are in its LuckPerms group (directly or through another group), or were given
group.<name>. Without LuckPerms, only thegroup.<name>permission counts and the prefix inranks.ymlis used. - LuckPerms prefixes with
&colour codes and hex colours (&#f472b6) are turned into MiniMessage for you.
Configuration files
| File | What's in it |
|---|---|
config.yml | Whether /showcase works without an NPC, preview length, items mode, distance, cooldown, sounds, when ranks can't be tried on, NPC defaults |
ranks.yml | The ranks: names, groups, prefixes, icons, prices, store links, perks, armour and items |
commands.yml | The command's name, aliases, permission and usage. Name and alias changes need a restart |
messages.yml | Every message, in MiniMessage. Set one to "" to turn it off, or set prefix-enabled: false to hide the prefix |
menus.yml | The ranks menu and the items window: titles, sizes, which slots hold ranks and items (item-slots), and the buttons |
The prefix is DRIFTSHOWCASE in bold solid pink (#f472b6), followed by a dark grey ».
Every file starts with a boxed header saying how to apply changes, is split into sections, and has a note above
every option saying what it does, its unit and the values it takes. Run /showcase reload after editing; command
names and aliases need a restart.
When you update, new options are added with their notes and everything you changed is kept. When the notes
themselves change, config.yml, commands.yml, messages.yml and menus.yml are rebuilt once with the new notes
and your values written back in; the old file is kept in data/backups/. Messages you never changed get the new
default wording. ranks.yml is yours and is never rebuilt.
Mistakes in the files
A value DriftShowcase can't use never stops the plugin. The console says which file and option, what was wrong and what is used instead, for example:
config.yml: preview.seconds "five" isn't a whole number, using 5
ranks.yml: ranks.vip.items "DIAMOND_SWORDD" isn't an item (write it like DIAMOND_SWORD or GOLDEN_APPLE:8), so it was left out
/showcase reload tells you how many problems it found, so you know to look.
Folder layout
plugins/DriftShowcase/
config.yml settings, starting with the features: switches
ranks.yml the ranks players can try on
messages.yml every message
menus.yml the ranks menu and the items window
commands.yml the command name, aliases and permission
data/ the plugin's own files, no need to open them
npcs.yml the showcase NPCs, saved by /showcase npc
backups/ old copies of files DriftShowcase replaced
*.version which version of each file you have
*.layout
Older versions kept npcs.yml, the hidden .messages.yml.version, .menus.yml.version, .config.yml.layout and
.commands.yml.layout markers, and backups like messages.old.yml and config.old.yml next to config.yml. They
are moved into data/ the first time the new version starts (one console line per file), and nothing is
overwritten or deleted.
Items mode
preview.items-mode | How the items show |
|---|---|
window (default) | In a read-only window. Every click is cancelled, and closing it ends the preview. Works on every server |
inventory | In the player's own inventory. Needs PacketEvents; without it the window is used and the console says so once |
In inventory mode the server sends the player a fake copy of their inventory screen and holds back its own updates until the preview ends; then the real items are drawn again. While it shows, clicking, dragging, dropping, swapping hands, using, placing, breaking, eating, hitting and picking up are cancelled, because they would use the real item, not the one on screen.
Messages, sounds and menus
- The countdown is a pink ten-segment progress bar on the action bar, like the DriftEssentials teleport warmup.
Change it under
previewinmessages.yml. - The message at the end says why the preview stopped and has a clickable link to the rank's
store-url. - Sounds for the start, every second and the end are under
preview.soundsinconfig.yml. Replies to a player's own command or menu click play the success or error sound frommessages.yml. - The menus use the shared DriftSuite look: a black glass border,
◀ Previous page/Next page ▶and a red Close button.
PlaceholderAPI
| Placeholder | Value |
|---|---|
%driftshowcase_previewing% | true while the player is trying a rank on, otherwise false |
%driftshowcase_rank% | The id of the rank being tried on, or empty |
%driftshowcase_ranks% | How many ranks there are |
For developers
DriftShowcase calls two events:
com.itskoazt.driftshowcase.api.ShowcasePreviewStartEvent: a player is about to try a rank on. Cancel it to stop them.com.itskoazt.driftshowcase.api.ShowcasePreviewEndEvent: a preview ended.getReason()says why (FINISHED,MOVED,DAMAGED,TELEPORTED,CHANGED_WORLD,DIED,QUIT,CLOSED_WINDOW,CLICKED_AGAIN,DISABLED).
Works with other DriftSuite plugins
Every feature lives in exactly one DriftSuite plugin, so no two plugins fight over the same command, chat message or part of the screen.
| Plugin | Handles |
|---|---|
| DriftChat | Chat format, public chat filter, emojis, mentions, announcements, join and leave messages, cross-server chat, private messages (/msg, /reply, /ignore) and private message spy (/spymsg, /socialspy) |
| DriftStaff | Staff mode, vanish, punishments, reports, staff chat, staff teleports (/stp, /stphere), /invsee, /clearchat, /lockchat, /slowchat, command/sign/book spy, filter for private messages and signs, 2FA |
| DriftTAB | Tab list, name tags, sidebar scoreboard, boss bars and other tab list features |
| DriftTags | Tags and the tag menu. Tags are shown through %drifttags_tag% in DriftChat and DriftTAB |
| DriftEconomy | Currencies, /pay, Vault and Treasury |
| DriftCombat | Combat tagging, combat-log punishments, combat timer in the action bar and boss bar, safe zones, item cooldowns |
| DriftLag | Entity clearing, entity and spawner limits, lag tools |
| DriftHomes | Homes, the homes menu, public homes, home invites and /visit |
| DriftEssentials | Spawn, warps, /tpa, /back, /rtp, kits, nicknames, AFK, /motd, player tools (/craft, /enderchest, /hat, /trash) and admin shortcuts (/gmc, /fly, /heal, /speed) |
| DriftShowcase | The rank showcase NPC: try a rank's look and items before buying it |
How they work together:
- DriftStaff marks vanished staff with the standard
vanishedmetadata. DriftTAB leaves them out of the tab list and online counts, DriftChat treats them as offline in/msg,/ignoreand tab completion, DriftEssentials leaves them out of/tpa,/nearand/seen, and they can't be hurt, so DriftCombat never puts them in combat. - DriftStaff mutes and
/lockchatstop a message before DriftChat formats it, and muted players can't use/msg. - DriftChat filters public chat. DriftStaff filters private messages, other commands and signs. Every message is filtered once.
- DriftLag never removes or limits NPCs, including DriftCombat's combat-log NPCs.
- DriftHomes and DriftEssentials ask DriftCombat before every teleport, so
/home,/spawn,/warp,/tpa,/backand/rtpare blocked during combat. Both use the same warmup, cooldown and safe-landing rules. /backin DriftEssentials remembers where/homeand/visittook you from.- DriftChat sends join and leave messages. DriftEssentials only adds the first-join welcome and
/motd. - Staff teleports stay in DriftStaff. DriftEssentials only has the player ones (
/tpa,/spawn,/warp,/back). - DriftEssentials nicknames are the player's display name, which DriftChat's
{displayname}shows, and%driftessentials_nick%works in DriftTAB. - DriftStaff's
/checkmenu has a button that opens the player's DriftHomes homes. - Prices in DriftHomes and DriftEssentials go through Vault, so they use DriftEconomy when
features.vaultis on in its config. - For a combat sidebar, add a DriftTAB scoreboard with
display-condition: "%driftcombat_in_combat_raw%=true". DriftCombat's README has the full example. - DriftShowcase reads DriftEssentials kits straight from its
kits.yml, so a rank in the showcase can show a kit's items. - DriftShowcase shows LuckPerms group prefixes above its NPC and in its ranks menu, and knows which ranks a player already has. It only reads from LuckPerms and never gives a group or permission.
- DriftShowcase asks DriftCombat before every preview, so ranks can't be tried on during combat. Vanished staff and staff in DriftStaff's staff mode can't try them on either.