MCCasino
I've taken over the project, and I plan on reviving it fully to the strongest of all capabilities. :) - New Author X_angelz_X
MCCasino
Minecraft's one armed bandit.
Version 0.2.2
This server mod allows you to create a slot machine using signs. The signs will drop items at their location, these correspond to the symbols on a reel. You can set a multiplier reward according to the combination that falls out. The item the player is holding when right clicking the playing sign is considered as the bet. Economy support is also available.
Features
- Simple and easy setup.
- Reel items can't be picked up.
- Simple to play.
- Supports Permissions.
- Supports Vault economy, which mean that, as long as you install Vault, this plugin will work with every economy plugin.
Commands and permissions
- mccasino.use : allows a player to use/play slot machines.
- mccasino.setup : allows a player to use any of the following commands:
- /mccdel (machine name): delete a machine.
- /mcctest (machine name): test run a machine.
- /mccforceactive (machine name): force a machine into activity. Warning! This may cause problems.
Usage
For players: hold your bet (keep in mind that the entire stack will be taken, if the machine doesn't use limits, or a money bet), and right click the play sign (has "Slot Machine" on the second line). The machine will run, after it will be deactivated for 5 seconds, then the drops will be deleted, and it will reactivate. If the machine is set to money bets, you can right click with anything play. Note: items dropped by the reels can't be picked up.
For admins: first read the README.txt file in the zip archive you downloaded.
Now, start by building the slot machine, if you need an example, see the screenshots. Add the signs where the items will be dropped. So they can be identified as reels, you must follow this template:
first line: [MCCasino]
second line: Reel
third line: name of the machine (example: machine1)
fourth line : number of the reel (ex: 2)
The "number of the reel" thing is optional, but it's recommended, if reels are added, removed or replaced, this number will allow the plugin to reorder them. It corresponds to the one set in the config.
Now add next to the machine a sign following this template, this will be the sign the players interact with:
first line: [MCCasino]
second line: Slot Machine
third line: name of the machine (example: machine1, same as the reels)
fourth line : anything you want (or nothing), it's not used.
ALL of the signs need to be wall signs.
Now go to your config, and add/edit an entry to "Machines:", see the "Config" section for help.
Reels are numbered 1 to whatever you want, and have a list of drops with the probability for the drop. For example, reel one has equal chances of dropping all its items (331 is redstone, 266, gold ingot and 264, diamond). Reel 2 has more chances of dropping gold than redstone, and more of dropping diamond than gold. The number you use for the probabilities should always be whole, between 1 and 100, I suggest, although, it's relative: 5, 4 and 3 will get you the same results as 50, 40 and 30. You can have more than 4 reels, just add an entry for '5'.
For the rewards, they're in two parts: a combination of drops, the first in the list belongs to reel one, and etc., and the multiplier reward, a whole number. The drops, again, are IDs, for items or blocks, and the multiplier is used to multiply the quantity of the bet for the winner. If the results do not match any combination, the default is 0.
Limits are basically the maximum allowed item bets. For machine2, those are enabled, and so a player can only bet one gold or one diamond. If he's holding more, only the desired quantity will be taken.
If you enable economy, the machine will ignore items, and take money (same amount as the cost) directly from the player's account. Multipliers are applied here too. YOU NEED Vault for the economy function. If no economy plugin can be found, the machine will used item bets.
Now that you're done, reload/reboot the server (or disable and enable the plugin), and log back in.
You'll need the "setup" permission next: right click the signs for the reels, they'll be registered. IMPORTANT: the order in which you click them matters if you didn't add a reel number on the last line of the sign, you should always go from left to right. The first clicked sign will be linked to reel one, the second to two, and etc.
Now test the machine, you'll need the "use" permission for this. Right click the sign with your bet (use a dirt block or another cheap resource) and it should run. After 5 seconds, the drops are deleted, and the machine activates again. A machine is only first active if all of it signs are present and registered. You can also to a fast test with "/mcctest (machine name)". This doesn't require a bet.
To delete a machine, just punch out the reels, then erase the entry in the config. You can also use "/mccdel (machine name)", but this will not modify the config.
If you have any problems with a machine staying inexplicably inactive, try "/mccforceactive (machine name)".This will force it into activity. I am not responsible for any problems this might cause.
Config
Machines: machine1: reels: '1': - 331-50 - 266-50 - 264-50 '2': - 331-10 - 266-30 - 264-50 '3': - 331-50 - 266-50 - 264-50 '4': - 331-50 - 266-50 - 264-50 rewards: - 264,264,264,264:5 - 331,266,266,331:3 - 266,264,264,266:4 - 331,266,264,331:6 - 331,331,331,331:2 - 266,266,266,266:10 economy: use_economy: true cost: 10 bet_limits: enabled: false allowed: - 266-1 - 264-1 messaging: message: '$6$[MCCasino] $7$$name$ won $$amount$!' send_to: world exclude_winner: true radius: 20 machine2: reels: '1': - 4-50 - 5-50 - 1-50 '2': - 4-50 - 5-50 - 1-50 '3': - 4-50 - 5-50 - 1-50 '4': - 4-50 - 5-50 - 1-50 '5': - 4-50 - 5-50 - 1-50 rewards: - 1,1,1,1,1:5 - 4,5,1,5,4:3 - 5,1,4,1,5:4 - 4,5,1,5,4:6 - 4,4,4,4,4:2 - 5,5,5,5,5:10 - 5,5,5,5,5:10 - X,X,5,X,X:10 #The special character "x" is equal to any possible ID economy: use_economy: false cost: 10 bet_limits: enabled: true allowed: - 266-1 - 264-1 messaging: message: '$6$[MCCasino] $7$$name$ won $amount$ $item$(s)!' send_to: players_nearby exclude_winner: true radius: 15
"machine1" should be the name of the machine you placed on the signs, in-game.
Permissions config
This config can be found in the MCCasino folder, it's called perms_config, and is generated on plugin startup. For most applications, you may not need to change it, but, if you use Permissions 3.0 and older, or if you do not use any permission plugin, you will need to edit it.
PermissionsSystem: SuperPerms #This config is case sensitive!!# PlayerPerms: - mccasino.use
"PermissionsSystem" is the permission checking system to use. If you use any up-to-date permissions plugin that support SuperPerms, leave the config as is.
If you do not use a permissions plugin, set the field to "PlayerAndOP". This will set all permissions at op only, unless you add them to the "PlayerPerms" field. This basically creates a simple group system: players, the default group with no permissions, except the ones added to the "PlayerPerms" field, and ops, who have all the permissions.
Features to add
(Features marked with "added" will be available in the next version.)
Source
The source code can be found here: https://github.com/DDoSQc/MCCasino
Feel free to contribute!
Donate
If you want to make a donation for all my hard work, here's a link: Donate here!
Changelog
Version 0.2.2
- Added messaging
- Compatibility for the latest 1.2 builds
Version 0.2.1
- Fixed a problem with limits, items weren't being removed properly
- Fixed item being pickable as they were dropping.
Version 0.2
- Added a command to test a machine.
- Added a command to delete a machine.
- Added a command to force a machine into activity
- Added Vault economy support, basically, I added support for all economy plugins.
- Fixed items dropping. No more water stuff.
- Added limits.
- Added the special character "x" to the result combinations. Basically, it's equal to any possible ID.
Version 0.1
- Initial release
Getting "This machine is not active" not sure why, any ideas?
@Lezyamin
It seems your config is invalid, and the plugin is failing to load it. Make sure the format is right. You may send it to me via PM if you want more help.
I do actually get an error in the console :
12.11 09:57:37 [Server] INFO at net.minecraft.server.ThreadServerApplication.run(SourceFile:417) 12.11 09:57:37 [Server] INFO at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374) 12.11 09:57:37 [Server] INFO at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471) 12.11 09:57:37 [Server] INFO at net.minecraft.server.NetworkListenThread.a(SourceFile:108) 12.11 09:57:37 [Server] INFO at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92) 12.11 09:57:37 [Server] INFO at net.minecraft.server.NetworkManager.b(NetworkManager.java:226) 12.11 09:57:37 [Server] INFO at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33) 12.11 09:57:37 [Server] INFO at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:715) 12.11 09:57:37 [Server] INFO at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:722) 12.11 09:57:37 [Server] INFO at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:757) 12.11 09:57:37 [Server] INFO at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:355) 12.11 09:57:37 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163) 12.11 09:57:37 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) 12.11 09:57:37 [Server] INFO at com.bekvon.bukkit.plugman.PlugMan.onCommand(PlugMan.java:65) 12.11 09:57:37 [Server] INFO at com.bekvon.bukkit.plugman.PlugMan.doCommand(PlugMan.java:133) 12.11 09:57:37 [Server] INFO at com.bekvon.bukkit.plugman.PlugMan.reloadPlugin(PlugMan.java:355) 12.11 09:57:37 [Server] INFO at com.bekvon.bukkit.plugman.PlugMan.enablePlugin(PlugMan.java:341) 12.11 09:57:37 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280) 12.11 09:57:37 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957) 12.11 09:57:37 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:174) 12.11 09:57:37 [Server] INFO at me.DDoS.MCCasino.MCCasino.onEnable(MCCasino.java:41) 12.11 09:57:37 [Server] INFO at me.DDoS.MCCasino.MCCLoader.loadSlotMachine(MCCLoader.java:41) 12.11 09:57:37 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:165) 12.11 09:57:37 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:109) 12.11 09:57:37 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:143) 12.11 09:57:37 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:71) 12.11 09:57:37 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.deserializeValues(YamlConfiguration.java:100) 12.11 09:57:37 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.deserializeValues(YamlConfiguration.java:99) 12.11 09:57:37 [Server] INFO java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String 12.11 09:57:37 [Server] SEVERE Error occurred while enabling MCCasino v0.1 (Is it up to date?): java.lang.Integer cannot be cast to java.lang.String
@DDoSQc
great! awesome plugin
@saicoe
Alright, I'll add that to the todo list.
I really like your plugin idea and want to use this on my server, I downloaded and installed your plugin, installation went fine and it works. However I really wish to customize this plugin a bit more, I would really like to be able to set just one item and amount only that can be used to spin the reels, 1 gold ingot. And I would also like to make rewards also available if three of the four reels match not just if all four match (if its not already like that), three matching would pay less than four of course, and the rewards would all be customizable still in the config, and lastly a bit more delay in the spin result message, so you may see the item drop result before it tells you you lost or won and pays reward. Would you be able to make these changes to your plugin? Most of all, at least just being able to set one item and amount that can be used to spin the reels. Thanks
@Lezyamin
Make sure you use the same capitalization, and look at the console, make sure it's printing the loading message for the machine.
It looks great, I've set up my machine like yours, but when i go to register the signs, it tells me the slot machine does not exist, even though I've used the same name in the config and i have the "*" node, please help
looks amazing i have been looking for a casino plugin for a while now. Cant wait for the iconomy support :)
@DDoSQc
Awesome! Can't wait!
@sammehthedragon
Yes, I'm planning to add iConomy support.
i agree iconomy support would be great
You should hook this to Register, so economy plugins can be used aswell (Along with the ability to add currency rewards)
Seems pretty neat :D
Slots revived :D