Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 93c68325fe | |||
| 95a564c5e3 | |||
| f0e6187ed0 | |||
| 263b8c59d8 | |||
| a39bfee803 | |||
| 03f650ce3b | |||
| 35cbd84146 | |||
| c9f57dae9e | |||
| 83949d63b5 | |||
| 68aae5c917 | |||
| 0818fe8eab |
@@ -0,0 +1,143 @@
|
|||||||
|
# Spawn building setup — wiring NPCs to bnstoolkit screens
|
||||||
|
|
||||||
|
How to give players access to the Exchange / Bounty Board / Plot
|
||||||
|
Office / Civic Registrar via Easy NPC dialogue at spawn.
|
||||||
|
|
||||||
|
## Prerequisites (one-time, post-wipe)
|
||||||
|
|
||||||
|
```
|
||||||
|
/setworldspawn ~ ~ ~ # set the canonical world spawn
|
||||||
|
/bns admin spawn-init # creates Spawn (cyan) + Plots (gold)
|
||||||
|
# FTB Teams and claims existing plots
|
||||||
|
```
|
||||||
|
|
||||||
|
If you also want spawn protection: switch to the Spawn team and claim
|
||||||
|
your spawn town chunks via the FTB Chunks map (M key, left-click).
|
||||||
|
|
||||||
|
## The five screens you can expose
|
||||||
|
|
||||||
|
| Screen | Open command | What it does |
|
||||||
|
|---|---|---|
|
||||||
|
| Hub | `/bns open hub` | Status overview (tier, balance, bounties, plots) |
|
||||||
|
| Exchange | `/bns open exchange` | Wealth exchange — sell diamonds/netherite/ancient debris for spurs |
|
||||||
|
| Bounty Board | `/bns open bounty` | Today's 5 bounties + accept/cancel/turn-in |
|
||||||
|
| Plot Office | `/bns open plot` | Buy / release plots |
|
||||||
|
| Civic Tier | `/bns open tier` | Pay spurs to upgrade tier |
|
||||||
|
| Adventurer's Journal | `/bns open journal` | Status overview + active bounties + exchange rates |
|
||||||
|
|
||||||
|
`hub` and `journal` are status-only (read). The other four are
|
||||||
|
transactional — they should be gated behind an NPC at the relevant
|
||||||
|
spawn building.
|
||||||
|
|
||||||
|
## Per-building setup (Exchange example)
|
||||||
|
|
||||||
|
Repeat for each of the 4 transactional buildings, varying just the
|
||||||
|
screen name and NPC name.
|
||||||
|
|
||||||
|
### 1. Spawn the NPC
|
||||||
|
|
||||||
|
In creative mode, get an Easy NPC spawn egg:
|
||||||
|
```
|
||||||
|
/give @s easy_npc:custom_egg
|
||||||
|
```
|
||||||
|
|
||||||
|
Right-click the ground where you want the NPC. It spawns a customisable
|
||||||
|
NPC.
|
||||||
|
|
||||||
|
### 2. Configure appearance + name
|
||||||
|
|
||||||
|
Right-click the NPC → **Configuration** (or use the wrench).
|
||||||
|
- **Skin**: pick a fitting villager / human skin
|
||||||
|
- **Name**: "Exchange Clerk" (or whatever fits the building)
|
||||||
|
- **Profession**: optional — purely cosmetic
|
||||||
|
|
||||||
|
### 3. Configure dialog
|
||||||
|
|
||||||
|
In the NPC config → **Dialog** tab.
|
||||||
|
|
||||||
|
Create a new STANDARD dialog. Suggested text:
|
||||||
|
> Welcome to the Exchange. We exchange diamonds, netherite, and
|
||||||
|
> ancient debris for spurs deposited directly to your bank account.
|
||||||
|
> Care to make a trade?
|
||||||
|
|
||||||
|
Add a **Button** to this dialog:
|
||||||
|
- **Label**: "Open the exchange"
|
||||||
|
- **Type**: ACTION
|
||||||
|
- **Action**: COMMAND
|
||||||
|
- **Command**: `bns open exchange`
|
||||||
|
- **Execute as user**: ✅ (must be enabled)
|
||||||
|
- **Permission level**: 0 (no special permission needed)
|
||||||
|
- **Trailing action**: CLOSE_DIALOG (optional — closes the dialog after click)
|
||||||
|
|
||||||
|
Add another button "Goodbye" → CLOSE_DIALOG for the polite exit.
|
||||||
|
|
||||||
|
### 4. Configure trigger
|
||||||
|
|
||||||
|
In the NPC config → **Actions** tab:
|
||||||
|
- Event: **ON_INTERACTION**
|
||||||
|
- Action: **OPEN_DEFAULT_DIALOG**
|
||||||
|
|
||||||
|
Now when a player right-clicks the NPC, the dialog opens. Clicking
|
||||||
|
"Open the exchange" runs `/bns open exchange` as that player and
|
||||||
|
the Exchange screen pops up.
|
||||||
|
|
||||||
|
## Building-to-screen mapping
|
||||||
|
|
||||||
|
| Building | NPC name suggestion | Open command |
|
||||||
|
|---|---|---|
|
||||||
|
| Exchange | Exchange Clerk | `bns open exchange` |
|
||||||
|
| Adventurer's Guild | Bounty Officer | `bns open bounty` |
|
||||||
|
| Plot Office | Plot Clerk | `bns open plot` |
|
||||||
|
| Civic Hall / Town Hall | Civic Registrar | `bns open tier` |
|
||||||
|
| (anywhere — optional) | Quartermaster | `bns open hub` |
|
||||||
|
| (anywhere — optional) | Cartographer | `bns open journal` |
|
||||||
|
|
||||||
|
## Security gate (one-time, already shipped)
|
||||||
|
|
||||||
|
The Easy NPC config at `/srv/fast/brass-sigil-server/server/config/
|
||||||
|
easy_npc/security.cfg` has `executeAsUserCommandAllowList.ALL=bns`,
|
||||||
|
so dialogue actions can run `/bns ...` on the player's behalf. This
|
||||||
|
ships with the pack as of v0.36.0 — no manual edit required after
|
||||||
|
fresh installs.
|
||||||
|
|
||||||
|
## Testing your setup
|
||||||
|
|
||||||
|
1. Build the building
|
||||||
|
2. Place the NPC
|
||||||
|
3. Configure the dialog as above
|
||||||
|
4. Switch to survival, walk up, right-click the NPC
|
||||||
|
5. Click the action button
|
||||||
|
6. The screen should open on your client immediately
|
||||||
|
|
||||||
|
If nothing happens:
|
||||||
|
- Check chat for errors ("Blocked execute-as-user command root ...")
|
||||||
|
- If you see that, the security.cfg allowlist is missing `bns` — see
|
||||||
|
the security gate section above
|
||||||
|
- Otherwise: check the server log for `[bnstoolkit] /bns open <screen>`
|
||||||
|
to confirm the command actually fired
|
||||||
|
|
||||||
|
## What if I just want to test as op (no NPC)
|
||||||
|
|
||||||
|
You can always run `/bns open <screen>` directly from chat or console
|
||||||
|
to open a screen for yourself. The op-level requirement is none — the
|
||||||
|
command works for any player. NPCs are just the in-world surface.
|
||||||
|
|
||||||
|
## Pre-wipe testing checklist (current world)
|
||||||
|
|
||||||
|
Each feature, where you'd manually test it before the wipe:
|
||||||
|
|
||||||
|
| Feature | How to test |
|
||||||
|
|---|---|
|
||||||
|
| Hub | Press B → see status panel with tier/cash/bank/total/bounties/plots |
|
||||||
|
| Exchange | `/bns open exchange` → 4 items in grid (diamond, diamond_block, netherite_ingot, ancient_debris), inventory count badge bottom-right of each cell, fee + per-unit price in detail pane, Sell 1/16/64 buttons grey out when you don't have enough |
|
||||||
|
| Sell flow | `/give @s minecraft:diamond 64` → click diamond → Sell 16 → bank balance ticks up, sell button updates |
|
||||||
|
| Bounty Board | `/bns open bounty` → see today's pool, click a bounty for detail, accept, kill the targets, turn in |
|
||||||
|
| Plot Office | `/bns open plot` → see 3 default plots, buy p001 (tier 3+ required), check FTB Chunks map M — chunk should turn your team colour |
|
||||||
|
| Plot unclaim guard | After buying a plot, try to unclaim its chunk via FTB Chunks UI → should reject with redirect message |
|
||||||
|
| Civic Tier | `/give @s numismatics:spur 500` or `/bns wallet deposit ...` → `/bns open tier` → click Upgrade — pays from cash + bank combined |
|
||||||
|
| Wallet | `/bns wallet`, `/bns wallet deposit 50`, `/bns wallet withdraw 50` |
|
||||||
|
| Auto-bound card | Look in inventory — should already have a white_card bound to your account |
|
||||||
|
| Villager rebalance | Trade with a villager — emerald-side replaced with spurs/bevels/cogs |
|
||||||
|
| Quest Log auto-open population | Press B → click Journal → should show active bounties, rates, plots |
|
||||||
|
|
||||||
|
If any of these break, ping with the details. Pre-wipe is the time to find these bugs.
|
||||||
@@ -59,12 +59,14 @@ const BOUNTY_POOL = [
|
|||||||
{ id: 'b_wither_skel_3', name: 'Slay 3 Wither Skeletons', target: 'minecraft:wither_skeleton', count: 3, type: 'kill', reward: 150, source: "Adventurer's Guild" },
|
{ id: 'b_wither_skel_3', name: 'Slay 3 Wither Skeletons', target: 'minecraft:wither_skeleton', count: 3, type: 'kill', reward: 150, source: "Adventurer's Guild" },
|
||||||
{ id: 'b_shulker_3', name: 'Slay 3 Shulkers', target: 'minecraft:shulker', count: 3, type: 'kill', reward: 200, source: "Adventurer's Guild" },
|
{ id: 'b_shulker_3', name: 'Slay 3 Shulkers', target: 'minecraft:shulker', count: 3, type: 'kill', reward: 200, source: "Adventurer's Guild" },
|
||||||
|
|
||||||
// ── Boss tier (rare picks) ──
|
// ── Boss tier (rare picks) — all vanilla 1.21.x ──
|
||||||
{ id: 'b_warden_1', name: 'Slay the Warden', target: 'minecraft:warden', count: 1, type: 'kill', reward: 800, source: "Adventurer's Guild" },
|
{ id: 'b_warden_1', name: 'Slay the Warden', target: 'minecraft:warden', count: 1, type: 'kill', reward: 800, source: "Adventurer's Guild" },
|
||||||
{ id: 'b_voidworm_1', name: 'Destroy a Void Worm', target: 'alexsmobs:void_worm', count: 1, type: 'kill', reward: 1200, source: "Adventurer's Guild" },
|
{ id: 'b_breeze_3', name: 'Hunt 3 Breezes', target: 'minecraft:breeze', count: 3, type: 'kill', reward: 250, source: "Adventurer's Guild" },
|
||||||
{ id: 'b_warped_mosco_1', name: 'Slay a Warped Mosco', target: 'alexsmobs:warped_mosco', count: 1, type: 'kill', reward: 700, source: "Adventurer's Guild" },
|
{ id: 'b_bogged_5', name: 'Slay 5 Bogged', target: 'minecraft:bogged', count: 5, type: 'kill', reward: 120, source: "Adventurer's Guild" },
|
||||||
{ id: 'b_farseer_1', name: 'Slay the Farseer', target: 'alexsmobs:farseer', count: 1, type: 'kill', reward: 900, source: "Adventurer's Guild" },
|
{ id: 'b_evoker_2', name: 'Slay 2 Evokers', target: 'minecraft:evoker', count: 2, type: 'kill', reward: 350, source: "Adventurer's Guild" },
|
||||||
{ id: 'b_skreecher_1', name: 'Slay a Skreecher', target: 'alexsmobs:skreecher', count: 1, type: 'kill', reward: 400, source: "Adventurer's Guild" },
|
{ id: 'b_vindicator_4', name: 'Slay 4 Vindicators', target: 'minecraft:vindicator', count: 4, type: 'kill', reward: 180, source: "Adventurer's Guild" },
|
||||||
|
{ id: 'b_piglin_brute_2', name: 'Slay 2 Piglin Brutes', target: 'minecraft:piglin_brute', count: 2, type: 'kill', reward: 400, source: "Adventurer's Guild" },
|
||||||
|
{ id: 'b_ravager_1', name: 'Hunt down a Ravager', target: 'minecraft:ravager', count: 1, type: 'kill', reward: 500, source: "Adventurer's Guild" },
|
||||||
];
|
];
|
||||||
|
|
||||||
// Index pool by id for O(1) lookup
|
// Index pool by id for O(1) lookup
|
||||||
@@ -344,4 +346,14 @@ ServerEvents.commandRegistry(event => {
|
|||||||
event.register(bountyCmd);
|
event.register(bountyCmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ─── First-login pool roll ─────────────────────────────────────────
|
||||||
|
// Without this, new players see an empty Bounty Board until they type
|
||||||
|
// /bns bounty list (which triggers ensurePoolFresh). The board reads
|
||||||
|
// bnsBountyPool from NBT; bnsBountyPool stays empty until rollDailyPool
|
||||||
|
// runs. This hook closes the gap so the screen is populated the first
|
||||||
|
// time it's opened.
|
||||||
|
PlayerEvents.loggedIn(event => {
|
||||||
|
ensurePoolFresh(event.player);
|
||||||
|
});
|
||||||
|
|
||||||
console.info('[bns/bounty_engine] loaded — ' + BOUNTY_POOL.length + ' bounties in catalogue');
|
console.info('[bns/bounty_engine] loaded — ' + BOUNTY_POOL.length + ' bounties in catalogue');
|
||||||
|
|||||||
@@ -109,19 +109,20 @@ ServerEvents.commandRegistry(event => {
|
|||||||
}
|
}
|
||||||
const nextTier = cur + 1;
|
const nextTier = cur + 1;
|
||||||
const nextCfg = bnsTier.config(nextTier);
|
const nextCfg = bnsTier.config(nextTier);
|
||||||
const balance = countCoins(player);
|
|
||||||
if (balance < nextCfg.cost) {
|
// Combined cash+bank deduction via bnstoolkit Java bridge.
|
||||||
|
// Pulls inventory coins first, then bank for the remainder.
|
||||||
|
const Bridge = Java.loadClass('uk.sijbers.bnstoolkit.economy.NumismaticsBridge');
|
||||||
|
const ok = Bridge.spend(player, nextCfg.cost);
|
||||||
|
if (!ok) {
|
||||||
|
const cash = countCoins(player);
|
||||||
|
const bank = Bridge.balanceOf(player);
|
||||||
player.tell(Text.red(
|
player.tell(Text.red(
|
||||||
'Upgrade to ' + nextCfg.name + ' costs ' + nextCfg.cost + ' spurs. You have ' + balance + '.'
|
'Upgrade to ' + nextCfg.name + ' costs ' + nextCfg.cost + ' spurs. ' +
|
||||||
|
'You have ' + cash + ' cash + ' + bank + ' bank = ' + (cash + bank) + ' total.'
|
||||||
));
|
));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const took = takeCoins(player, nextCfg.cost);
|
|
||||||
if (took < nextCfg.cost) {
|
|
||||||
giveCoins(player, took);
|
|
||||||
player.tell(Text.red('Coin removal failed — refunded. Try again.'));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// Promote via FTB Ranks
|
// Promote via FTB Ranks
|
||||||
const rankId = TIER_RANK_ID[nextTier];
|
const rankId = TIER_RANK_ID[nextTier];
|
||||||
Utils.server.runCommandSilent('ftbranks add ' + player.username + ' ' + rankId);
|
Utils.server.runCommandSilent('ftbranks add ' + player.username + ' ' + rankId);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+2
-13
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"$schema": "Brass-and-Sigil pack.lock.json - generated, do not edit by hand unless you know what you are doing",
|
"$schema": "Brass-and-Sigil pack.lock.json - generated, do not edit by hand unless you know what you are doing",
|
||||||
"name": "Brass and Sigil",
|
"name": "Brass and Sigil",
|
||||||
"version": "0.39.0",
|
"version": "0.41.2",
|
||||||
"minecraft": "1.21.1",
|
"minecraft": "1.21.1",
|
||||||
"loader": {
|
"loader": {
|
||||||
"type": "neoforge",
|
"type": "neoforge",
|
||||||
"version": "21.1.228"
|
"version": "21.1.228"
|
||||||
},
|
},
|
||||||
"lockedAt": "2026-06-08T15:30:12Z",
|
"lockedAt": "2026-06-08T18:22:06Z",
|
||||||
"mods": [
|
"mods": [
|
||||||
{
|
{
|
||||||
"source": "modrinth",
|
"source": "modrinth",
|
||||||
@@ -1054,17 +1054,6 @@
|
|||||||
"size": 193381,
|
"size": 193381,
|
||||||
"side": "both"
|
"side": "both"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"source": "modrinth",
|
|
||||||
"slug": "alexs-mobs(1.21.1)",
|
|
||||||
"versionId": "KSgki4uc",
|
|
||||||
"version": "1.22.17",
|
|
||||||
"path": "mods/alexsmobs-1.22.17.jar",
|
|
||||||
"url": "https://cdn.modrinth.com/data/EmNhnNnt/versions/KSgki4uc/alexsmobs-1.22.17.jar",
|
|
||||||
"sha1": "5070e8070f60650d773bfd9f1d031496f8f50259",
|
|
||||||
"size": 26620546,
|
|
||||||
"side": "both"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"source": "modrinth",
|
"source": "modrinth",
|
||||||
"slug": "item-obliterator",
|
"slug": "item-obliterator",
|
||||||
|
|||||||
Reference in New Issue
Block a user