Set Mob Spawner Delay with no /commands

Discussion in 'Plugin Requests' started by krlsmnk, Nov 12, 2017.

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

    krlsmnk

    I would like a way to modify spawner delay in-game without any /commands, as they are unimmersive and unfun.

    How can I make a consumable item that when Right Clicked on a spawner, it speeds up that spawner's delay without using any text commands?
     
  2. Offline

    MightyOne

    If you are looking for a method you can look here: https://bukkit.org/threads/best-way-to-change-spawner-spawn-rates.397312/
    So you could listen to the PlayerInteractEvent if someone right clicks a spawner.
    Then you could cast getState() of the clicked block to CreatureSpawner.
    Finally you can use spawner.setDelay(spawner.getDelay() + whateverYouWant);

    Is this really a plugin request?
     
  3. Offline

    Tabuu_

    Maybe you would care to take a look at my plugin here.
     
  4. Offline

    krlsmnk

    I like your plugin @Tabuu_ but, unless I'm overlooking something, there isn't a way to level up a spawner without using /commands.

    @MightyOne that thread also directly edits the nbt data via commands. I need this "functionality" hidden or abstracted away from my players. I need a consumable item that can be bought/sold/traded that will upgrade an existing spawner's delay time. This way my players don't have to remember commands and I don't have to manually edit everyone's spawners. They just have to learn where they can purchase the upgrade from (likely my existing server Shopkeepers bazaar).
     
  5. Offline

    Tabuu_

    You CAN user '/spawner upgrade' but when you right click the spawner a GUI will pop up in which you can do the upgrading.
     
  6. Offline

    krlsmnk

    Okay, cool. I'm liking the plugin's way of handling it, and I set it to use XP, which is seems to be calculating correctly.

    I added levels to the config file and successfully leveled up an in-game spawner up tp level 15 with a boost of 35.

    It doesn't seems to be spawning any faster or any additional mobs than the standard spawner, though.
     
  7. Offline

    Tabuu_

    The speed gets aplied after you upgraded the spawner and the spawner spawned once (at still the previouse speed).
    This is because I update the speed of the spawner in the SpawnerSpawnEvent.

    So:
    1. Spawner upgraded.
    2. Spawner spawned mobs (at regular/previouse speed).
    3. Spawner speed gets updated.
     
  8. Offline

    krlsmnk

    I've been stanting here with it for 20 minutes or so and it has produced the same number of spawns (roughly) as the normal spawner in an adjacent area.

    Quick question about your plugin, as I may have found a solution to the problem.

    When I change an existing spawner with a Spawn Egg via your plugin, does it reset or change the nbt data at all (other than spawn type)?

    If it doesn't, I can just have my vendor sell a "Turbo Spawner" with a short delay that my players can retype with a spawn egg.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 13, 2017
  9. Offline

    Tabuu_

    Maybe the spawner multiplier was too small? Anyhow if you right click a spawner with a SpawnEgg it will act like if it was placed against a normal block (so the creature will spawn and the spawner will not be affected).

    This can be disabled in the config.yml tho.

    EDIT:
    Btw a spawner cant possibly spawn more than 20 times in a second.
     
Thread Status:
Not open for further replies.

Share This Page