limitations - alRex-U/ParCool GitHub Wiki
Limitation is a feature for setting limit of players parkour skills.
This document is only for versions newer than v3.2.1.0. If you want to see old document, please read this.
There are three types of limitations.
- Server-wide Limitations
- Individual Limitations
- Custom Limitations
When more than 2 limitations are enabled, most disadvantageous limit is applied for each items.
To impose limitations to players, first you need to enable them.
limitations_imposed = true
parcool limitations enable individual of <players>
If your limitation id is youprojectname:example
parcool limitations enable yourprojectname:example of <players>
You have to do nothing such as registration or else before using new Limitation ID. Just use names you want.
Server-wide Limitations is applied to all players by server-configuration file.
Please check serverconfig folder in folders of each world.
Individual Limitations and Custom Limitations can be applied to each player by in-game commands.
parcool limitations set <your limitation id> of <players> possibility <action> false
parcool limitation set <your limitation id> of <players> boolean allow_infinite_stamina false
parcool limitations set <your limitation id> of <players> integer max_stamina_limit <value>
parcool limitations set <your limitation id> of <players> least_stamina_consumption <action> <value>
parcool limitations set <your limitation id> of <players> to_default
As for Custom Limitations, you can create and control from your code.
repositories {
maven {
url "https://cursemaven.com"
}
}dependencies {
implementation fg.deobf("curse.maven:parcool-482378:${fileid /*Edit here*/}")
}- This feature is marked as Unstable. This feature accesses ParCool internal classes directly, so I cannot guarantee that this operation will work across some versions as same.
- This feature is permitted only in Server side.
// in 1.16.5
import com.alrex.parcool.api.unstable.Limitation;
import com.alrex.parcool.config.ParCoolConfig;
import com.alrex.parcool.common.action.impl.FastRun;
public class YouCode {
public static void controlLimitation(ServerPlayer target) {
Limitation.get(player, new Limitation.ID("yourmodid", "example"))
// enable limitation "yourmodid:example"
.enable()
// prohibit infinite stamina
.set(ParCoolConfig.Server.Booleans.AllowInfiniteStamina, false)
// prohibit FastRun action
.permit(FastRun.class, false)
// sync (don't forget to call this)
.apply();
}
}