a Problem with mob spawning.

Discussion in 'Plugin Development' started by Aephout14, Mar 22, 2016.

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

    Aephout14

    Hello, Ladies and Gentlemen from bukkit. I have a problem with a plugin I need help with.

    I have my plugin where, It will give you a recipe, you make it and get a certain spawner.

    Code:
      ShapedRecipe spiderspawner = new ShapedRecipe(new ItemStack(Material.MOB_SPAWNER, 3, (short)52));
      spiderspawner.shape(new String[] { "OOO", "SCS", "OOO" }).setIngredient('S', Material.STRING).setIngredient('C', Material.WEB).setIngredient('O', Material.OBSIDIAN);
      Bukkit.getServer().addRecipe(spiderspawner);
    
    I know, there are more. I know that the problem is since one of the recent Mine-craft updates, you need too right click the spawner in order too change it. The only question I am asking is.

    How would I give the player a certain spawner when they craft it, which spawns the specified mob and not just pigs?

    I have searched but I probably didn't search hard enough!

    bump?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Mar 22, 2016
  2. Use the BlockPlaceEvent to check if it is that item (Add metadata to it to recognize it) and change its type
     
  3. Offline

    Zombie_Striker

    @Aephout14
    You need to set the spawners data when the block is placed down.
     
  4. Offline

    mcdorli

    You need to edit the NBT of the spawner for it.
     
  5. Offline

    Aephout14

Thread Status:
Not open for further replies.

Share This Page