Disable Creeper Spawning at daytime

Discussion in 'Plugin Development' started by ZderKi, Jun 14, 2019.

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


    So i tried doing this multiple ways... either of them didnt work, any help please?

    long time = getServer().getWorld("world").getTime();
        @EventHandler(priority = EventPriority.HIGHEST)
        public void onCreatureSpawn(CreatureSpawnEvent event) {
            Entity entity = event.getEntity();
            if(event.getEntityType().equals(EntityType.CREEPER) && time <= 13000) {         
    this is what i've got so far...
  2. Offline


    The issue is that "time" is only set once, outside of the method you are using. Instead, move time into the onCreatureSpawnEvent.
  3. Offline


    tried that... they still will spawn after some time

    nvm i wasnt registering events in onEnable

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 14, 2019
Thread Status:
Not open for further replies.

Share This Page