Entity block spawning problem

Discussion in 'Spigot Plugin Development' started by Nosmakos, May 23, 2016.

  1. Hello. I have made an event so i can block entities for getting spawned by the config its working i can't place the entities and i don't see anywhere those entities but some times if i go in some places i see the entities i was blocked to getting spawned and i have a command that i can kill all the alive entities but it keeps doing that the entities i blocked are not like enough like everywhere but 1/2 for example cow (i have more than 10 entities blocked)
    this is the event
    Code (Text):
        @EventHandler
        public void onCowSpawn(EntitySpawnEvent e){
            if (plugin.getConfig().getBoolean("Block.Cow")) {
                if(e.getEntity() instanceof Cow){
                    e.setCancelled(true);
                }
            }
        }
    the thing is the only thing i see some times it's cow,pig and some times sheep the others i have blocked are 100% blocked like skeletons i never seen a skeleton or a wolf or slime (Superflat) you think i have to check for more things or spigot/type of game just spawn them for some reason?
     
  2. Hmm, try the CreatureSpawnEvent
     
  3. this is the first i tried and it was the same so i changed it to EntitySpawnEvent and it does the same and this is really weird.
     
  4. Do you have any other plugins that could possibly be uncanceling the event? Might be worth a shot to set your event handlers priority to HIGHEST to see if it makes a difference.
     
  5. hmmm no i don't because it's a test server i have at least 6 plugins and all of them have lot of difference. Okay i will try to do that and i will tell you.
    If anyone has other ideas i would appreciate it!
     
  6. If you have Multiverse; try removing it.
     
    • Agree Agree x 2
  7. i have Multiverse-Core, MassiveCore, Multiverse-Inventories, MultiWorld-Money
    you think multiverse-core can do that?
     
  8. Yes; highly possible.
     
    • Agree Agree x 2
  9. hmmm and if i delete it how i can go or create other worlds ? :/
     
  10. Try using event priorities; or you can just do:

    /mv modify (worldname) set animals false

    /mv modify (worldname) set monsters false
     
  11. so you think HIGHEST priority can protect me from the massive-core?
    well if if i block entities by there zombies will still spawning ? because i haven't blocked that