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

Is there a way to detect a item entity that is spawned into the world? 

For example,there is a dirt block onto the flaw, id like to be able to detect that.

 

Yes, exactly which method you want depends on what you are trying to do.

1 hour ago, logan121 said:

there is a dirt block onto the flaw

And I do not understand what you are trying to do.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

If there is a item entity (dirt) on the floor, i need to be able to detect it somehow.

 

From what context? Do you want any dirt items any where in the world? Only around the player? Above a certain block?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Sorry for the lack of detail.

Above a certain block (lava) would be ideal. 

Presumably its about to contact the lava, which means it will take damage, and die.

Both of which are detectable events.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

What would I put in the if statement? I thought itd be ItemEntity, but thats not there if im doing e.ItemEntity?

 

@SubscribeEvent
public void onEntityJoinWorld(EntityJoinWorldEvent e) {
    if()
}

Edited by logan121

Event.getEntity() then check if the entity is an instance of ItemEntity.

  • Author

java: cannot find symbol
  symbol:   method getEntity()
  location: class net.minecraftforge.fml.common.eventhandler.Ev

 

@SubscribeEvent
public void onEntityConstruct(EntityJoinWorldEvent e) {
    if (e != null) return;

    Event.getEntity();
    
    }

ent

3 minutes ago, logan121 said:

Event.getEntity();

Sorry, I meant this:

e.getEntity()

 

  • Author
2 minutes ago, Danebi said:

Sorry, I meant this:


e.getEntity()

 



Sorry to be a pain, but i end up getting the same error

 

@SubscribeEvent
public void onEntityJoinWorld(EntityJoinWorldEvent e) {
    if (e != null) return;

    e.getEntity();
    }

 

 

java: cannot find symbol
  symbol:   method getEntity()
  location: variable e of type net.minecraftforge.event.entity.EntityJoinWorldEvent

 

  • Author
4 minutes ago, Beethoven92 said:

if (e != null) return;

Whats the point of this line? Also, which forge version are you using?

Just making sure no crashes occur, and im using 1.8.9.

Guest
This topic is now closed to further replies.

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.