Mobs repulsion

Discussion in 'Plugin Development' started by Meldren, Feb 2, 2019.

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

    Meldren

    Hello, i need in help. I want to create mobs repulsion when mob in the mob or player, repulsion only for mobs(1.8.8 version). Example in this video, time code: 3:00


    Thanks for helping
     
  2. Offline

    Chr0mosom3

    @Meldren, I am assuming that you do not want mobs to be pushed back when you punch them.


    From here I don't really understand if you want a plugin or code but I am going to assume that you want the code. If you want a plugin that you can download then just let me know by replying and I will post you it, even tho it should be in the plugins idea section.

    If you were to code it should look more or less like this:
    Code:
    @EventHandler
    public void onDamageEvent(EntityDamageEvent e){
        if (e.getEntity() instanceof Player){ return; } // If the entity is a player then end the event
        e.getentity().setVelocity(0);
    }
    That should work, as far as I know, try it for yourself.



    And again, if you want me to give you a downloadable plugin then just ask, I am pretty new to Bukkit and would be happy to try doing something for you! ;)
     
Thread Status:
Not open for further replies.

Share This Page