Compare commits
2 Commits
708b21030b
...
2a6baf4ea9
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a6baf4ea9 | |||
| cbeb621af5 |
Binary file not shown.
@@ -1,5 +1,6 @@
|
|||||||
package com.thewrightserver.bigbooms;
|
package com.thewrightserver.bigbooms;
|
||||||
|
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Creeper;
|
import org.bukkit.entity.Creeper;
|
||||||
@@ -9,6 +10,8 @@ import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|||||||
|
|
||||||
public final class Bigbooms extends JavaPlugin implements Listener {
|
public final class Bigbooms extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
|
private int creeperCounter = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
Bukkit.getPluginManager().registerEvents(this, this);
|
Bukkit.getPluginManager().registerEvents(this, this);
|
||||||
@@ -22,10 +25,23 @@ public final class Bigbooms extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onCreeperPrime(ExplosionPrimeEvent event) {
|
public void onCreeperPrime(ExplosionPrimeEvent event) {
|
||||||
if (event.getEntity() instanceof Creeper) {
|
if (event.getEntity() instanceof Creeper creeper) {
|
||||||
float newRadius = event.getRadius() * 10;
|
|
||||||
event.setRadius(newRadius);
|
creeperCounter++;
|
||||||
getLogger().info("Creeper explosion radius set to " + newRadius);
|
|
||||||
|
// Every 20th creeper becomes Red
|
||||||
|
if (creeperCounter % 20 == 0) {
|
||||||
|
|
||||||
|
// Set custom name using Adventure Components
|
||||||
|
creeper.customName(Component.text("Red Creeper"));
|
||||||
|
creeper.isCustomNameVisible();
|
||||||
|
|
||||||
|
// Multiply explosion
|
||||||
|
float newRadius = event.getRadius() * 10;
|
||||||
|
event.setRadius(newRadius);
|
||||||
|
|
||||||
|
getLogger().info("Red Creeper exploded with radius " + newRadius);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -1,4 +0,0 @@
|
|||||||
name: Bigbooms
|
|
||||||
version: '1.0-SNAPSHOT'
|
|
||||||
main: com.thewrightserver.bigbooms.Bigbooms
|
|
||||||
api-version: '1.21'
|
|
||||||
Reference in New Issue
Block a user