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 have find how to detect a tileEntity, but i didn't find to detect all the tileentities in a chunk !

 

Sorry for the spelling mistakes, i am french :)

 

help me my code is : 

package com.mod.ciolmod.init;

import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraftforge.client.event.RenderGameOverlayEvent;

public class InfoOverlay {
		private Minecraft mc = FMLClientHandler.instance().getClient();

		TileEntity biomeString;

		private String fpsString;

		
		
		
		

		@SubscribeEvent

		public void renderGameOverlay(RenderGameOverlayEvent.Post event)

		{	

			int x = MathHelper.floor_double(mc.thePlayer.posX);

			int z = MathHelper.floor_double(mc.thePlayer.posZ);
			

			

			fpsString = mc.debug.split(",", 2)[0];

			biomeString = mc.theWorld.getTileEntity(x, 90, z);



			FMLClientHandler.instance().getClient().fontRenderer.drawStringWithShadow("[Fps] : "+fpsString, 5, 5, 0xffffff);

			FMLClientHandler.instance().getClient().fontRenderer.drawStringWithShadow("Chest : "+biomeString, 5, 25, 0xffffff);

		}
		



}

 

 

 

Sans titrdtfghufdsdftygre.png

Perhaps these methods will point you in the right direction:

World#getChunkFromBlockCoords(BlockPos pos) = Returns the chunk at the given position.

Chunk#getTileEntityMap() = Returns a map of BlockPos to TileEntity; that is, it returns a Map<BlockPos, TileEntity> containing all the loaded tile entities in that chunk.

Edited by IceMetalPunk

Whatever Minecraft needs, it is most likely not yet another tool tier.

  • Author

Thank you, how to get the number of tileentity in the chunk of the player is please ??

Just now, Ciolgaming said:

Thank you, how to get the number of tileentity in the chunk of the player is please ??

You can get a map's size with Map#size() and a player's position with Entity#getPosition().

Whatever Minecraft needs, it is most likely not yet another tool tier.

  • Author

Yes but i dont understand what do yo say, i didn't find where you want to place this, can you modify the code please ??

Edited by Ciolgaming

9 minutes ago, Ciolgaming said:

Yes but i dont understand what do yo say, i didn't find where you want to place this, can you modify the code please ??

I've showed you how to get the player's position, get a chunk from a position, get the tile entity map from a chunk, and get the size of a map. That should be everything you need. Try out the code you think will work, and if it doesn't work, show us the code you've tried and we'll help you further from there.

Whatever Minecraft needs, it is most likely not yet another tool tier.

  • Guest locked this topic
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.