Jump to content

Get all items like getting all entities with "LivingEvent.LivingUpdateEvent"


MrKirby

Recommended Posts

I'm new to modding and been trying some stuff. 

I'd like to find all items on the ground. I've tried the "LivingEvent.LivingUpdateEvent" but that only works for Entities like Cows and Players etc. (Or it looks like).

How would I 'cycle' through all items on the ground?

Also, I have a list of all events with the list: forgeevents.html but I can't find other documentation about items or blocks, is there something I'm missing?

 

 

Link to comment
Share on other sites

8 minutes ago, diesieben07 said:

There is no update event for item entities. What exactly are you trying to achieve?

What kind of documentation are you looking for? The JavaDoc is usually your best bet, if it's not found in the documentation page.

Thanks for the fast reply. Let's say I want to convert all dirt blocks (items) to diamonds, how would I do that? 

It works with the event: "EntityEvent.CanUpdate" but this event is triggered when the items are within an unloaded chunck it looks like. (When flying away ~200 blocks, it works...)

 

I've seen the documentation page, but, and no offense, it isn't very rich in docs... I cannot find anything about Classes and functions within them. The only way to find them is the unpacked version of Forge within eclipse where I can view all classes and their functions...

Edited by MrKirby
Link to comment
Share on other sites

2 minutes ago, diesieben07 said:

When exactly do you want them to be converted? All the time?

No, it's more something to learn modding, just doing random stuff and understanding what exactly I'm doing. 

I understand doing this all the time isn't a great Idea and for the whole world isn't either.

 

So would you recommend if, let's say, I want to do it for all dirt items within 10 blocks, to make a loop and subtract the x, z from the item with the player and check that?

5 minutes ago, diesieben07 said:

you can even let it generate the HTML-Javadoc if you want to

How would I do this? I can't find anything about this in the documentation. Would that maybe be a good thing to add or am I just blind?

Link to comment
Share on other sites

19 minutes ago, diesieben07 said:

World#getEntitiesWithinAABB

7 minutes ago, diesieben07 said:

This is outside the scope of the Forge documentation since it is general Java knowledge and not specific to Forge.

Not to start a discussion but how would one find "World#getEntitiesWithinAABB", because I cannot find documentation that would point me in the direction of this. Only now I know it exists...

You say it's outside of the scope of the Forge documentation but these classes and everything are made 'by' forge, right? Shouldn't functions and classes be explained somewhere?

 

Once again, I don't want to start a discussion or anyhting. I am mostly a web developer (PHP, JS, jQuery, MySQL etc.) and I'm kinda used to sites that explain all functions and classes available.

 

 

Edited by MrKirby
Link to comment
Share on other sites

1 minute ago, diesieben07 said:

It's not Forge's job to teach you the basics of Java programming

I do not mean the basics of Java programming, I mean the classes like "World" and functions like "getEntitiesWithinAABB" to be explained. But as I understand, it is up to the modders to know where to look, which is fair as this is a free platform. 

 

Thanks for answering!

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.