[MECH] Mystery Box v1.4 - Create Mystery Box's Like In COD Zombies [935]

Discussion in 'Inactive/Unsupported Plugins' started by Jayjay110, May 31, 2011.

  1. Offline

    Jayjay110

    Mystery Box - Create Mystery Box's Like In COD Zombies!:

    Current Version: 1.4

    Basically this plugin allows you to create Mystery Box's like in black ops zombies etc. To use a Mystery Box right or left click it twice within 2 seconds and you can buy a random item that you specify in the config file. One thing you will notice is there are probabilities, technically the only way they become probabilities if all the items probabilities in the config file, add up to 100%, else it will just create a random guess will close probabilities but not direct ones.

    Mystery Box's are Chests! (Just so you know lol :p)

    To use type /mb or /mysterybox it doesnt matter:
    /mb create <name> - This creates Mystery Boxes, type this then place or click on a chest
    /mb remove - Toggles Removing Mode
    /mb toggle - Globally toggles Mystery Box's On and Off (Still protects Mystery Boxes from breaking)
    /mb list - List all Mystery Box's


    Features:
    • Allows you to create Mystery Box's
    • Permissions
    • iConomy 4 & 5 Support
    • BOSE Economy Support
    • Essentials Economy Support
    • Op Defaulting
    • Console command support (Toggle only!)
    • Config File Support
    • MySQL and SQLite Support
    • Multi-World Support
    • Saving and Loading of different items to use
    • Automatic Config Generation
    • Cool lightning effect on purchase
    • Ability to modify price, items, amounts and probabilities :D Special thanks to @garbagemule who helped me with doing the items :D
    • Auto-Updating Built in :)
    • Choice to enable or disable lightning effect!
    • Customizable messages! (Includes the colour coding system :D!)
    • When you are in range of a mystery box you get a delightful message :p
    • Enabling or Disabling Economy / Permissions
    • Allows you to set the box's access to free
    Config:

    Default Config (Generates Automatically!) (open)

    PHP:
    Enabled On Startuptrue
    Permissions
    ?: false
    Use An Economy Plugin?(False means everythings free!): false
    Price
    950.0
    Item Velocity
    0
    Database Settings
    :
        
    MySQLfalse
        Host
    Localhost
        User
    MysteryBox
        Pass
    '12345'
        
    DatabaseMysteryBox
    Lightning Effect
    ?: false
    Messages
    :
        
    'You do not have enough money, you need: ''§cYou do not have enough money, you
            need: '
        'Creation of Mystery Box''s - Started! Name: '
    '§bCreation of Mystery Box''s
            - Started! Name: '
        
    Creation of Mystery Box's - Stopped!: §cCreation of Mystery Box'Stopped!
        
    'Creation of Mystery Box''s - Complete! Name: ''§aCreation of Mystery Box''s
            - Complete! Name: '
        
    Removing of Mystery Box's - Started!: §bRemoving of Mystery Box'Started!
        
    Removing of Mystery Box's - Stopped!: §cRemoving of Mystery Box'Stopped!
        
    You have successfully removed a Mystery Box!: §cYou have successfully removed a Mystery Box!
        
    You forgot to specify a name for the Mystery Box!: §cYou forgot to specify a name for the Mystery Box!
        
    Your Mystery Box name may not contain spaces!: §cYour Mystery Box name may not contain spaces!
        
    That block is already a Mystery Box!: §cThat block is already a Mystery Box!
        
    There is already a Mystery Box with that nameplease choose another!: §cThere is already a Mystery Box with that nameplease choose another!
        
    Stop Creating Mystery Box's First!: §cStop Creating Mystery Box's First!
        
    Stop Removing Mystery Box's First!: §cStop Removing Mystery Box's First!
        
    'To Create Mystery Box''s Type: ''To Create Mystery Box''s Type: '
        'To Toggle The Mystery Box''s Plugin Type: '
    'To Toggle The Mystery Box''s Plugin
            Type: '
        'To Remove Mystery Box''s Type: '
    'To Remove Mystery Box''s Type: '
        'You just got the item: '
    '§aYou just got the item: '
        'For: '
    '§aFor: '
        'You are currently near the Mystery Box: '
    '§aYou are currently near the Mystery
            Box: '
        'Hit the box again to confirm your purchase! (It costs: '
    '§bHit the box again
            to confirm your purchase! (It costs: '
    Items:
        
    STONE:
            
    Amount'1'
            
    Probability'1'
        
    GRASS:
            
    Amount'1'
            
    Probability'1'


    Permissions:
    Permissions (open)

    • MysteryBox.Toggle - Gives access to /mb toggle
    • MysteryBox.Create - Gives access to /mb create
    • MysteryBox.Remove - Gives access to /mb remove
    • MysteryBox.Use - Gives access to using Mystery Boxes
    • MysteryBox.List - Gives access to /mb list



    Download

    Source Code

    Todo (open)



    Bugs (open)

    • No permissions, when permissions isn't enabled!
    • Null pointer on player interact :3
    • Command errors
    • Permission errors
    • Stupid block got destroyed by non permission players
    • Hashmap concurrent error thingy Thankyou to @rcjrrjcr for helping on this :D


    Changelog:
    Version 1.4:
    • Fixed a silly bug on block breaking
    • Added free box use
    • Added economy and permission choice
    • Added item velocity fun!
    • Small code fixes
    Version 1.3:
    • MAJOR UPDATE*
    • Fixed tons of bugs
    • Added Auto-Updating script
    • Support for Bose Economy and Essentials Economy
    • More Options
    Changelog (Long) (open)

    Version 1.4:
    • Fixed a silly bug on block breaking
    • Added free box use
    • Added economy and permission choice
    • Added item velocity fun!
    • Small code fixes
    Version 1.3:
    • MAJOR UPDATE*
    • Fixed tons of bugs
    • Added Auto-Updating script
    • Support for Bose Economy and Essentials Economy
    • More Options
    Version 1.2:

    • Fixed Null pointer exception :p
    Version 1.1:

    • Fixed No Permissions bug
    Version 1.0:

    • Initial Release
     
    rdemanta, NEO and kahlilnc like this.
  2. Offline

    Tux2

    What do you mean by price? Does it hook into something like iConomy?
     
  3. Offline

    Jayjay110

    Shit thanks forgot to mention that lol
     
  4. Offline

    kahlilnc

    Lol. I like the idea.
     
  5. Offline

    Jayjay110

    Dw im still working on the shooting ranges!
     
  6. Offline

    Trevor_

    @Jayjay110
    Code:
     [SEVERE] Could not pass event PLAYER_INTERACT to MysteryBox
    java.lang.NullPointerException   at com.servegame.n1p.MysteryBox.MysteryBoxPlayerListener.onPlayerInteract(MysteryBoxPlayerListener.java:170)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:299)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:133)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:791)
        at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:35)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    I'll just leave this here. This happens when I left click with my compass.

    Edit:
    Happens when you do left click/right click with anything, even bare hand.
     
  7. Offline

    TheNander

    This would be an interesting piece to add to Mob Arena. Has anyone tried this?
     
    TruffleDucks likes this.
  8. Offline

    Jayjay110

    Ah sorry about that forgot a null check :p updated it :D
     
  9. Offline

    Trevor_

    Thank you Jayjay110, now I can continue onward with my server configuration. :3

    Still Occuring

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  10. Offline

    TruffleDucks

    If only there was a gun plugin
     
  11. Offline

    0otf

    looks awesome ill try it out

    Edit: Can you add boseconomy support?
     
  12. Offline

    charlie k-j

    There is, SDK's gun mod, its god SMP support too! ^_^
     
  13. Offline

    Trevor_

    The error is still occurring on left-click usage.
    Here is the error again:
    Code:
    [SEVERE] Could not pass event PLAYER_INTERACT to MysteryBox
    java.lang.NullPointerException
        at com.servegame.n1p.MysteryBox.MysteryBoxPlayerListener.onPlayerInteract(MysteryBoxPlayerListener.java:170)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:299)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:133)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:524)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  14. Offline

    azngamerzer

    does it even work with bukkit? :confused:
     
  15. Offline

    Trevor_

    Nope
     
  16. Offline

    Jayjay110

    grrr Idk why, ill fix it in about an hour k :)
     
  17. Offline

    embty

    I installed the plugin, and all the chests in the server turned into mystery boxes lol. And when i try using /mb remove <name> I get the massage that this name is already used for another mystery box. Using bukkit 818
     
  18. Offline

    Jayjay110

    doesnt seem possible for it to make all the chests in the world myster boxes, and you dont type /mb remove <name> u just type /mb remove, Im fixing the errors now tho sorry :)
     
  19. Offline

    embty

    Well as soon as i installed the plugin, the whole server started shouting. WHAT IS MYSTERY BOX WE CANT USE CHEST! lol

    Tried re-installing again for the third time, the same problem. A conflict with other plugins perhaps?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  20. Offline

    Jayjay110

    thats wierd?
     
  21. Offline

    embty

    Happens as soon as I install the plugin, didnt toggle or make any mystrey box.
     
  22. Offline

    Jayjay110

    hmmm im rewriting the command enabling , I think I butchered it hold on :O

    HUZZAH I fixed the error of the illusion of all chests being mystery boxes... i think :D, ill release it once im finished this update!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  23. Offline

    Trevor_

    @Jayjay110
    Stick around after the release, I'll test all the features for you real quick.
     
  24. Offline

    rdemanta

    Actually, I have. Unfortuanetly it won't work for me because i don't have iConomy.

    I have a question. Do you thing that you could make it so that you don't need iConomy to use this plugin. I have essentials economy and i like it, so that would work to.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  25. Offline

    Jayjay110

    Sure ill add it in this next release :p
     
  26. Offline

    TruffleDucks

    Bleh... I hate server mods. They take forever to download and they don't even work once you get downloading.
     
  27. Offline

    embty

    Great! works like a charm now :D

    I have a question, while going though the item list I came across MOB SPAWNER. Im using creaturebox for spawning some spawners but is it possible to set the spawner by creaturebox "creeper spawners, wolves" and set a low chance for them by a mystery box. That would be awesome!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  28. Offline

    Jayjay110

    That would be very very hard to do seeing as I dont think creature box has a way to hook into it, so I would say no, but if someone really badly wants that, and is willing to donate, I could probably look into a way were it could hook into mysterybox's but im not sure how as of now...
     
  29. Offline

    mbandit

    When starting my server i get this error

    2011-06-04 15:48:14 [INFO] [MysteryBox] Checking for updates...
    2011-06-04 15:48:14 [INFO] Read timed out
    2011-06-04 15:48:14 [INFO] [MysteryBox] Updating...
    2011-06-04 15:48:15 [SEVERE] Error occurred while enabling MysteryBox v1.3 (Is it up to date?): com/servegame/n1p/MysteryBox/MysteryBox$1
    java.lang.NoClassDefFoundError: com/servegame/n1p/MysteryBox/MysteryBox$1
    at com.servegame.n1p.MysteryBox.MysteryBox.onEnable(MysteryBox.java:69)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:134)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:112)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ClassNotFoundException: com.servegame.n1p.MysteryBox.MysteryBox$1
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    ... 11 more


    I'm sure i'm just doing something stupid, do you mind helping me?
     
  30. Offline

    embty

    Code:
    2011-06-04 17:55:19 [INFO] [MysteryBox] Checking for updates...
    2011-06-04 17:55:20 [INFO] [MysteryBox] Updating...
    2011-06-04 17:55:20 [INFO] [MysteryBox] MysteryBox - Version 1.3 has been disabled.
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    2011-06-04 17:55:20 [INFO] [MysteryBox] Has been updated, please restart the server!
    
    Crashed the server and caused Mcmmo to delete players and not able to read the mcmmo.users
    The server has totally crashed and keeps restarting all by itself even after deleting the plugin i keep getting this in the logs. Spams and restarts the server over and over crashed alot of plugins along the way with it
     

Share This Page