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 just creat a block which works like the minecraft lightning rod.

i use to detcet if a lightning is strik the entity join world event but i got an error (null but i dont know where and why null):

code:

https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/events/entity/OnEntityJoinWorldEvent.java

log:

https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/events/entity/player/Error Log

Edited by Luis_ST

it's not a Null Pointer Exception (no clue where you got the idea that it was...) it's an Stack Overflow Error. that usually means that you have a funcion that is forever calling itself, in an endless recursive loop. if you look at the log it tells you exactly what function is being called: OnEntityJoinWorldEvent#EntityJoinWorld()

that event handler calls World#addEntity, but whenever an entity is added to the world, it fires the EntityJoinWorldEvent (an you're listening to that event and calling World#addEntity... see the loop?)

  • Author
1 minute ago, kiou.23 said:

funcion that is forever calling itself

ย 

2 minutes ago, diesieben07 said:

you that you are being an idiot.

i understand when i check if the lightning is add i canceled the event and add a new lightning

question: when i change the pos of the lightning the event will not called again?

  • Author
1 minute ago, diesieben07 said:

EntityJoinWorldEvent is fired for any entity joining the world, regardless of position.

i just test it with setPositionAndUpdate and it works

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.