This plugin allows a player to purchase a lucky drink using his/her in-game $, Tokens (from TokenEnchant), Exp, ExpLevel or even items.  Once the drink is purchased, a player can drink it to see whether s/he was lucky!  If s/he were lucky, you will get rewards!  Server owners can set various type s of rewards in the form of command execution (rewarding more $, Tokens, exp, or even items).

This plugin provides a command to issue with a lucky drink.  You may need to use other plugins like DeluxeMenus, ChestCommand to create your own GUI shop so that players can purchase your lucky drinks through a nice GUI.

Video demo:
Coming soon....

Commands: (alias: /ld)
  • /luckydrink help : displays the help menu
  • /luckydrink reload : reloads config.yml
  • /luckydrink give <player> <n:drinkname> <c:cost> <a:amount> <ch:winchance> <l:gainlore> <cmd:command>" : gives <player> a lucky drink whose name is "drinkname", and cost is "cost", amount is "amount", the chance of getting lucky is "winchance", the lore on the drink is "gainlore", and the command being executed upon being lucky is "command".

    For instance:

    >/ld give vk2gpz n:Gamble<s>Tokens! c:60Token a:1 ch:60 l:Let's<s>see! cmd:te<s>give<s>vk2gpz<s>1500

    Will give the player "vk2gpz" 1 drink with the 60% chance of being lucky and it will cost 60 Tokens.  If vk2gpz is lucky when he drinks this, the command "te give vk2gpz 1500" will be executed.
  • <c:cost> section supports:
    • $ -> c:50$
    • Token -> c:60Token
    • Exp -> c:15exp
    • ExpLevel -> c:2explvl
    • Item -> c:3DIAMOND_BLOCK  (meaning it will cost 3 diamond blocks.)
      Or  c: 4GOLDEN_APPLE1 (meaning it will cost 4 enchanted gapples.)

Permissions:
  • luckydrink.reload : allows you to use /ld reload command
  • luckydrink.admin : allows you to use /ld give command

NOTE: in order to place "space" in lucky drink's command, you can use "<s>", which will be replaced with " ".

Sample config using DeluxeMenus:
menu_title: '&fLucky Dring &aGUI menu'[/FONT][/COLOR][/font][/color][/font][/size][/color]
open_command: ldgui
size: 9
items:
  '1':
    material: POTION
    data: 8193
    slot: 0
    display_name: '&aGamble away your $$$'
    lore:
    - '&aYou can purchase the lucky drink'
    - '&aYou might get lucky!'
    - '&aPrice: &e$50'
    left_click_commands:
    - '[console] eco give %player_name% 50'
    - "[console] ld give %player_name% n:Gamble<s>$$$! c:50$ a:1 ch:40 l:Let's<\
s>see! cmd:eco<s>give<s>%player_name%<s>3000"
    - '[close]'
    right_click_commands:
    - '[console] eco give %player_name% 50'
    - "[console] ld give %player_name% n:Gamble<s>$$$! c:50$ a:1 ch:40 l:Let's<\
s>see! cmd:eco<s>give<s>%player_name%<s>3000"
    - '[close]'
  '2':
    material: POTION
    data: 8227
    slot: 1
    display_name: '&aGamble away your Token!'
    lore:
    - '&aYou can purchase the lucky drink'
    - '&aYou might get lucky!'
    - '&aPrice: &e60 tokens'
    left_click_commands:
    - '[console] te add %player_name% 60'
    - "[console] ld give %player_name% n:Gamble<s>Tokens! c:60Token a:1 ch:60 l\
:Let's<s>see! cmd:te<s>give<s>%player_name%<s>1500"
    - '[close]'
    right_click_commands:
    - '[console] te add %player_name% 60'
    - "[console] ld give %player_name% n:Gamble<s>Tokens! c:60Token a:1 ch:60 l\
:Let's<s>see! cmd:te<s>give<s>%player_name%<s>1500"
    - '[close]'
  '3':
    material: POTION
    slot: 2
    display_name: '&aGamble away your Exp!'
    lore:
    - '&aYou can purchase the lucky drink'
    - '&aYou might get lucky!'
    - '&aPrice: &e3 exp'
    left_click_commands:
    - '[console] exp give %player_name% 1000'
    - "[console] ld give %player_name% n:Gamble<s>Exp! c:3exp a:1 ch:60 l:Let's\
<s>see! cmd:exp<s>give<s>%player_name%<s>3000"
    - '[close]'
    right_click_commands:
    - '[console] exp give %player_name% 1000'
    - "[console] ld give %player_name% n:Gamble<s>Exp! c:3exp a:1 ch:60 l:Let's\
<s>see! cmd:exp<s>give<s>%player_name%<s>3000"
    - '[close]'
  '4':
    material: POTION
    slot: 3
    display_name: '&aGamble away your Item!'
    lore:
    - '&aYou can purchase the lucky drink'
    - '&aYou might get lucky!'
    - '&aPrice: &e3 Diamond block'
    left_click_commands:
    - '[console] give %player_name% DIAMOND_BLOCK 4'
    - "[console] ld give %player_name% n:Gamble<s>Items! c:3DIAMOND_BLOCK a:1 c\
h:60 l:Let's<s>see! cmd:give<s>%player_name%<s>DIAMOND_BLOCK<s>10"
    - '[close]'
    right_click_commands:
    - '[console] give %player_name% DIAMOND_BLOCK 4'
    - "[console] ld give %player_name% n:Gamble<s>Items! c:3DIAMOND_BLOCK a:1 c\
h:60 l:Let's<s>see! cmd:give<s>%player_name%<s>DIAMOND_BLOCK<s>10"
    - '[close]'

