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

Hello Guys! :)

 

I'm quiet new in modding, but I do know how to work in java.

 

So, my problem: I'm summoning and launching a Pig with a custom Item, it's working, so far so good.

Now, I want the Pig to explode as soon as it touches the ground. The thing is, I don't know which Event Handler to use and I don't know how to blow up just the SPECIFIC newly summoned Pig, because Handlers are working for all kinds of entities which are touching the ground.

 

Or maybe it's a dumb idea to use Handlers for executing stuff when a specific pig lands on the ground?

I hope you can tell me some ideas or show me some real code.

 

With regards.

Merphin

  • Author

To keep track of a specific entity attach an IExtendedEntityProperties to it. Then you can use LivingFallEvent to do stuff while that specific pig falls.

 

should I implement this interface you named in the class of the item which launches the pigs (summons them in the players facing direction)? or should i create a sub-class of EntityPig and implement this interface?

 

Thank you for your quick answer! :)

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.