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

  • Author

What would I put for the first and second parameter, is it the entity I am checking for and the chunk or something?

  • Author

I get an error under "getEntitiesWithinAABB" when using this.worldObj.getEntitiesWithinAABB(this, getBoundingBox()) >= 3

  • Author

Okay sorry, it's just that there was no getEntitiesOfTypeWithinAABB method, and it only had 2 parameters so I have now done this and I have no errors but it crashes:

 

private boolean entityLimit() {

 

if(worldObj.getEntitiesWithinAABB(EntityBlockCoal.class, getBoundingBox()) != null) {

 

return false;

 

}

 

return true;

 

}

  • Author

Oh, would I have to use the ChunkData event like this or something similar then get the chunk from it?

 

@SubscribeEvent

private void chunkDataEvent(ChunkDataEvent event) {

 

event.getChunk();

 

}

  • Author

I'm sorry about this, I'm just fairly new to modding still.

 

I have changed it to this:

 

private boolean entityLimit(World world) {

 

if(world.getChunkFromBlockCoords(serverPosX, serverPosZ).worldObj.getEntitiesWithinAABB(EntityBlockCoal.class, getBoundingBox()) != null) {

 

return false;

 

}

 

return true;

 

}

  • Author

Never mind then, I'm not understanding so am going to do some research and try again at a later date. Thanks for the help anyway.

 

Edit: I got to this but I'm not sure what to do with the list, but its probably wrong anyway:

 

if(Chunk.getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), List, null) != null) {

 

return false;

 

}

 

return true;

 

}

  • Author

Okay I have done that but I still get an error saying I need to cast the list.

 

List entityList = new List();

 

if(Chunk.getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null)) {

 

return false;

 

}

  • Author

I now get an error under:

 

Chunk.getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null)

 

With no suggestions.

 

  • Author

world.getChunkFromBlockCoords(serverPosX, serverPosZ).getEntitiesOfTypeWithinAAAB(EntityBlockCoal.class, getBoundingBox(), entityList, null)

 

So more something like that?

Sorry, it is saying I can't convert from void to boolean.

 

qpwoeiruty, all of your questions in this thread seem to be from not understanding Java fully.  It is okay that you're a beginning programmer (everyone has to start somewhere), but your questions really aren't about modding they are about Java.  You didn't know how to call a method, you didn't know about static methods, you didn't know about casting, and now you don't know about return values.  You should really just learn more Java.  There are plenty of online references, but I also suggest having a very good book that is easy to read called: Java In Easy Steps.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.