Installation:
Just install LuckyDrink.jar in the plugin folder. Then you can either "restart the server" or "reload the plugin.

Configuration:

# +------------------------------------------------------------+ #
# LuckyDrink Configuration
# +------------------------------------------------------------+ #

# NOTE: Do NOT put tabs anywhere in the config!

Messages:
  ErrorMsg : "&c[LuckyDrink] Some error occured."
  LostMsg: "&c[LuckyDrink] Good Luck Next Time!"
  WinMsg: "&a[LuckyDrink] Congratz!"
  PlayerOffline: "&c[LuckyDrink] Player %player% is not online!"
  CostNotValid: "&c[LuckyDrink] The cost (%cost%) is not valid!"
  AmountNotValid: "&c[LuckyDrink] The amount (%amount%) is not valid!"
  WinningChanceNotValid: "&c[LuckyDrink] The winning hcance value (%chance%) is not valid!"
  NotEnoughMoney: "&c[LuckyDrink] Not enough moeny!"
  NotEnoughToken: "&c[LuckyDrink] Not enough token!"
  NotEnoughExp: "&c[LuckyDrink] Not enough exp!"
  NotEnoughItems: "&c[LuckyDrink] Not enough item!"

HelpMessages:
  banner:
    msg: "=== &e[&aLuckyDrink Commands List (%version%)&e] &r==="
  help:
    msg: "&a/luckydrink help : displays this help menu."
  reload:
    msg: "&a/luckydrink reload : reloads config file."
    permission: "luckydrink.reload"
  debug:
    msg: "&a/luckydrink debug <true|false> : turn on / off the debug mode."
    permission: "luckydrink.debug"
  give:
    msg: "&a/luckydrink give <player> <n:drinkname> <c:cost> <a:amount> <ch:winchance> <l:gainlore> <cmd:command>"

# ChanceLore must contain %chance% followed by a '%' character to indicate the chance of winning
ChanceLore: "&aChance to Win : %chance%%"

# if this option is true, the internal information will be
# stored in NBT
UseNBT: false

# unsuccessful command
# if the player was unluck,y this command will be executed
# if this option is set to "", nothing will be executed.
#Unsuccessful: "jail %player%"
UnsuccessfulCmd: ""

MoneySymbol: "$"
TokenSymbol: "Token"
ExpSymbol: "exp"