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 dont know much about entity items but i had a good idea for a mod. so my question is,

Is it possible to make a certain entity item check what block it landed on/is on and then do something?

eg if a rotten flesh lands on a dirt could i put a block of waste on top of the dirt?

if you have seen/done this before any help would be great as it sound quite hard to programme this to me and this has to be done without editing base classes as per always :)

Thankyou!

Use examples, i have aspergers.

Examples make sense to me.

If you have access to the location of the entityItem then I'm not sure how it could be a problem?

 

entityItem extends Entity, so all entityItem's have a XYZ position which you can use.

and every entity has a world which it is inn. What more do you need to know to do what you want to? :)

 

Edit:

 

IF it's an custom item it's sure quite easy to check it's position on update etc.

As for messing with a vanilla entityItem I'm not sure how you could do that easily, my first guess would be reflection and such but there are probably easier ways to do that.

 

If you guys dont get it.. then well ya.. try harder...

  • Author

i just need to know the block underneath itself's type, i should do this with coods too?

if so how?

Use examples, i have aspergers.

Examples make sense to me.

What i suggest is using an entity spawn event, then use entity instanceof entityItem, then if entityItem.itemStack.id-256 = rottenflesh.id, then convert the items position to an int, check if the block at that position-1 is grass, then replacing it.

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

  • Author

ok so  im not to great with java atm but i found this

 

http://linode.narc.ro/forge-javadoc/net/minecraftforge/event/entity/living/LivingSpawnEvent.html

 

but i dont know how to use it :/

 

An example would be most helpful but i can understand if you don't want to provide one as some people think it is you writing my mod for me, as  i have been told before :)

Use examples, i have aspergers.

Examples make sense to me.

Step 1: Make a new class

Step 2: Extend the event class that has the method your looking for (all of them are in minecraftforge.events)

Step 3: Override the method your looking for

Step 4: in your main class, in init put minecraftforge.registerEventBus

 

Also I think you may want to do an entity update , then check if it's on the ground, then check the rest

 

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

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.