I'm working on a mod that (among other things) add a wand that launches firebolts. I've used a custom entity instead of a vanilla fireball, and so far, things are working pretty well. There is one problem though: the firebolt dies on contact with tall grass. Does anyone have any idea on how to allow it to pass through tall grass? I would like to prevent breaking the grass if possible.
Check in the entity's onImpact method if it has hit a block of tall grass.
Or any other block whose collision bounding box is null.
Specifically, check this before setting dead -- once you setDead(), your entity cannot continue moving. So add an else-if after the (entity != null) check to see if it hit a block AND that block's bounding box is not null, and if so, return immediately.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
That seems to work. Now for a follow up question: at point blank range, the firebolt seems to hit the caster. It doesnt do any damage, but it immediately dies. how do I fix this? Do I add a check to make sure the hit entity is not the caster? if so, how?