MobSpawner Questions

Discussion in 'Plugin Development' started by badtrip, Feb 9, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    badtrip

    Hi!

    I have a little question about the MobSpawner block. How can we get it to spawn Mobs.

    The way I tried: (in onBlockRightClick)

    Code:
                    ((MobSpawner)block.getState()).setMobType(MobType.PIG);
                    ((MobSpawner)block.getState()).setDelay(5);
     
  2. Offline

    ZeroDPS

    you want it to spit out a mob every time you right click it?
    --- merged: Feb 10, 2011 4:16 AM ---
    If that is what you want i would suggest maybe making it a sign control or something, MobSpawners are full of functionality that will make it difficult for you to make it act right.

    but in order to catch the right click of any block (sign included) use the BlockInteractEvent you can find details on the Bukkit Javadocs
     
  3. Offline

    badtrip

    hey! thanks for the quick reply!

    I want to be able to place mobSpawners in the world. But if I use /give command and give myself a spawner it doesn't spawn anything. So I had the idea the create a plugin to change the delay and mobtype but it doesn't seem to work.
     
  4. Offline

    ZeroDPS

  5. Offline

    badtrip

    Yup I saw that one but it's not working anymore since the onCommand change I guess. I looked at the source code and it's using some craftbukkit classes that I'm not familiar with. I could give it a shot to update it, but I'd prefer creating my own stuff.
     
Thread Status:
Not open for further replies.

Share This Page