[ADMN] SpawnCreature v1.0 - Barebones mob spawning [953]

Discussion in 'Inactive/Unsupported Plugins' started by Protected, Apr 1, 2011.

  1. SpawnCreature - Barebones mob spawning
    Version 1.0 - Download JAR

    So I wanted to spawn some mobs for testing purposes and was much annoyed to find this feature was only provided by multi-command bundle plugins, on blocks, by outdated plugins, or by plugins that are overly complicated and rely on things like direct CraftBukkit access. So I whipped this up in 10 minutes, enjoy.

    WARNING: This is "common" knowledge but sometimes knowledge is so common no one will actually tell you: All mob names are capitalized, for example, Pig will work, pig won't.

    Features:
    • No Permissions support! Uses isOp (you must be an operator to use). No other dependencies.
    • Spawns mobs! /spawncreature NAME [AMOUNT]
    Changelog:

    v1.0 - initial release​

    Installation:

    Put the jar in the plugins directory and reload/restart.

    The complete source code (open)

    Code:
    package net.myshelter.minecraft;
    
    import java.util.logging.Logger;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.CreatureType;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class SpawnCreature extends JavaPlugin {
    
        public static Logger log = Logger.getLogger("Minecraft");
    
        public void onEnable() {
            log.info("SpawnCreature is on!");
        }
    
        public void onDisable() {
            log.info("SpawnCreature is off...");
        }
    
        public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)  {
            if (!(sender instanceof Player)) return false;
            Player player = (Player)sender;
            if (!player.isOp()) return false;
            if (command.getName().equalsIgnoreCase("spawncreature")) {
                if (args.length < 1) return true;
                CreatureType ct = CreatureType.fromName(args[0]);
                if (ct == null) return true;
                int amount = 1;
                if (args.length > 1) amount = Integer.parseInt(args[1]);
                for (int i = 0; i < amount; i++)
                    player.getWorld().spawnCreature(player.getLocation(), ct);
                return true;
            }
            return false;
        }
    
    }
    
     
    Macios14 and tombik like this.
  2. Offline

    Frido

    I like the addon, but the creatures spawn at where you standing and thats not good with creepers...
     
  3. Offline

    belfedia

    not working on CB 733
     
  4. Confirmed to be working on 733.
     
  5. Offline

    Kakugo

    Ghasts and Creepers are not working on 740
     
  6. Offline

    Allio567

    Thanks broski! It's works just finee :]
     
  7. Offline

    Niall_

    Old thread but I looked up the JavaDocs for craftbukkit and here's a list of mobs you can spawn with this plugin, figured someone could use them at least (ignore the quotes)

    "Chicken"
    "Cow"
    "Creeper"
    "Ghast"
    "Giant"
    "Monster"
    "Pig"
    "PigZombie"
    "Sheep"
    "Skeleton"
    "Slime"
    "Spider"
    "Squid"
    "Zombie"
    "Wolf"

    Giants are the giant zombies notch was testing and made a YT vid about, Monsters are human mobs, Zombie Pig Men don't work too well in multiplayer
     
  8. Offline

    GoreMishap

    Noob here ^^

    1. Nice Plugin
    2. If I've got the version 798 on my Server, do I need the Plugins with exact this version or can I use Plugins with older versions (766), too? I mean if it works?!?!

    sry for bad english :(
     
  9. Offline

    HawnSolo

    1.6.6 and b818 are out. Just saying.

    Edit:
    Well played, sir.
     
  10. Offline

    KO_FU_MATT

    WOW THIS IS SO COOL THX SO MUCH :D
     
  11. Offline

    duck2016

    update so we can spawn endearment blue cave spiders and silverfish so i can make more difficult challenges in my arena
     
  12. Offline

    Kerrick

    It actually works. Use Silverfish and CaveSpider (case sensitive).
     
  13. Offline

    cheese5505

    Nice Plugin. Works Good On Craftbukkit 1.9 #4 And Works With
    EnderDragon​
     
  14. Offline

    thunderbird321

    Please add enderdragons and snow golems that released in the new update. Also it would be nice if it wasn't case sensitive
     
  15. Look, man, all monsters ever added work with this plugin, with no changes required. You just need to find the correct capitalization. This plugin is not maintained and the source code is in the top post if you want to change something, but as you can possibly see it just feeds the monster name straight into bukkit.
     
  16. Offline

    phosphod

    i couldnt seem to get anything to spawn...
     
  17. Offline

    firelad

    Hey, the download is broke. I tried copy it but still seem broke to me. I tried other browser too. Will ya upload it in MegaUpload or Mediafire? They never be broke link. Sometimes they deleted and mark it as broke link because it can be break their rules. Make sure you're careful with that file.
     
  18. Offline

    darkfireblast

    errrm, i cant download it for some reason, any help?
     
  19. Offline

    Buuburn

    Btw,
    Change this:
    CreatureType ct = CreatureType.fromName(args[0]);

    To this:

    CreatureType ct = CreatureType.valueOf(args[0].toUpperCase());


    This works all the time and should fix the case sensitive problem you're having.
     
  20. Offline

    jaZz_KCS

    Obviously still working.

    Keep in mind tis still uppercase sensitive if not using fix mentioned above.
     
  21. Offline

    NovaSplurge

    404 Not Found
    Please Fix...
     
  22. Offline

    md_5

    Long time no see Protected. You will notice that this thread has now been placed into the Inactive Plugin subforum.
    If you wish to revive this plugin, please ensure that you update and test compatibility with the latest recommended Bukkit build before reporting your original post, asking for it to be moved back to the release forum.

    Thanks for your time.
    md_5
     

Share This Page