Most efficient way to check if a magmacube touches a slime?

Discussion in 'Spigot Plugin Development' started by Simo389, Jun 1, 2015.

  1. So I need to run some code when a MagmaCube touches a Slime.

    Initially I thought the best way to check this is when a magmacube does damage to the slime on contact, as it does to a player. But magmacubes don't seem to damage slimes at all.

    I've had a look through the JavaDocs:

    But can't work out how to modify a magmacube to do fire damage to a slime on contact, or vice versa for the slime to do damage to the magmacube on contact.

    Any ideas how to do this? I just need to work out when a slime comes into contact with a magmacube - and I'm trying to avoid the PlayerMoveEvent at all costs. I've created the slime using a custom entity extending EntitySlime - so any solutions via this are also an option, I just can't work out how to do it.
  2. I think I know what you are trying to replicate. I was going to do this. Looks like you beat me to it.
    • Like Like x 1
  3. :D
    • Like Like x 1