Description
This mod provides a framework for creating weighted randomized tables of Game Stages. If you do not know what a game stage is, it is highly recommended that you familiarize yourself with the Game Stage mod first. The basic idea of this mod is that modpacks cad define a table of game stages They can then use a command provided by this mod to award a player a random stage from that table. This mod also requires a basic understanding of CraftTweaker scripting to use it effectively.
For in depth examples, please checkout the GitHub page. There is also a Discord server where you can ask for help and advice.
Commands
- /stagetable - Provides a list of all commands added by this mod.
- /stagetable dump - Generates a file containing information about all the stage tables.
- /stagetable award <player> <table> - Attempts to award a player with a random stage from the specified table.
- /stagetable silentaward <player> <table> - Same as the award command, but doesn't notify the player about it.
Basic Terminology
- Stage Table - A named table that contains stage entries.
- Stage Entry - An entry in a stage table. Each entry has a stage that will be awarded, a weight value, and a list of conditions.
- Stage Condition - A condition that must be met for a stage entry to be awardable to a given player.
Weighted Randomness
Weight is a form of probability system where the possible outcomes have unequal odds of happening The percent chance of any given outcome can be calculated by dividing the weight of a specific entry by the total weight of all entries in a table. For example if an entry has a weight of one, and the total weight is 9, there is a 10% chance of the first outcome. Weighted randomness is commonly used when the pool of outcomes needs to be flexible. If you are still unsure, you can run the dump command which will generate visual tables based on the tables that you have created.
CraftTweaker Scripting
Below is an example script that shows the various things made available. For more precise information please check here for the exact information.
// Basic imports used in this script
import crafttweaker.player.IPlayer;
// Creates a new stage table with the name exampleTable
val testTable = stageTables.createTable("exampleTable");
// Creates a new stage entry for stage "one" with a weight of 5.
val entryOne = testTable.createEntry("one", 5);
// Creates a new stage entry for stage "two" with a weight of 5.
val entryTwo = testTable.createEntry("two", 5);
// Prevent entryTwo from being selected unless the player has stage "four".
entryTwo.addStageCondition("four");
// Creates a new stage entry for stage "three" with a weight of 1.
val entryThree = testTable.createEntry("three", 1);
// Adds a custom condition to aquiring this entry using ZenScript.
// In this case, it's only valid if the player is in creative mode.
entryThree.addCondition(function(player as IPlayer) {
return player.creative;
});
AD
Become Premium to remove Ads!
What means Verified?
-
Compatibility: The mod should be compatible with the latest version of Minecraft and be clearly labeled with its supported versions.
-
Functionality: The mod should work as advertised and not cause any game-breaking bugs or crashes.
-
Security: The mod should not contain any malicious code or attempts to steal personal information.
-
Performance: The mod should not cause a significant decrease in the game's performance, such as by causing lag or reducing frame rates.
-
Originality: The mod should be original and not a copy of someone else's work.
-
Up-to-date: The mod should be regularly updated to fix bugs, improve performance, and maintain compatibility with the latest version of Minecraft.
-
Support: The mod should have an active developer who provides support and troubleshooting assistance to users.
-
License: The mod should be released under a clear and open source license that allows others to use, modify, and redistribute the code.
-
Documentation: The mod should come with clear and detailed documentation on how to install and use it.
AD
Become Premium to remove Ads!
How to Install
Download Forge & Java
Download Forge from the offical Site or here. If you dont have Java installed then install it now from here. After Downloading Forge you can run the file with Java.
Prepare
Lounch Minecraft and select your Forge istallation as Version this will create a Folder called Mods.
Add Mods
Type Win+R and type %appdata% and open the .minecraft Folder. There will you find your Folder called Mods. Place all Mods you want to play in this Folder
Enjoy
You are now Ready. Re-start your Game and start Playing.