HomeJavaModsGroovyStages
GroovyStages
ModsJava

GroovyStages

by _eerie2 · on Modrinth

This is a mod provides GroovyScript extenders for working with GameStages. It allows pack makers to add/remove/check stages on players more intuitively.

⬇ Download on Modrinth

GroovyStages

This is a mod provides GroovyScript extenders for working with GameStages. It allows pack makers to add/remove/check stages on players more intuitively.

How to use

This mod adds game stage related methods to the EntityPlayer class, pack makers can simply call the methods as if they were a part of the class.

The methods are as follows:

GroovyStages method GameStages method Functionality
hasStage(String) hasStage(EntityPlayer, String) Returns true or false, checks if the player has a game stage.
hasAnyStage(String...) hasAnyOf(EntityPlayer, String...) Returns true or false, checks if the player has any of the game stages provided.
hasAllStages(String...) hasAllOf(EntityPlayer, String...) Returns true or false, checks if the player has all game stage provided.
addStage(String) addStage(EntityPlayer, String) Adds the provided game stage to the player.
addAllStages(String...)
Adds all the provided game stages to the player.
removeStage(String) removeStage(EntityPlayer, String) Removes the provided game stage from the player.
removeStage(String...)
Removes all the provided game stages from the player.
syncStages() syncPlayer(EntityPlayer) Synchronizes game stages between client and server. Provided mostly as an emergency.

 

Example usage

import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed

event_manager.listen { BreakSpeed ev -> if (ev.getEntityPlayer().hasStage("advancedMining")) ev.setNewSpeed(ev.getOriginalSpeed() + 1.5f) }

~~~~

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more