MyMobs [Easy to code?]

Discussion in 'Plugin Requests' started by Thejust219, Mar 14, 2015.

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


    So I would like a tiny, tiny, plugin that basically makes it so that if you spawn the HOSTILE mob, it won't attack you, and you only

    For example:
    *spawn 1 creeper* blows up other players, not you, and doesn't hurt you (you dont lose health)
    *spawn 1 skeleton* shoots other players, not you, and only hurts them.

    none needed!

    none needed!
  2. Offline


    @Thejust219 Remove Easy to code from your title please. Custom mob AI is not easy.
    Kilorbine and Huffmanbran like this.
  3. Offline


    @pie_flavor This is not AI, this is extremely easy to code, EntityTargetLivingEntityEvent simply cancel the event if the target player is you, then for other players leave it, this could take like 5 minutes to code, for any experienced developer. So this guy can leave the title in here.
    Thejust219 and Kilorbine like this.
  4. Offline


  5. Offline


  6. Offline


    I'll do this

    Edit: Couldn't figure out how to stop the mod attacking the player who spawned it.

    I have this for anyone who might want to use it(Not sure if it would even work).
    Code (open)
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.EntityType;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.CreatureSpawnEvent;
    import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
    public class MobOwner extends JavaPlugin implements Listener {
        public void onCreatureSpawn(CreatureSpawnEvent event) {
            final Entity e=event.getEntity();
            Player spawner=null;
            if(spawner != null &&
                    e.getType() == EntityType.SKELETON ||
                    e.getType() == EntityType.CREEPER  ||               
                    e.getType() == EntityType.WITHER ||
                    e.getType() == EntityType.ZOMBIE ||
                    e.getType() == EntityType.SKELETON ||
                    e.getType() == EntityType.PIG_ZOMBIE ||
                    e.getType() == EntityType.SPIDER ||               
                    e.getType() == EntityType.CAVE_SPIDER ||
                    e.getType() == EntityType.BLAZE ||
                    e.getType() == EntityType.SKELETON ||
                    e.getType() == EntityType.ENDERMAN ||
                    e.getType() == EntityType.GHAST ||
                    e.getType() == EntityType.WITCH ||
                    e.getType() == EntityType.SILVERFISH ||
                    e.getType() == EntityType.IRON_GOLEM &&
                    ((CreatureSpawnEvent) e).getSpawnReason() == SpawnReason.EGG) {
    Last edited: Mar 20, 2015
  7. Offline


    Do you want the effects to persist after server restarts or no? If not i could make this in 5 minutes.
  8. Offline


    @aaomidi I would like the mob to die if the player dies, like somewhat of a connection, does that make sense?
Thread Status:
Not open for further replies.

Share This Page