Gambling plugin

Discussion in 'Plugin Help/Development/Requests' started by pale1, Jan 7, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    pale1

    Plugin category: Economy

    Suggested name: GamblingBar

    What I want:
    I've seen this type of plugin requested here before a few times but each time I saw it, it was either a buggy plugin or the plugin wasn't very customizable.

    What I want to have is a gambling plugin where you purchase food or drinks from a shop command. These food/drink items aren't like normal drink items since when they are eaten, there is a chance that they will give you a money reward.

    Typing /bar should open up the bar gui where you will be able to buy drinks or food from a menu like this:
    [​IMG]
    You would left click on a food/drink to buy it. When you do it's put into your inventory. Upon consumption of the item, you have a chance of gaining a specified amount of money.

    Here's the format for how an item should look while it's in the shop. When it's in your inventory, the item should have the same look except without the "Price:" part.
    [​IMG]

    These are the things I want to be able to set up on my own through some sort of config file:
    1. A way to toggle which slots are enabled
    For example:
    slot1:
    enable: true
    [Other stuff here]
    2. Name, Cost, Drink Message (the message you see in chat when you drink/eat the item), Reward, Win Chance, Purchase message (the message you see in chat when you buy the item), Item id.
    3. The plugin should be able to support colored text for the names and it would be cool if you could make a way to modify the color of the lore for all drinks. So each section (Reward, Win chance, Cost) and their respective numbers, whether its a probability or a amount of money, can have a color I can change at any time (All the drinks will have the same color menus)

    Note: It would be nice if you could chance the color of the potion.
    Note: If food isn't possible to make for this plugin, then it's ok for you to just use potions

    Ideas for commands: /bar

    Ideas for permissions:
    gamblingbar.bar (Allow users to use /bar)
    gamblingbar.buy.slot<#> (Allow users to buy a certain drink from the bar)
    gamblingbar.use.slot<#> (Allow users to drink a certain drink from the bar)

    When I'd like it by: By next monday
     
    Last edited: Jan 7, 2015
  2. Offline

    Permeer

    @pale1 I will do it ;)

    @pale1 Theres a price to buy , the amount of reward and the chache to win the reward like 10 % ?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  3. Offline

    pale1

    Each drink would have the Price (only shown in the buying menu), the Reward, and the chance to win which should be x/100 where x is a number from 0-100.
     
  4. Offline

    Permeer

    @pale1 Ive made it , for buy and reward will you use Vault ?

    [​IMG]
     
    Last edited: Jan 7, 2015
  5. Offline

    pale1

    Very nice formatting but do you know if there is a way to make it so the effect(strength) is removed? if you don't know how to, that's fine since you can change them into water bottles. Also does it work with food too?

    I do use Vault so I guess you can use it for buy/reward.
     
  6. Offline

    Permeer

    i will try remove it and it work with all items

    Questions:

    What version do you want?

    It will be public?
     
  7. Offline

    pale1

    Can you make it for 1.8.
    I would prefer it to be a private plugin but it's up to you since it's your work :3.
     
  8. Offline

    mrCookieSlime

    Moved to Alternatives Section.

    @pale1
    Private Plugins are not allowed here.
     
  9. Offline

    pale1

    Ok sorry about that, I was unaware.
     
  10. Offline

    Permeer

    @pale1 Ive done it. i will post in the bukkit
     
  11. Offline

    pale1

    Wow! That was fast! Can you send me a link?
     
  12. Offline

    Permeer

    I will not post in the bukkit , its too boring i will upload and give the link


    * if theres any mod , what site i can upload it ?*
     
  13. Offline

    pale1

    You can try uploading it to mediafire.com or dropbox.
     
  14. Offline

    ahamling27

    Linking to Mediafire here on the forums is against the rules. Please do not do that. Thanks!
     
  15. Offline

    Permeer

  16. Offline

    ahamling27

  17. Offline

    Permeer

    Last edited: Jan 8, 2015
  18. Offline

    pale1

    Last edited: Jan 8, 2015
  19. Offline

    Permeer

  20. Offline

    pale1

    @Permeer
    It seems pretty cool, but the config doesn't generate. It's just a blank document so I can't make any drinks.

    I also would like it if you could change the glass panes in the slots to just empty slots.

    Also I get this error when I try to type /bar add
    Show Spoiler

    [19:58:11 INFO]: pale1 issued server command: /bar add

    [19:58:11 ERROR]: null

    org.bukkit.command.CommandException: Unhandled exception executing command 'bar' in plugin GamblingBar v1.0

    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot_server.jar:git-Spigot-13716d9-0899683]

    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot_server.jar:git-Spigot-13716d9-0899683]

    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:645) ~[spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1115) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:950) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_25]

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [?:1.7.0_25]

    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [?:1.7.0_25]

    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:683) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:623) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:526) [spigot_server.jar:git-Spigot-13716d9-0899683]

    at java.lang.Thread.run(Thread.java:724) [?:1.7.0_25]

    Caused by: java.lang.ArrayIndexOutOfBoundsException: 2

    at me.com.Main.Main.onCommand(Main.java:393) ~[?:?]

    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot_server.jar:git-Spigot-13716d9-0899683]

    ... 15 more

    >

     
    Last edited: Jan 8, 2015
  21. Offline

    Permeer

    @pale1 It needs Vault and a economyplugin
     
  22. Offline

    pale1

    @Permeer
    Im using Vault and essentials for economy. I still get the error when I type "/bar add" alone, but I found out I need to type /bar add <slot> <itemname> <price> <reward> <item> <itemid> <chancetowin>. Is there any way you could make it so I can modify the plugin using some sort of config file?

    Also could you include an example of how the command is used? I tried typing a whole bunch of things for slot 1 but it kept saying Invalid Slot.
     
  23. Offline

    Permeer

    @pale1 Sorry ;/ , link updated
     
  24. Offline

    pale1

    @Permeer Thanks so much! I'll tell you if I have any more issues <3
     
  25. Offline

    Permeer

  26. Offline

    pale1

    @Permeer Could you add a way to reload the plugin with /bar reload? I keep having to reload all the plugins on the server xD

    Also, when you buy the drink it tells you you bought it but when you drink, you aren't notified if you win or lose. Also, you don't get any money when you do win

    Can you add a section in the config for win/lose messages?

    Can you also make it so that there are no potion effects besides confusion for 3 seconds when you buy a drink and so the item is completely taken away after use (No glass bottle is given to you)

    Also, when you purchase the drink it still displays the price on the drink and the slot it came from. Is there a way you could remove that?

    Could you also make it so when you type a two worded drink using a "_" that it turns it into a "space" in the plugin?
    Example:
    /bar add 1 &6Cold_Brew <>...<> will turn into Cold Brew

    I am also for some reason unable to put drinks into slot 9 (unless I have 18 slots);-;
     
    Last edited: Jan 8, 2015
  27. Offline

    ahamling27

    @pale1, please respond to @Permeer via PM if you are going to share Skype names. There is no sharing personal information, even Skype names, on the boards. Thanks!
     
  28. Offline

    Permeer

  29. @Permeer All conversation must remain on the thread.
     
Thread Status:
Not open for further replies.

Share This Page