
TaiXiu - A gambling plugin 2.8
A plugin based on an ancient Chinese gambling game played with three dice

"All or nothing"
This plugin was published and got updated on a Vietnamese Minecraft Forum (minecraftvn) before it got translated and now ready to be published on polymart & spigotMC!
Tai Xiu (or Sic Bo in English) is a game in the form of betting. In the game, there are three 6-sided dice numbered from 1-6. The dealer (system) will take the sum of the 03 dice that appear to give a final number to the player.
The player's task is to predict whether the result is Tai or Xiu. Xiu is the sum of 3 dice from 3-10, and Tai is 11-18. If the guess is correct, the player will win and receive money.
This software runs on Spigot and NMS.
Spigot forks without compiled NMS code are not supported.
Officially supported servers are spigot, paper, and folia.
You must use Java 11 or newer.
Plugin requirements
- Vault (Use VaultUnlocked if you're using Folia)
- An economy plugin
NOTE: If you are using VaultUnlocked, if recommend to use BetterEconomy as an economy plugin.
Soft-depend plugins
You might need these plugins to utilize all plugin features:
- PlaceholderAPI
- %taixiu_phien% - Get the current session number
- %taixiu_timeleft% - Get current session time left
- %taixiu_result_phien_{session_number}% - Get the result of the session {session_number}
- %taixiu_resultformat_phien_{session_number}% - Get the format result of the session {session_number} (based on message.yml)
- %taixiu_taiplayers_phien_{session_number}% - List the players who bet on Tai
- %taixiu_xiuplayers_phien_{session_number}% - List the players who bet on Xiu
- %taixiu_taiplayers_bet_phien_{session_number}% - Get the total money of Tai
- %taixiu_xiuplayers_bet_phien_{session_number}% - Get the total money of Xiu
- %taixiu_totalbet_phien_{session_number}% - Get the total money of the session
Attention: Change {session_number} to current if you want to get the last session.
- Floodgate API (GeyserMC)
- This will let you be able to use Bedrock forms which I already have set up for this plugin.
- Discord Web Hook
- Send messages to discord of session's information.
- PlayerPoints
- Since version 2.3, TaiXiu supports multiple currencies for each playing session. PlayerPoints now can be used as a second currency for players to bet.
- Automatically updating files if there is a new update.
- Configable messages, gui, etc..
- Supporting API.
- Supporting GUI
- Supporting Hex Color
- Supporting BossBar
- Supporting Floodgate (GeyserMC)
- Easily managing plugin database
Images
- /taixiu - taixiu.use
- The main command for the players to use.
- toggle
- luatchoi
- cuoc
- thongtin
- The main command for the players to use.
/taixiuadmin - taixiu.admin
- For the administrators to use to adjust stats or reload plugin.
- reload
- changestate
- settime
- setcurrency
- setresult
taixiu.tax.bypass: Bypass taxes.
2.8
- Fixed: An error occurred when trying to setup files while starting the server.
2.7
- Fixed: Console spam caused by certain errors.
- Fixed: Menu errors on the latest server versions.
- Fixed: Server may crash or lag when using Discord webhooks.
- Fixed: Incorrect display of the "invalid-currency" message.
- Support Added: Folia support.
- Support Added: Compatibility with the latest server versions.
- Optimization: Refactored and optimized some parts of the code.
- Localization: Added English language support.
- Localization: Translated some parts of the interface to English.
- Feature Added: PlaceholderAPI %taixiu_timeleft% to get the remaining time of the current session.
- Permission Added: taixiu.tax.bypass to skip the tax.
2.6
- Supported the newest version of minecraft server
- Fixed misspelling
- Removed supporting DiscordSRV and now support Discord Web Hook instead! ()
2.5
- Supported 1.21.3
- Fixed Bossbar's still enabled even after turning off in config.yml
- Fixed spam console after turning off Bossbar
- Fixed player head in TaiXiu GUI turns into Bedrock (mostly happens because server-online is false)
- Added new placeholders for DiscordSRV
2.4
- Supported minecraft version 1.21.x
- Fixed spam console "java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getName()" because "p" is null"
- Optimized pom.xml
2.3
- Taixiu now supports PlayerPoints!
- New inventory, added "shortItem" to short specific values.
- Added /taixiuadmin setcurrency
- Optimized code.
2.2
- Fixed boss-bar does not work correctly.
- Fixed session sometime automatically reset when a player toggle notification.
- Fixed an error occurred when floodgate players use command "/taixiu"
- Optimized boss-bar
- Supported DiscordSRV! (100% Configable messages)
2.1
- Fixed BossSytle is not working as config
2.0
- Added GPL-3.0 license which should be added early
- Fixed misspelling
- Optimized code
- Fixed an error that makes console spam when opening a GUI if the server version is above 1.16.5
- Added sound when the player wins or loses betting
- Added a message when the player loses betting
- Updated BossBar
- Supported Floodgate Forms
1.1.5
- Fixed an error relating to FilenameUtil caused console to spam while loading plugin
1.1.4
- Fixed an error that causes money is not given for floodgate player
- Fixed an error while giving a result
- Recaculated how tax works
- Updated PlaceholderAPI
- Optimized code
Java
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.CortezRomeo</groupId>
<artifactId>TaiXiu</artifactId>
<version><VERSION></version>
</dependency>
System.out.println(TaiXiuManager.getTime() + " seconds remaining!");
System.out.println("Current session status: " + TaiXiuManager.getState());
ISession session = DatabaseManager.taiXiuData.get(4);
// Session is not valid
if (session == null) {
return;
}
System.out.println("The result of session" + session.getSession() + " is " + session.getResult());
System.out.println("Dice number 1: " + session.getDice1());
System.out.println("Players betted on Xiu: " + (session.getXiuPlayers().isEmpty() ? "" : session.getXiuPlayers()));
@EventHandler
public void resultEvent(SessionResultEvent event) {
ISession sessionData = event.getSessionData();
HashMap<String, Long> taiPlayers = sessionData.getTaiPlayers();
HashMap<String, Long> xiuPlayers = sessionData.getXiuPlayers();
TaiXiuResult result = sessionData.getResult();
System.out.println("Sic bo session number #" + sessionData.getSession() + " result is " + result);
System.out.println("There is " + (result == TaiXiuResult.TAI ? taiPlayers.size() : xiuPlayers.size()) + " players betted on " + result);
}
@EventHandler
public void betEvent(PlayerBetEvent event) {
Player p = event.getPlayer();
TaiXiuResult bet = event.getBet();
Long money = event.getMoney();
System.out.println(p.getName() + " just betted on " + bet.toString() + " with the amount of " + money);
}