ModsJava
Effort API
Minecraft Java mod. Downloads from the MC Java Mods app on Android.
⬇ Download on SpigotEFFORTAPI
This plugin helps you records players "efforts".
For example, the amount of time a player has mined a diamond ore, e.g 20 times. For each diamond ore mined by the player, the EffortAPI will call an event containing all necessary datas.
Simple isn't it? You can also add other requirements like checking if the player Mined Stone with Wooden PIckaxe, or Killed Zombies with Raw Fish. etc
Remember to add
softdepend : Effort
in your plugin.yml
This plugin helps you records players "efforts".
For example, the amount of time a player has mined a diamond ore, e.g 20 times. For each diamond ore mined by the player, the EffortAPI will call an event containing all necessary datas.
Spoiler: Record Amount of Diamond Mined by Player
1. First, make a effort class to record diamond ores mined.
2. Register the Effort Event for the API to start recording
3. You are done! The API will now record diamond ores mined by the players!
4. Now that you are done, lets give players a reward for mining 100 diamond ores by listening to EffortBukkitEvent.java
Code (Java):
public
class MineDiamond
implements EffortEvent
{
@Override
public EffortType getEventType ( ) {
/* Event Type is BLOCK_BREAK because we want to check diamond ores mined */
return EffortType. BLOCK_BREAK ;
}
@Override
public boolean checkPlayer ( Event e ) {
// Change Event to BlockBreakEvent
BlockBreakEvent ev = (BlockBreakEvent ) e ;
// Check if the Block Material is a Diamond Ore
if (ev. getBlock ( ). getType ( ) != XMaterial. DIAMOND_ORE. parseMaterial ( ) ) return false ;
//Check if block break event is cancelled
if (ev. isCancelled ( ) ) return false ;
// Player has broken a diamond ore, return true.
return true ;
}
@Override
public String getEffortID ( ) {
// Put in the ID of the effort.
return "MINEDIAMOND" ;
}
@Override
public String getDisplayName ( ) {
// Optional
return "Diamond Ores Mined" ;
}
}
@Override
public EffortType getEventType ( ) {
/* Event Type is BLOCK_BREAK because we want to check diamond ores mined */
return EffortType. BLOCK_BREAK ;
}
@Override
public boolean checkPlayer ( Event e ) {
// Change Event to BlockBreakEvent
BlockBreakEvent ev = (BlockBreakEvent ) e ;
// Check if the Block Material is a Diamond Ore
if (ev. getBlock ( ). getType ( ) != XMaterial. DIAMOND_ORE. parseMaterial ( ) ) return false ;
//Check if block break event is cancelled
if (ev. isCancelled ( ) ) return false ;
// Player has broken a diamond ore, return true.
return true ;
}
@Override
public String getEffortID ( ) {
// Put in the ID of the effort.
return "MINEDIAMOND" ;
}
@Override
public String getDisplayName ( ) {
// Optional
return "Diamond Ores Mined" ;
}
}
Code (Java):
@Override
public void onEnable ( ) {
// register the Event with EffortAPI.registerEvent on your onEnable()
EffortAPI. registerEvent ( new MineDiamond ( ) ) ;
}
public void onEnable ( ) {
// register the Event with EffortAPI.registerEvent on your onEnable()
EffortAPI. registerEvent ( new MineDiamond ( ) ) ;
}
4. Now that you are done, lets give players a reward for mining 100 diamond ores by listening to EffortBukkitEvent.java
Code (Java):
@EventHandler
public void giveRewardForMiningDiamond (EffortBukkitEvent e )
{
// Check if the id is MINEDIAMOND
if (e. getEffortEvent ( ). getEffortID ( ). equalsIgnoreCase ( "MINEDIAMOND" ) ) {
// Give reward
}
}
public void giveRewardForMiningDiamond (EffortBukkitEvent e )
{
// Check if the id is MINEDIAMOND
if (e. getEffortEvent ( ). getEffortID ( ). equalsIgnoreCase ( "MINEDIAMOND" ) ) {
// Give reward
}
}
Simple isn't it? You can also add other requirements like checking if the player Mined Stone with Wooden PIckaxe, or Killed Zombies with Raw Fish. etc
Remember to add
Code (YAML):
softdepend : Effort
- Auto save player data.
- Easy to use API just access EffortAPI.java
- More questions check discord
- Built in command rewards
Quick facts
- Edition: Minecraft Java
- File type: .jar
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Effort API is a free Minecraft Java mod. Downloaded 121 times (via Spigot). Download it and open it directly in the game.