dwinget2008 Posted January 29, 2016 Share Posted January 29, 2016 I am trying to make a block that helps players but hurts everything else. I have looked around and haven't found an answer to this and I am sure that someone else has com across this issue. Here is a copy of the code: http://pastebin.com/xHNiyzuQ And here is the copy of the crash that I get: http://pastebin.com/WvxhM3aw This only happens if my block has an effect that is being applied to the mob. If there is not effect then it is ok. Thoughts? Quote Link to comment Share on other sites More sharing options...
coolAlias Posted January 29, 2016 Share Posted January 29, 2016 Well, the parameter if the method is of type Entity, yet you blindly cast to EntityLiving: } else{ ((EntityLiving)entity).attackEntityFrom(DamageSource.wither, 1.0F); } And, as you can see in the crash report, there are all sorts of other entities that might be colliding with the block: java.lang.ClassCastException: net.minecraft.client.particle.EntityBreakingFX cannot be cast to net.minecraft.entity.EntityLiving Always perform a type check (e.g. instanceof) before casting to a new type. Quote http://i.imgur.com/NdrFdld.png[/img] Link to comment Share on other sites More sharing options...
dwinget2008 Posted January 30, 2016 Author Share Posted January 30, 2016 Thanks. I will make sure not to do that again. Great full for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.