Posted April 13, 201312 yr 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.
April 13, 201312 yr 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...
April 14, 201312 yr 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.
April 14, 201312 yr 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 ლ(́◉◞౪◟◉‵ლ
April 14, 201312 yr 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.
April 14, 201312 yr 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 ლ(́◉◞౪◟◉‵ლ
April 14, 201312 yr Author still too stupid Use examples, i have aspergers. Examples make sense to me.
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.