### Java API Example for Controlling Limitations Source: https://github.com/alrex-u/parcool/blob/1.16.5/docs/parcool-guide-on-web-latest/for_developer/limitations.md Java code example demonstrating how to control limitations from server-side code using the Parcool API. ```java // 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(ServerPlayerEntity 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(); } } ``` -------------------------------- ### Individual Limitation Example Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Enables individual limitations for players using an in-game command. ```text parcool limitations enable individual of ``` -------------------------------- ### Custom Limitation Example Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Enables a custom limitation for players using an in-game command, specifying the limitation ID. ```text parcool limitations enable yourprojectname:example of ``` -------------------------------- ### Java API Example for Controlling Limitations Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Demonstrates how to control limitations from server-side Java code, including enabling a custom limitation and prohibiting specific actions or stamina settings. ```java // 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(); } } ``` -------------------------------- ### Set Values to Default Example Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Resets limitation values to default for a player using a custom limitation ID. ```text parcool limitations set of to_default ``` -------------------------------- ### Get Stamina Instance Source: https://github.com/alrex-u/parcool/wiki/for_developer/mod_api Get the Stamina instance for a player. ```java import com.alrex.parcool.api.Stamina; /*-------In your code-------*/ Stamina instance = Stamina.get(player); ``` -------------------------------- ### Disable Each Actions Example Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Disables specific actions for a player using a custom limitation ID. ```text parcool limitations set of possibility false ``` -------------------------------- ### Consume Stamina Source: https://github.com/alrex-u/parcool/blob/1.16.5/docs/parcool-guide-on-web-latest/for_developer/mod_api.md Example of how to consume stamina by a passed value for a local player on the client side. ```java @OnlyIn(Dist.Client) void consume(int value) ``` -------------------------------- ### Recover Stamina Source: https://github.com/alrex-u/parcool/blob/1.16.5/docs/parcool-guide-on-web-latest/for_developer/mod_api.md Example of how to recover stamina by a passed value for a local player on the client side. ```java @OnlyIn(Dist.Client) void recover(int value) ``` -------------------------------- ### Set Max Stamina Limitation Example Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Sets a maximum stamina limitation for a player using a custom limitation ID. ```text parcool limitations set of integer max_stamina_limit ``` -------------------------------- ### Disable Infinite Stamina Example Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Disables infinite stamina for a player using a custom limitation ID. ```text parcool limitation set of boolean allow_infinite_stamina false ``` -------------------------------- ### Set Stamina Value Source: https://github.com/alrex-u/parcool/blob/1.16.5/docs/parcool-guide-on-web-latest/for_developer/mod_api.md Example of how to set the current stamina value for a local player on the client side. ```java @OnlyIn(Dist.Client) void setValue(int value) ``` -------------------------------- ### Set Least Stamina Consumption Example Source: https://github.com/alrex-u/parcool/wiki/for_developer/limitations Sets the least stamina consumption for a specific action for a player using a custom limitation ID. ```text parcool limitations set of least_stamina_consumption ``` -------------------------------- ### Gradle Dependencies Source: https://github.com/alrex-u/parcool/wiki/for_developer/mod_api Add ParCool dependency to your project. ```groovy dependencies { implementation fg.deobf("curse.maven:parcool-482378:${fileid /*Edit here*/}") } ``` -------------------------------- ### Server-wide Limitation Configuration Source: https://github.com/alrex-u/parcool/blob/1.16.5/QandA.md Configuration setting to enable server-wide limitations in Parcool. ```text limitations_imposed = true ``` -------------------------------- ### Gradle Repositories Source: https://github.com/alrex-u/parcool/wiki/for_developer/mod_api Add Curse Maven repository to your Gradle buildscripts. ```groovy repositories { maven { url "https://cursemaven.com" } } ``` -------------------------------- ### Individual Limitation Command Source: https://github.com/alrex-u/parcool/blob/1.16.5/QandA.md Minecraft command to enable individual limitations for players in Parcool. ```text parcool limitations enable ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.