This is an example of an addon for the
zMobFighter plugin. The system is still under development. If you have any suggestions you can send them to me on discord:
https://discord.groupez.dev/
This addon allows you to send fireballs randomly during a fight.
You must put the addon in the folder plugins/zmobfighter/addons
You must put the addon in the folder plugins/zmobfighter/addons
Code (Java):
package fr.maxlego08.fireball ;
import java.util.ArrayList ;
import java.util.List ;
import java.util.Random ;
import org.bukkit.entity.Entity ;
import org.bukkit.entity.Fireball ;
import org.bukkit.entity.LivingEntity ;
import org.bukkit.event.EventHandler ;
import org.bukkit.event.Listener ;
import org.bukkit.event.entity.EntityExplodeEvent ;
import org.bukkit.potion.PotionEffect ;
import org.bukkit.potion.PotionEffectType ;
import org.bukkit.util.Vector ;
import fr.maxlego08.mobfighter.api.Arena ;
import fr.maxlego08.mobfighter.api.Duel ;
import fr.maxlego08.mobfighter.api.Fighter ;
import fr.maxlego08.mobfighter.api.addons.JavaAddon ;
public class FireBallAddon extends JavaAddon implements Listener {
private long lastAttackSend = 0 ;
private List <Fireball > fireBalls = new ArrayList <Fireball > ( ) ;
@Override
public void onEnable ( ) {
System. out. println ( "Enable !" ) ;
this. registerListener ( this ) ;
}
@Override
public void onDisable ( ) {
System. out. println ( "Disable !" ) ;
}
@Override
public void duelStart (Duel duel, Arena arena, Fighter first, Fighter second ) {
// TODO Auto-generated method stub
}
@Override
public void duelStop (Duel duel, Arena arena, Fighter first, Fighter second ) {
// TODO Auto-generated method stub
}
@Override
public void duelWin (Duel duel, Arena arena, Fighter first, Fighter second ) {
// TODO Auto-generated method stub
}
@Override
public void duelTick (Duel duel, Arena arena, Fighter first, Fighter second ) {
if ( System. currentTimeMillis ( ) > lastAttackSend && first. getLocation ( ). distance (second. getLocation ( ) ) > 5 ) {
Random random = new Random ( ) ;
Fighter fighter = random. nextBoolean ( ) ? first : second ;
LivingEntity entity = fighter. getEntity ( ) ;
entity. addPotionEffect ( new PotionEffect (PotionEffectType. SLOW, 20, 150 ) ) ;
Fireball fireball = entity. launchProjectile (Fireball. class ) ;
Vector vector = fireball. getVelocity ( ) ;
fireball. setVelocity (vector ) ;
fireBalls. add (fireball ) ;
lastAttackSend = System. currentTimeMillis ( ) + ( 1000 * (random. nextInt ( 2 ) + 1 ) ) ;
}
}
@EventHandler
public void onEntityExplode (EntityExplodeEvent event ) {
Entity entity = event. getEntity ( ) ;
if ( this. fireBalls. contains (entity ) ) {
event. setCancelled ( true ) ;
this. fireBalls. remove (entity ) ;
}
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.9, 1.10
- 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.
zMobFighter addon - Fireball is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 151 times (via Spigot). Download it and open it directly in the game.