Posted January 29, 20214 yr 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 January 29, 20214 yr by Luis_ST
January 29, 20214 yr 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?)
January 29, 20214 yr 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?
January 29, 20214 yr 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.