Hello.. I have a plugin, that gives random items when you crush the egg, but there's the problem. Chicken Farms are against the server rules in my server, but players are still making them to get eggs. I could fix that by simply disabling chickens from laying eggs, but I need a plugin for that.. Anyone? Thanks. Edit: Players will be able to still get eggs from killing the chicken (Custom Drops) or buying in shop.
Ok, I'll give this a go. ETA 24 Hours. Its a tad hackish, Any Devs have any ideas on Event to be called, currently it is onItemSpawn(ItemSpawnEvent event){} EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Try using a CreatureSpawnEvent checking if the creature is a chicken and if so cast it to Chicken and use the setBreed(Boolean b) method to disallow it from breeding. If you ever have a difficulty finding a certain thing to use with bukkit try finding it on this page: http://jd.bukkit.org/apidocs/
I'm not sure why CreatureSpawnEvent is the one I want, I want it to be thrown when an egg is laid, you know the normal egg, not the spawn one. It seems like there is no event for when the eggs are laid, perhaps the hackish way will work. Ok, I have made it, but I am not sure whether it actually works, Its a tad difficult to test it on a 2GB machine, whith that many mobs. This is BETA: It shouldn't break anything, but I am not responsible for any damage. http://dl.dropbox.com/u/25736905/Bukkit Downloads/NoChickenLay-1.0.jar EDIT by Moderator: merged posts, please use the edit button instead of double posting.
For anyone concerned with the hackish manner it works, here is an extract of the source which the plugin uses to check for egg laying.
Okay, here's (hopefully) a plugin that will do it: http://forums.bukkit.org/threads/misc-nochickeneggs-v0-1-chickens-lay-no-eggs-1-1-r3.58426/ Question: What can spawn an egg? I know players can (throw and drop), chickens and dispensers. Are there any other?
Dispensers can only 'throw', plugins can also spawn eggs. Edit: I have looked through the source from the other plugin, they had the same idea as me, I just used it badly , but their plugin won't accommodate for other plugins spawning eggs as items, therefore I have modified mine to accommodate for them. Second Edit: Just download using the same link.