Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.