Freezing but teleporting mobs?

Discussion in 'Spigot Plugin Development' started by TimeVisualSales, May 23, 2015.

  1. Hi there, how do I make it so that when you freeze a mob, it still teleports it to the player? I've done this code so far:
    Code (Text):
        public void freezeEntity(Entity en){
              net.minecraft.server.v1_8_R2.Entity nmsEn = ((CraftEntity) en).getHandle();
              NBTTagCompound compound = new NBTTagCompound();
              nmsEn.c(compound);
              compound.setByte("NoAI", (byte) 1);
              nmsEn.f(compound);
        }
     
  2. Use a BukkitRunnable and every specific ticks teleport the entity to the player.
     
  3. I did that but it didn't work.
     
  4. You could set your mob the poition effect slowness with an high value. So the mob can't move to anywhere and you can easily teleport him? ^_^
     
  5. Would that work with a bat entity?
     
  6. I think so! :) Just give it a try ^^
     
  7. Ok ;)
     
  8. Okay, doesn't matter:)
     
    #10 Dark4ty, May 24, 2015
    Last edited: May 24, 2015