MC-Market is now BuiltByBit. Read more

  • We're giving away $35,000 of prizes! Invite 2 friends to our Discord for free Premium! Learn more

RepairTokens 1.1

Register now to download for free
Repair your items in a cool new way.
Commands:
  • /addtokens <player> <amount> - Adds the specified amount of tokens to that player's balance.
  • /savetokens - Saves the current token data of all the players in the server.
  • /tokenbalance [player] - Displays current token balance of a player or yourself.
  • /tokenrepair - Repairs a tool handle back to it's former tool.
  • /settokens <player> <amount> - Sets the player's balance to the amount specified.
Permissions:
  • repairtokens.addtokens - Allows players to execute the /addtokens command.
  • repairtokens.savetokens - Allows players to execute the /savetokens command.
  • repairtokens.balance - Allows players to execute the /tokenbalance command without the player argument.
  • repairtokens.balance.others - Allows players to execute the /tokenbalance command on other players.
  • repairtokens.repair - Allows players to execute the /tokenrepair command.
  • repairtokens.settokens - Allows players to execute the /settokens command.
Usage:

Currently it only works with tools that you break blocks with.

Once a tool is broken you'll be given a tool handle (stick) that will contain the name, enchantments and lore from the previous item that broke. Hold that item and run the command /tokenrepair and if you have a token it will restore your item.

Files:

Config.yml

Code:
#The valid place holders are {tokens} and {player} they can only be used in messages that use them by default.

addtokens_failed: '&CSorry, that player is invalid.'
addtokens_success: '&4Added &A{tokens} tokens &4to &A{player}&4.'
settokens_failed: '&CSorry, that player is invalid.'
settokens_success: '&4Set &A{player} &4balance to &A{tokens}&4.'
save_success: '&4Saved token data.'
tokenbalance_self_success: '&4Your balance is &A{tokens}&4 tokens.'
tokenbalance_others_success: '&A{player} &4has a balance of &A{tokens}&4 tokens.'
tokenbalance_others_invalid: '&CSorry, that player is invalid.'
tokenrepair_failed_item: '&CYou have to be holding a tool handle.'
tokenrepair_failed_balance: '&CInsufficient funds, check your /tokenbalance.'
tokenrepair_success_item: '&4Your item has been restored!'
item_broken_event: '&4Your item has broken use /tokenrepair to fix it.'

#This is all the tools that will use the token repairing system.
#Item examples:
#Axe: TYPE_AXE
#Shovel: TYPE_SPADE
#Pick: TYPE_PICKAXE
#Case doesn't matter.
#Only tools that you normally break blocks with if AutoSell is present in the server.

tools:
  - DIAMOND_PICKAXE
  - IRON_PICKAXE
  - GOLD_PICKAXE
  - STONE_PICKAXE
  - WOOD_PICKAXE

Plugin.yml
Code:
name: RepairTokens
version: 1.0
author: Apteryx
description: Creates a new mechanic that allows players to repair items via tokens.
main: me.apteryx.repairtokens.RepairTokens
commands:
  addtokens:
  description: Add tokens to a player's balance.
  usage: /addtokens <name> <amount>
  aliases: atokens
  savetokens:
  description: Save data to the token data file.
  usage: /savetokens
  aliases: satokens
  tokenbalance:
  description: Get your current or a players token balance.
  usage: /tokenbalance [name]
  aliases:
  - tbalance
  - tbal
  tokenrepair:
  description: Repairs tool handles to their former state.
  usage: /tokenrepair
  aliases: trepair
  settokens:
  description: Sets tokens in a player's balance.
  usage: /settokens <name> <amount>
  aliases: stokens

Thanks clip for helping me figure out the issue.

Thanks Nmap for the great idea. :)

Author

Author
Farnsworth
Downloads
23
Views
773
First release
Last update
Rating
Not yet rated
Top
You need to upgrade!
Our dark style is reserved for our Premium members. Upgrade here.