update config, adds config migration, adds setPersistance (dont despawn mobs)

This commit is contained in:
BuildTools 2021-07-15 02:38:37 +02:00
parent 953fa59302
commit bd5d0b4d5f
13 changed files with 706 additions and 487 deletions

22
pom.xml
View File

@ -2,9 +2,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.shansen</groupId>
<groupId>com.minecraftheads</groupId>
<artifactId>EggCatcher</artifactId>
<version>1.2</version>
<version>1.3</version>
<packaging>jar</packaging>
<name>EggCatcher</name>
@ -27,21 +27,12 @@
<configuration>
<minimizeJar>true</minimizeJar>
<artifactSet>
<includes>
<include>org.bstats:*</include>
</includes>
<excludes>
<exclude>org.bukkit:bukkit</exclude>
<exclude>org.yaml:snakeyaml</exclude>
<exclude>net.milkbowl.vault:Vault</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>me.shansen.EggCatcher.bstats</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
@ -68,10 +59,6 @@
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
</repositories>
<dependencies>
@ -87,10 +74,5 @@
<version>1.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.7</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,125 @@
package com.minecraftheads.EggCatcher;
import com.minecraftheads.EggCatcher.listeners.EggCatcherEntityListener;
import com.minecraftheads.EggCatcher.listeners.EggCatcherPlayerListener;
import com.minecraftheads.EggCatcher.listeners.EggCatcherSpawnListener;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.file.YamlConstructor;
import org.bukkit.entity.Egg;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class EggCatcher extends JavaPlugin {
public static List<Egg> eggs = new ArrayList<Egg>();
public static Economy economy = null;
public void onDisable() {
}
public void onEnable() {
this.CheckConfigurationFile();
PluginManager pm = this.getServer().getPluginManager();
final EggCatcherPlayerListener playerListener = new EggCatcherPlayerListener();
final EggCatcherEntityListener entityListener = new EggCatcherEntityListener(this);
final EggCatcherSpawnListener spawnListener = new EggCatcherSpawnListener(this);
pm.registerEvents(playerListener, this);
pm.registerEvents(entityListener, this);
pm.registerEvents(spawnListener, this);
if (getServer().getPluginManager().getPlugin("Vault") != null) {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration
(Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
}
}
public void CheckConfigurationFile() {
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
if (configVersion > 6.0) {
MigrateConfigFile();
}
if (configVersion == 6.0) {
this.saveConfig();
} else {
this.saveResource("config.yml", true);
this.reloadConfig();
}
}
// This is a ugly piece if shit but i want to make the transition as smooth as possible
public boolean MigrateConfigFile() {
String[] keysWithBoolValue = {"UsePermissions", "UseCatchChance", "LooseEggOnFail", "UseVaultCost", "UseItemCost", "UseHealthPercentage", "ExplosionEffect", "SmokeEffect", "NonPlayerCatching", "PreventCatchingBabyAnimals", "PreventCatchingTamedAnimals", "PreventCatchingShearedSheeps", "SpawnChickenOnSuccess", "SpawnChickenOnFail", "DeleteVillagerInventoryOnCatch", "LogEggCaptures", "setPersistence"};
String[] keysWithStringValue = {"VaultTargetBankAccount"};
String[] entitiesInConfig = {"Axolotl", "Bat", "Bee", "Blaze", "Cat", "CaveSpider", "Chicken", "Cod", "Cow", "Creeper", "Dolphin", "Donkey", "Drowned", "ElderGuardian", "Enderman", "Endermite", "Evoker", "Fox", "Ghast", "GlowSquid", "Goat", "Guardian", "Hoglin", "Horse", "Husk", "Llama", "MagmaCube", "Mule", "MushroomCow", "Ocelot", "Panda", "Parrot", "Phantom", "Pig", "Piglin", "PiglinBrute", "PigZombie", "Pillager", "PolarBear", "Pufferfish", "Rabbit", "Ravager", "Salmon", "Sheep", "Shulker", "Silverfish", "Skeleton", "SkeletonHorse", "Slime", "Spider", "Squid", "Stray", "Strider", "TraderLlama", "TropicalFish", "Turtle", "Vex", "Villager", "Vindicator", "WanderingTrader", "Witch", "WitherSkeleton", "Wolf", "Zoglin", "Zombie", "ZombieHorse", "ZombieVillager", "ZombifiedPiglin"};
FileConfiguration config = this.getConfig();
HashMap <String, HashMap> entityList = new HashMap<>();
for (int i = 0; i < keysWithBoolValue.length; i++) {
config.set(keysWithBoolValue[i], config.getBoolean(keysWithBoolValue[i], true));
}
for (int i = 0; i < keysWithStringValue.length; i++) {
config.set(keysWithStringValue[i], config.getString(keysWithStringValue[i], ""));
}
for (int i = 0; i < entitiesInConfig.length; i++) {
HashMap<String, HashMap> entity = new HashMap<>();
HashMap<String, Double> HealthPercentage = new HashMap<String, Double>();
HashMap<String, Double> CatchChance = new HashMap<>();
HashMap<String, Double> VaultCost = new HashMap<>();
HashMap<String, HashMap> ItemCost = new HashMap<>();
HashMap<String, Double> ItemAmount = new HashMap<>();
HashMap<String, String> ItemName = new HashMap<>();
// generate ItemCost
ItemName.put("ItemName", config.getString("ItemCost.ItemId", "gold_nugget"));
ItemAmount.put("Amount", config.getDouble("ItemCost.Amount." + entitiesInConfig[i], 0.0));
ItemCost.put("ItemCost", ItemAmount);
ItemCost.put("ItemCost", ItemName);
// generate VaultCost
VaultCost.put("VaultCost", config.getDouble("VaultCost." + entitiesInConfig[i], 0.0));
// generate CatchChance
CatchChance.put("CatchChance", config.getDouble("CatchChance." + entitiesInConfig[i], 0.0));
// generate HealthPercentage
HealthPercentage.put("HealthPercentage", config.getDouble("HealthPercentage." + entitiesInConfig[i], 0.0));
// Build new Config Hash for entity
entity.put(entitiesInConfig[i], ItemCost);
entity.put(entitiesInConfig[i], VaultCost);
entity.put(entitiesInConfig[i], HealthPercentage);
entity.put(entitiesInConfig[i], CatchChance);
entityList.put(entitiesInConfig[i], entity);
}
config.set("Entity", entityList);
config.set("Version", 6.0);
config.set("VaultCost", null);
config.set("HealthPercentage", null);
config.set("CatchChance", null);
config.set("ItemCost", null);
return true;
}
}

View File

@ -1,4 +1,4 @@
package me.shansen.EggCatcher;
package com.minecraftheads.EggCatcher;
import java.io.File;
import java.io.FileWriter;
@ -7,7 +7,6 @@ import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
//Created 11/11/2016 2:21 AM
public class EggCatcherLogger{
private final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
private File file;

View File

@ -1,22 +1,4 @@
/*
EggCatcher
Copyright (C) 2012, 2013 me@shansen.me
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package me.shansen.EggCatcher;
package com.minecraftheads.EggCatcher;
import org.bukkit.Material;
import org.bukkit.entity.Entity;

View File

@ -1,22 +1,4 @@
/*
EggCatcher
Copyright (C) 2012, 2013 me@shansen.me, andre@norcode.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package me.shansen.EggCatcher.events;
package com.minecraftheads.EggCatcher.events;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;

View File

@ -16,12 +16,12 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package me.shansen.EggCatcher.listeners;
package com.minecraftheads.EggCatcher.listeners;
import me.shansen.EggCatcher.EggCatcher;
import me.shansen.EggCatcher.EggCatcherLogger;
import me.shansen.EggCatcher.EggType;
import me.shansen.EggCatcher.events.EggCaptureEvent;
import com.minecraftheads.EggCatcher.EggCatcherLogger;
import com.minecraftheads.EggCatcher.EggType;
import com.minecraftheads.EggCatcher.EggCatcher;
import com.minecraftheads.EggCatcher.events.EggCaptureEvent;
import org.bukkit.Effect;
import org.bukkit.Material;
@ -36,6 +36,7 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.attribute.Attribute;
import java.io.File;
@ -169,9 +170,9 @@ public class EggCatcherEntityListener implements Listener {
}
if (this.useHealthPercentage) {
double healthPercentage = config.getDouble("HealthPercentage." + eggType.getFriendlyName());
double healthPercentage = config.getDouble("Entity." + eggType.getFriendlyName() + ".HealthPercentage");
double currentHealth = ((LivingEntity) entity).getHealth() * 100.0 / ((LivingEntity) entity)
.getMaxHealth();
.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
if (healthPercentage < currentHealth) {
if (this.healthPercentageFailMessage.length() > 0) {
player.sendMessage(String.format(this.healthPercentageFailMessage, healthPercentage));
@ -185,7 +186,7 @@ public class EggCatcherEntityListener implements Listener {
}
if (this.useCatchChance) {
double catchChance = config.getDouble("CatchChance." + eggType.getFriendlyName());
double catchChance = config.getDouble("Entity." + eggType.getFriendlyName() + ".CatchChance");
if (Math.random() * 100 <= catchChance) {
if (this.catchChanceSuccessMessage.length() > 0) {
player.sendMessage(catchChanceSuccessMessage);
@ -205,8 +206,8 @@ public class EggCatcherEntityListener implements Listener {
boolean freeCatch = player.hasPermission("eggcatcher.free");
if (this.useVaultCost && !freeCatch) {
vaultCost = config.getDouble("VaultCost." + eggType.getFriendlyName());
if (!EggCatcher.economy.has(player.getName(), vaultCost)) {
vaultCost = config.getDouble("Entity." + eggType.getFriendlyName() + ".VaultCost");
if (!EggCatcher.economy.has(player, vaultCost)) {
player.sendMessage(String.format(config.getString("Messages.VaultFail"), vaultCost));
if (!this.looseEggOnFail) {
player.getInventory().addItem(new ItemStack(Material.EGG, 1));
@ -214,7 +215,7 @@ public class EggCatcherEntityListener implements Listener {
}
return;
} else {
EggCatcher.economy.withdrawPlayer(player.getName(), vaultCost);
EggCatcher.economy.withdrawPlayer(player, vaultCost);
if (!this.vaultTargetBankAccount.isEmpty()) {
EggCatcher.economy.bankDeposit(this.vaultTargetBankAccount, vaultCost);
@ -225,11 +226,10 @@ public class EggCatcherEntityListener implements Listener {
}
if (this.useItemCost && !freeCatch) {
Material itemMaterial = Material.matchMaterial(config.getString("ItemCost.ItemId", "gold_nugget"));
int itemData = config.getInt("ItemCost.ItemData", 0);
int itemAmount = config.getInt("ItemCost.Amount." + eggType.getFriendlyName(), 0);
@SuppressWarnings("deprecation")
ItemStack itemStack = new ItemStack(itemMaterial, itemAmount, (short) itemData);
Material itemMaterial = Material.matchMaterial(config.getString("Entity." + eggType.getFriendlyName() + ".ItemCost.ItemName", "gold_nugget"));
int itemData = config.getInt("Entity." + eggType.getFriendlyName() + ".ItemCost.ItemData", 0);
int itemAmount = config.getInt("Entity." + eggType.getFriendlyName() + ".ItemCost.Amount", 0);
ItemStack itemStack = new ItemStack(itemMaterial, itemAmount);
if (player.getInventory().containsAtLeast(itemStack, itemStack.getAmount())) {
player.sendMessage(String.format(config.getString("Messages.ItemCostSuccess"),
String.valueOf(itemAmount)));
@ -250,7 +250,7 @@ public class EggCatcherEntityListener implements Listener {
return;
}
if (this.useCatchChance) {
double catchChance = config.getDouble("CatchChance." + eggType.getFriendlyName());
double catchChance = config.getDouble("Entity." + eggType.getFriendlyName() + ".CatchChance");
if (Math.random() * 100 > catchChance) {
return;
}

View File

@ -0,0 +1,16 @@
package com.minecraftheads.EggCatcher.listeners;
import com.minecraftheads.EggCatcher.EggCatcher;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerEggThrowEvent;
public class EggCatcherPlayerListener implements Listener {
@EventHandler
public void onPlayerEggThrow(PlayerEggThrowEvent event) {
if (EggCatcher.eggs.contains(event.getEgg())) {
event.setHatching(false);
EggCatcher.eggs.remove(event.getEgg());
}
}
}

View File

@ -0,0 +1,37 @@
package com.minecraftheads.EggCatcher.listeners;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.plugin.java.JavaPlugin;
public class EggCatcherSpawnListener implements Listener {
private final boolean setPersistence;
FileConfiguration config;
JavaPlugin plugin;
public EggCatcherSpawnListener(JavaPlugin plugin) {
this.config = plugin.getConfig();
this.plugin = plugin;
this.setPersistence = this.config.getBoolean("setPersistence", true);
}
@EventHandler(ignoreCancelled = false, priority = EventPriority.HIGH)
public void onEntitySpawnedByEgg(CreatureSpawnEvent event) {
if (setPersistence) {
if (!(event instanceof CreatureSpawnEvent)) {
return;
}
if (event.getSpawnReason() == SpawnReason.SPAWNER_EGG) {
event.getEntity().setRemoveWhenFarAway(false);
}
}
}
}

View File

@ -1,4 +1,4 @@
package me.shansen.nbt;
package com.minecraftheads.nbt;
import org.bukkit.Bukkit;
import org.bukkit.inventory.ItemStack;

View File

@ -1,70 +0,0 @@
/*
EggCatcher
Copyright (C) 2012, 2013 me@shansen.me
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package me.shansen.EggCatcher;
import me.shansen.EggCatcher.listeners.EggCatcherEntityListener;
import me.shansen.EggCatcher.listeners.EggCatcherPlayerListener;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.entity.Egg;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.bstats.bukkit.Metrics;
import java.util.ArrayList;
import java.util.List;
public class EggCatcher extends JavaPlugin {
public static List<Egg> eggs = new ArrayList<Egg>();
public static Economy economy = null;
public void onDisable() {
}
public void onEnable() {
this.CheckConfigurationFile();
PluginManager pm = this.getServer().getPluginManager();
final EggCatcherPlayerListener playerListener = new EggCatcherPlayerListener();
final EggCatcherEntityListener entityListener = new EggCatcherEntityListener(this);
pm.registerEvents(playerListener, this);
pm.registerEvents(entityListener, this);
if (getServer().getPluginManager().getPlugin("Vault") != null) {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration
(Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
}
Metrics metrics = new Metrics(this, 894);
}
public void CheckConfigurationFile() {
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
if (configVersion == 5.2) {
this.saveConfig();
} else {
this.saveResource("config.yml", true);
this.reloadConfig();
}
}
}

View File

@ -1,34 +0,0 @@
/*
EggCatcher
Copyright (C) 2012, 2013 me@shansen.me
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package me.shansen.EggCatcher.listeners;
import me.shansen.EggCatcher.EggCatcher;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerEggThrowEvent;
public class EggCatcherPlayerListener implements Listener {
@EventHandler
public void onPlayerEggThrow(PlayerEggThrowEvent event) {
if (EggCatcher.eggs.contains(event.getEgg())) {
event.setHatching(false);
EggCatcher.eggs.remove(event.getEgg());
}
}
}

View File

@ -1,306 +1,506 @@
UsePermissions: true
UseCatchChance: true
LooseEggOnFail: true
UseVaultCost: false
UseItemCost: false
UseHealthPercentage: false
ExplosionEffect: true
SmokeEffect: false
NonPlayerCatching: false
ConfigVersion: 6.0
DeleteVillagerInventoryOnCatch: true
NonPlayerCatching: true
PreventCatchingBabyAnimals: true
PreventCatchingTamedAnimals: true
PreventCatchingShearedSheeps: true
SpawnChickenOnSuccess: false
PreventCatchingTamedAnimals: true
SmokeEffect: true
SpawnChickenOnFail: true
VaultTargetBankAccount: ""
DeleteVillagerInventoryOnCatch: false
LogEggCaptures: false
CatchChance:
Axolotl: 100.0
Bat: 100.0
Bee: 100.0
Blaze: 100.0
Cat: 100.0
CaveSpider: 100.0
Chicken: 100.0
Cod: 100.0
Cow: 100.0
Creeper: 100.0
Dolphin: 100.0
Donkey: 100.0
Drowned: 100.0
ElderGuardian: 100.0
Enderman: 100.0
Endermite: 100.0
Evoker: 100.0
Fox: 100.0
Ghast: 100.0
GlowSquid: 100.0
Goat: 100.0
Guardian: 100.0
Hoglin: 100.0
Horse: 100.0
Husk: 100.0
Llama: 100.0
MagmaCube: 100.0
Mule: 100.0
MushroomCow: 100.0
Ocelot: 100.0
Panda: 100.0
Parrot: 100.0
Phantom: 100.0
Pig: 100.0
Piglin: 100.0
PiglinBrute: 100.0
PigZombie: 100.0
Pillager: 100.0
PolarBear: 100.0
Pufferfish: 100.0
Rabbit: 100.0
Ravager: 100.0
Salmon: 100.0
Sheep: 100.0
Shulker: 100.0
Silverfish: 100.0
Skeleton: 100.0
SkeletonHorse: 100.0
Slime: 100.0
Strider: 100.0
Spider: 100.0
Squid: 100.0
Stray: 100.0
TraderLlama: 100.0
TropicalFish: 100.0
Turtle: 100.0
Vex: 100.0
Villager: 100.0
Vindicator: 100.0
WanderingTrader: 100.0
Witch: 100.0
WitherSkeleton: 100.0
Wolf: 100.0
Zoglin: 100.0
Zombie: 100.0
ZombieHorse: 100.0
ZombieVillager: 100.0
ZombifiedPiglin: 100.0
VaultCost:
Axolotl: 0.0
Bat: 0.0
Bee: 0.0
Blaze: 0.0
Cat: 0.0
CaveSpider: 0.0
Chicken: 0.0
Cod: 0.0
Cow: 0.0
Creeper: 0.0
Dolphin: 0.0
Donkey: 0.0
Drowned: 0.0
ElderGuardian: 0.0
Enderman: 0.0
Endermite: 0.0
Evoker: 0.0
Fox: 0.0
Ghast: 0.0
GlowSquid: 0.0
Goat: 0.0
Guardian: 0.0
Hoglin: 0.0
Horse: 0.0
Husk: 0.0
Llama: 0.0
MagmaCube: 0.0
Mule: 0.0
MushroomCow: 0.0
Ocelot: 0.0
Panda: 0.0
Parrot: 0.0
Phantom: 0.0
Pig: 0.0
Piglin: 0.0
PiglinBrute: 0.0
PigZombie: 0.0
Pillager: 0.0
PolarBear: 0.0
Pufferfish: 0.0
Rabbit: 0.0
Ravager: 0.0
Salmon: 0.0
Sheep: 0.0
Shulker: 0.0
Silverfish: 0.0
Skeleton: 0.0
SkeletonHorse: 0.0
Slime: 0.0
Spider: 0.0
Squid: 0.0
Stray: 0.0
Strider: 0.0
TraderLlama: 0.0
TropicalFish: 0.0
Turtle: 0.0
Vex: 0.0
Villager: 0.0
Vindicator: 0.0
WanderingTrader: 0.0
Witch: 0.0
WitherSkeleton: 0.0
Wolf: 0.0
Zoglin: 0.0
Zombie: 0.0
ZombieHorse: 0.0
ZombieVillager: 0.0
ZombifiedPiglin: 0.0
ItemCost:
ItemId: gold_nugget
ItemData: 0
Amount:
Axolotl: 0.0
Bat: 0.0
Bee: 0.0
Blaze: 0.0
Cat: 0.0
CaveSpider: 0.0
Chicken: 0.0
Cod: 0.0
Cow: 0.0
Creeper: 0.0
Dolphin: 0.0
Donkey: 0.0
Drowned: 0.0
ElderGuardian: 0.0
Enderman: 0.0
Endermite: 0.0
Evoker: 0.0
Fox: 0.0
Ghast: 0.0
GlowSquid: 0.0
Goat: 0.0
Guardian: 0.0
Hoglin: 0.0
Horse: 0.0
Husk: 0.0
Llama: 0.0
MagmaCube: 0.0
Mule: 0.0
MushroomCow: 0.0
Ocelot: 0.0
Panda: 0.0
Parrot: 0.0
Phantom: 0.0
Pig: 0.0
Piglin: 0.0
PiglinBrute: 0.0
PigZombie: 0.0
Pillager: 0.0
PolarBear: 0.0
Pufferfish: 0.0
Rabbit: 0.0
Ravager: 0.0
Salmon: 0.0
Sheep: 0.0
Shulker: 0.0
Silverfish: 0.0
Skeleton: 0.0
SkeletonHorse: 0.0
Slime: 0.0
Spider: 0.0
Squid: 0.0
Stray: 0.0
Strider: 0.0
TraderLlama: 0.0
TropicalFish: 0.0
Turtle: 0.0
Vex: 0.0
Villager: 0.0
Vindicator: 0.0
WanderingTrader: 0.0
Witch: 0.0
WitherSkeleton: 0.0
Wolf: 0.0
Zoglin: 0.0
Zombie: 0.0
ZombieHorse: 0.0
ZombieVillager: 0.0
ZombifiedPiglin: 0.0
HealthPercentage:
Axolotl: 100.0
Bat: 100.0
Bee: 100.0
Blaze: 100.0
Cat: 100.0
CaveSpider: 100.0
Chicken: 100.0
Cod: 100.0
Cow: 100.0
Creeper: 100.0
Dolphin: 100.0
Donkey: 100.0
Drowned: 100.0
ElderGuardian: 100.0
Enderman: 100.0
Endermite: 100.0
Evoker: 100.0
Fox: 100.0
Ghast: 100.0
GlowSquid: 100.0
Goat: 100.0
Guardian: 100.0
Hoglin: 100.0
Horse: 100.0
Husk: 100.0
Llama: 100.0
MagmaCube: 100.0
Mule: 100.0
MushroomCow: 100.0
Ocelot: 100.0
Panda: 100.0
Parrot: 100.0
Phantom: 100.0
Pig: 100.0
Piglin: 100.0
PiglinBrute: 100.0
PigZombie: 100.0
Pillager: 100.0
PolarBear: 100.0
Pufferfish: 100.0
Rabbit: 100.0
Ravager: 100.0
Salmon: 100.0
Sheep: 100.0
Shulker: 100.0
Silverfish: 100.0
Skeleton: 100.0
SkeletonHorse: 100.0
Slime: 100.0
Spider: 100.0
Squid: 100.0
Stray: 100.0
Strider: 100.0
TraderLlama: 100.0
TropicalFish: 100.0
Turtle: 100.0
Vex: 100.0
Villager: 100.0
Vindicator: 100.0
WanderingTrader: 100.0
Witch: 100.0
WitherSkeleton: 100.0
Wolf: 100.0
Zoglin: 100.0
Zombie: 100.0
ZombieHorse: 100.0
ZombieVillager: 100.0
ZombiefiedPiglin: 100.0
SpawnChickenOnSuccess: true
UseCatchChance: true
UseHealthPercentage: true
UseItemCost: true
UsePermissions: true
UseVaultCost: true
ExplosionEffect: true
LogEggCaptures: true
LooseEggOnFail: true
setPersistence: true
VaultTargetBankAccount: ''
Entity:
Axolotl:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Bat:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Bee:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Blaze:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Cat:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
CaveSpider:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Chicken:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Cod:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Cow:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Creeper:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Dolphin:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Donkey:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Drowned:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
ElderGuardian:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Enderman:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Endermite:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Evoker:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Fox:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Ghast:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
GlowSquid:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Goat:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Guardian:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Hoglin:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Horse:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Husk:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Llama:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
MagmaCube:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Mule:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
MushroomCow:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Ocelot:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Panda:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Parrot:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Phantom:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Pig:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
PigZombie:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Piglin:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
PiglinBrute:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Pillager:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
PolarBear:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Pufferfish:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Rabbit:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Ravager:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Salmon:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Sheep:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Shulker:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Silverfish:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Skeleton:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
SkeletonHorse:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Slime:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Spider:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Squid:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Stray:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Strider:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
TraderLlama:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
TropicalFish:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Turtle:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Vex:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Villager:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Vindicator:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
WanderingTrader:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Witch:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
WitherSkeleton:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Wolf:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Zoglin:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Zombie:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
ZombieHorse:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
ZombieVillager:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
ZombifiedPiglin:
CatchChance: 100.0
HealthPercentage: 100.0
ItemCost:
Amount: 0.0
ItemName: gold_nugget
VaultCost: 0.0
Messages:
PermissionFail: "You do not have permission to catch this mob!"
VaultFail: "It costs %s dollars to catch this mob!"
VaultSuccess: "You paid %s dollars for catching this mob!"
ItemCostFail: "It costs %s gold nugget(s) to catch this mob!"
ItemCostSuccess: "You paid %s gold nugget(s) for catching this mob!"
CatchChanceFail: "You failed to catch this mob!"
CatchChanceSuccess: ""
HealthPercentageFail: "The mob has more than %s percent health left and cannot be caught!"
ConfigVersion: 5.2
CatchChanceFail: You failed to catch this mob!
CatchChanceSuccess: ''
HealthPercentageFail: The mob has more than %s percent health left and cannot be
caught!
ItemCostFail: It costs %s gold nugget(s) to catch this mob!
ItemCostSuccess: You paid %s gold nugget(s) for catching this mob!
PermissionFail: You do not have permission to catch this mob!
VaultFail: It costs %s dollars to catch this mob!
VaultSuccess: You paid %s dollars for catching this mob!

View File

@ -1,10 +1,10 @@
name: EggCatcher
version: 5.2
version: 6.0
description: This plugin allows you to catch mobs in eggs.
author: shansen / Update by Blockminers
author: MinecraftHeads
api-version: 1.17
main: me.shansen.EggCatcher.EggCatcher
main: com.minecraftheads.EggCatcher.EggCatcher
permissions:
eggcatcher.catch.*: