I've been experimenting with setting an entity on fire when it walks over a block.
I started out using onEntityCollidedWithBlock, but after looking through it some more, it only works when the entity is inside of the block. I then tried using onEntityWalking and onFallenUpon (I prefer onEntityWalking), I was damaged when walking over it, however wasn't set on fire.
Here is the method:
[code][CODE] [/code]
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
{
if (!(entity instanceof EntityItem)) entity.attackEntityFrom(DamageSource.inFire, 1F);
}
I've been experimenting with setting an entity on fire when it walks over a block.
I started out using onEntityCollidedWithBlock, but after looking through it some more, it only works when the entity is inside of the block. I then tried using onEntityWalking and onFallenUpon (I prefer onEntityWalking), I was damaged when walking over it, however wasn't set on fire.
Here is the method:
[code][CODE] [/code]
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
{
if (!(entity instanceof EntityItem)) entity.attackEntityFrom(DamageSource.inFire, 1F);
}
[/CODE]
Any help?
[code] [/code]
Gracias. That fixed everything.
Thanks for the help