← All articles

RP Server Economy on Custom Villagers: Protecting Currency with custom_data

A paper note, guild pass, ration token, or stamped certificate only works as server currency if players cannot duplicate it with a renamed vanilla item. The easiest defense is to make your economy read item identity through components, not just through the visible name.

Open villager trade builder

Why visible names are not enough

If your villager only asks for a paper named City voucher, any player with an anvil can fake it. Lore alone is also weak, because it still lives in visible text. For economy items, the villager should validate an invisible payload inside the stack.

Use minecraft:custom_data as the identity layer

In modern versions you can attach a hidden component to the currency item. The visible label can still say Guild voucher, but the real check lives in a structured object.

components:{
  "minecraft:custom_name":'[{"text":"Guild voucher","italic":false}]',
  "minecraft:custom_data":{currency:"guild_voucher",issuer:"capital_bank",tier:"silver"}
}

Why this protects the economy

Practical villager pattern

When you build the buy stack for a trade, add the same custom_data object there. That way the villager accepts only the real token, not an imitation with copied text.

buy:{
  id:"minecraft:paper",
  count:3,
  components:{
    "minecraft:custom_name":'[{"text":"Guild voucher","italic":false}]',
    "minecraft:custom_data":{currency:"guild_voucher",issuer:"capital_bank",tier:"silver"}
  }
}

Good economy rules for RP servers

When to split currencies

Use separate IDs for money that should not mix. For example, temple donation slips, military payroll chits, and black-market coupons can all be paper, but they should never share the same custom_data payload.

Recommended workflow

  1. Create the reward and payment items with matching custom_data.
  2. Give them a readable visible name for players.
  3. Use the villager trade builder to lock the payment stack to that hidden payload.
  4. Test the trade with a fake renamed copy before shipping it live.