Entities Disappearing?

Discussion in 'Plugin Development' started by MrTwiggy, Feb 20, 2013.

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


    I've tried debugging but am stumped. Essentially, I have a location that I occassionally update, and when I do, I move the Entity to the same location with the setLocation(x, y, z). It works, however normally after a few ticks of spawning the entity and moving it, it stops and then disappears. Here is essentially the code:

    entity = ((CraftEntity)this.location.getWorld().spawnEntity(this.location, EntityType.SNOWBALL)).getHandle();
    entity.setLocation(location.getX(), location.getY(), location.getZ(), 0, 0);
    The code before the ... is run once to spawn it, then the code after the ... is run once every tick with a new location. It works and moves them properly usually for a few ticks, but then the entity will stop being teleported (it's still alive and setting the position), then it will disappear.
  2. Offline


    Try to run it not every tick, but every 5 ticks, for example. It's still 4 times/sec, so it shouldn't be a problem.
Thread Status:
Not open for further replies.

Share This Page