Fallen Squid - Squid elimination, Simple as that! Version: v1.0 Usage: Drop the *.jar into your "/plugins" folder Reload server Enjoy a Squid free world **Warning, this will only kill newly spawned squid, all old squid will need to de-spawn for this to be completely true** Features: Kills any squid that try to inhabit those awesome water builds you make! Download Source Code (Coming soon) <--- Its not much... really it isn't To-Do: Kill pre-existing squid Make a command that kills pre-existing squid (this may be the solution to the last "to-do") Changelog: Version 1.0 Initial Release
This has already been made and can be achieved with loads of other plugins. Theres really no reason to make this when this has 10 times the functionality.
Then a mod may delete if they wish, I was not trying to re-create a plugin, I was just trying out some new events because I am a new plugin developer. Sorry for any trouble I ensued
You didn't cause any trouble, stick with it and add more functionality. All big, functional plugins like iConomy and McMMo etc. All started off small. Maybe try a whole mob suite or something? Just a suggestion.
@Shamebot Added now, thank you for pointing that out I was thinking about making a Mob controlling plugin that allowed you to remove mobs based on a config file, but I looked around and there are a couple plugins that already have that functionality. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You could add Squid Pets? Maybe a squid that follows you around I know it sounds like I'm not being serious but I really am. Pet plugins were big back in the day!
@iPhysX Ya, I am relevantly new to Minecraft as a whole (about 6 months experience) and java as well (about 2 weeks experience)
So, are there any feature requests that you guys would want, Like a full feature mob controlling plugin that allows you to choose what mobs spawn (including passive mobs). I just need some ideas to work with so that I can start brain storming on what features to include.
@iPhysX Ok so small problem, I cant seem to figure this out, Can you please check out my source and see what I am doing wrong (Warning, My code is probably really messy) FallenMobs.java Code:java package me.fallenadvent.plugins.fallenmobs; import org.bukkit.event.Event.Priority;import org.bukkit.event.Event.Type;import org.bukkit.plugin.PluginDescriptionFile;import org.bukkit.plugin.PluginManager;import org.bukkit.plugin.java.JavaPlugin;import org.bukkit.util.config.Configuration; public class FallenMobs extends JavaPlugin {//Creating Variablesprivate PluginManager pm;private PluginDescriptionFile info;public Configuration config;//Aggressivepublic boolean creeper;public boolean Cspider;public boolean Ghast;public boolean Silverfish;public boolean Skeleton;public boolean Slime;public boolean Spider;public boolean Zombie;//Neutralpublic boolean Ender;public boolean Wolf;public boolean Zpigmen;//Passivepublic boolean Chicken;public boolean Cow;public boolean Pig;public boolean Sheep;public boolean Squid;public void onDisable() { //OnDisable Messages info = getDescription(); System.out.println("[" + info.getName() + " " + info.getVersion() + "] is now disabled!"); } public void onEnable() { //Regestering Events pm = getServer().getPluginManager(); pm.registerEvent(Type.CREATURE_SPAWN, new FMEntityListener(this), Priority.Low, this); //Configuration File config = getConfiguration(); //Load config.load(); //Aggressive creeper = config.getBoolean("Creeper", true); Cspider = config.getBoolean("Cave_Spider", true); Ghast = config.getBoolean("Ghast", true); Silverfish = config.getBoolean("Silverfish", true); Skeleton = config.getBoolean("Skeleton", true); Slime = config.getBoolean("Slime", true); Spider = config.getBoolean("Spider", true); Zombie = config.getBoolean("Zombie", true); //Neutral Ender = config.getBoolean("Enderman", true); Wolf = config.getBoolean("Wolf", true); Zpigmen = config.getBoolean("Zombie_Pigmen", true); //Passive Chicken = config.getBoolean("Chicken", true); Cow = config.getBoolean("Cow", true); Pig = config.getBoolean("Pig", true); Sheep = config.getBoolean("Sheep", true); Squid = config.getBoolean("Squid", true); //Save config.save(); //OnEnable Messages info = getDescription(); System.out.println("[" + info.getName() + " " + info.getVersion() + "] is now enabled!"); } } FMEntityListener.java Code:java package me.fallenadvent.plugins.fallenmobs; import org.bukkit.entity.CreatureType;import org.bukkit.event.entity.CreatureSpawnEvent;import org.bukkit.event.entity.EntityListener; public class FMEntityListener extends EntityListener{ FallenMobs plugin; public FMEntityListener(FallenMobs plugin) { this.plugin = plugin; } //Begin the slaughter public void onCreatureSpawnEvent(CreatureSpawnEvent event){ plugin.config.load(); CreatureType spawntype = event.getCreatureType(); //Creeper if ((spawntype == CreatureType.CREEPER) && (plugin.creeper = false)) { event.setCancelled(true); } //Cave_Spider if ((spawntype == CreatureType.CAVE_SPIDER) && (plugin.creeper = false)) { event.setCancelled(true); } //Ghast if ((spawntype == CreatureType.GHAST) && (plugin.Ghast = false)) { event.setCancelled(true); } //Silverfish if ((spawntype == CreatureType.SILVERFISH) && (plugin.Silverfish = false)) { event.setCancelled(true); } //Skeleton if ((spawntype == CreatureType.SKELETON) && (plugin.Skeleton = false)) { event.setCancelled(true); } //Slime if ((spawntype == CreatureType.SLIME) && (plugin.Slime = false)) { event.setCancelled(true); } //Spider if ((spawntype == CreatureType.SPIDER) && (plugin.Spider = false)) { event.setCancelled(true); } //Zombie if ((spawntype == CreatureType.ZOMBIE) && (plugin.Zombie = false)) { event.setCancelled(true); } //Enderman if ((spawntype == CreatureType.ENDERMAN) && (plugin.Ender = false)) { event.setCancelled(true); } //Wolf if ((spawntype == CreatureType.WOLF) && (plugin.Wolf = false)) { event.setCancelled(true); } //Zombie_Pigman if ((spawntype == CreatureType.PIG_ZOMBIE) && (plugin.Zpigmen = false)) { event.setCancelled(true); } //Chicken if ((spawntype == CreatureType.CHICKEN) && (plugin.Chicken = false)) { event.setCancelled(true); } //Cow if ((spawntype == CreatureType.COW) && (plugin.Cow = false)) { event.setCancelled(true); } //Pig if ((spawntype == CreatureType.PIG) && (plugin.Pig = false)) { event.setCancelled(true); } //Sheep if ((spawntype == CreatureType.SHEEP) && (plugin.Sheep = false)) { event.setCancelled(true); } //Squid if ((spawntype == CreatureType.SQUID) && (plugin.Squid = false)) { event.setCancelled(true); } //End of Slaughter}} Plugin.yml Code:yaml author: Fallen Adventdatabase: falsedescription: Control what mobs spawn, And some other cool featuresgenerator: [url]http://dinnerbone.com/minecraft/tools/pluginator/[/url]main: me.fallenadvent.plugins.fallenmobs.FallenMobsname: FallenMobsstartup: postworldversion: '1.0'
Ok now what exactly is the problem, your code actually looks pretty clean btw.. Mine is messier. SEE PROOF>ITS MESSY. Let me know what the problem is and i might be able to help
you are now loading the configuration file of your plugin with Code: config = getConfiguration(); Instead you should load your own custom config file with Code: config = new Configuration(new File("plugins/yourplugin/someconfigfile.yml"));
@iPhysX Example : Creeper in the config is set to false (so that they dont spawn) and it isn't working, I have re-written the code about 8 times and still there seems to be a mistake or just something I am missing completely.
@iPhysX So instead of Code:java if ((spawntype == CreatureType.CREEPER) && (plugin.creeper = false) { event.setcanceled(true);} What would I put, cause that is the only thing I can think of that would work. (Then again, I am new to this and in all reality have no clue what I am doing)
@iPhysX Nope, didn't work, I think I am going to take a new method of writing to and reading from the config, I look up some similar plugins and there is a couple other ways to write this.
Just because a mod 'already exists' doesn't mean another mod is the same. There are other mods that claim to do the same thing as this one, but I have not seen them work correctly in tests I have done. In essence, keep working while you feel the desire to do so. Even if you stop working on this mod in the future it will teach you many things that you can take in to any future projects. Purely from an Admin point of view: For this plugin to be versatile it will need to Allow Admins to choose a maximum number of squids that can spawn around each player on the server. Be able to have the above figure reduced to 0 if it is deemed necessary. As you have already realised, have a function to purge all pre-existing squid in the world/s. Allow multiple world support (making sure that each world can be configured separately). Prevent squids being held in chunks as they are saved. I'm not that sure about number five but I have read on multiple occasions that squid, slimes and one other mob type aren't de-spawned in the same way as other mobs and this is part of the problem with them taking over peoples worlds. I hope you continue work on this to the point that it is fleshed out and productive. I'm going to give it a try as it stands now and keep an eye on this thread. It looks very promising. P.S: I have tried that plugin with the 1.0.1 Bukkit RB that it is claimed to work with. The result? It spawned squids when the conditions were right. It de-spawned squid when the player was far enough away from them. Problem? It seemed to keep a tally of how many squids had been spawned since /reload or a restart. Once the number in the config file is reached, it REFUSES to spawn any more squids until another restart or /reload. My opinion: It does not do what the creator claims at this moment in time. Let's hope this one can!