Skip to content

Instantly share code, notes, and snippets.

Last active Jun 11, 2020
What would you like to do?
#LegacyZombies config
#if this is true, feathers will drop with flesh
#if false, feathers will drop by themselves only.
dropFleshAndFeathers: false
#Percent Chance in Decimal of Feather Drops
chanceOfFeatherDrop: 0.50
package net.mystia.LegacyZombies;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemStack;
public class LegacyZombiesMain extends JavaPlugin implements Listener
public void onEnable()
File config = new File(this.getDataFolder(), "config.yml");
if (!config.exists())
getLogger().info("Loading LegacyZombies");
Bukkit.getServer().getPluginManager().registerEvents(this, this);
public void onZombieDeath(EntityDeathEvent event)
if (event.getEntityType() == EntityType.ZOMBIE)
Double FeatherDropChance = this.getConfig().getDouble("chanceOfFeatherDrop");
Boolean DropBothItems = this.getConfig().getBoolean("dropFleshAndFeathers");
if (Math.random() < FeatherDropChance)
ItemStack feather = new ItemStack(Material.FEATHER, 1);
if (DropBothItems == false){
public void onDisable()
getLogger().info("LegacyZombies has been disabled");
name: LegacyZombies
main: net.mystia.LegacyZombies.LegacyZombiesMain
version: 0.1
description: Makes Zombies drop feathers
author: ron975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment