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.

MINERGUY67880

Members
  • Joined

  • Last visited

  1. Thank you so much! Im such an idiot
  2. How do I do that? event.entityPlayer.getHeldItem() returns an itemstack.
  3. FMLCommonHandler.instance().bus().register(eventHandler); MinecraftForge.EVENT_BUS.register(eventHandler); That is in pre init. Also, I just did the println test and the event fires but it only works under if(event.action != null && event.action == Action.RIGHT_CLICK_BLOCK) if(event.entityPlayer.getHeldItem() != null && event.entityPlayer.getHeldItem() == new ItemStack(MinerCore.debugItem)) doesn't work though.
  4. So, I'm trying to make a debug item that tells you information about the block you right click with it. I check if the player right clicks a block, then I check if the player is holding the debug item. It is supposed to say the unlocalized name of the item that I right click with the item in chat but it doesn't. My event handler: ChatHandler is a class I made just to make adding chat easier. The event handler is registered too.
  5. How can I change that to make it work?
  6. Will this be sufficient? @EventHandler public void load(EntityJoinWorldEvent EntityPlayer){ System.out.println("A PLAYER JUST JOINED!"); }
  7. What is it called and what class is it from?
  8. Hi, I need my mod to detect if a player just spawned into the world for the very first time so that I could do something like: if (playerJustSpawned = true) { System.out.println("Hey, A player just spawned!") } Is there one that is in the source code or do I have to make one? Please help me out with dis!
  9. Im not sure why I did the +1 for the CurrentY. Heres my new code: //Smoke Spawning Method public void updateTick(World world, int x, int y, int z, Random rand) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity instanceof TileEntityStoneCrusher) { TileEntityStoneCrusher crusher = (TileEntityStoneCrusher) tileEntity; if (crusher.active) { world.setBlock(x, y + 1, z, TechnicCraftCommon.SmokeGasBlock.blockID ); } } }
  10. i put in a system.out.println and it didnt write it in the console. It isn't getting called.
  11. Hi, I am trying to make my stone crusher machine make my smoke gas when it is activated. I am trying to use this code: //Smoke Spawning Method public void updateTick(World world, int x, int y, int z, Random rand) { int CurrentY = y + 1; TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity instanceof TileEntityStoneCrusher) { TileEntityStoneCrusher crusher = (TileEntityStoneCrusher) tileEntity; if (crusher.active) { world.setBlock(x, CurrentY + 1, z, TechnicCraftCommon.SmokeGasBlock.blockID ); } } } But it doesn't work, what am I doing wrong?
  12. Heres my code for the Gas Block file: package miner.miner.technicraft.oceans.blocks; import java.util.Random; import miner.miner.technicraft.oceans.client.gui.creativetabs.TCOceansCreativeTabs; import miner.miner.technicraft.oceans.TechnicCraftOceans; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.EntityLiving; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; public class BlockGasSteam extends BlockFluidFinite { public String texture; public BlockGasSteam(int id, String key, Fluid fluid) { super(id, fluid, Material.water); this.texture = key; this.setCreativeTab(TCOceansCreativeTabs.blocksTab); fluid.setBlockID(this); setUnlocalizedName(key); } @Override public void registerIcons(IconRegister register) { blockIcon = register.registerIcon(TechnicCraftOceans.modID + ":" + texture); getFluid().setIcons(blockIcon); } @Override public int colorMultiplier(IBlockAccess world, int x, int y, int z) { return 0xaaaaaa; } public void updateTick() { if (par1World.getBlockId(par2, par3 + 1, par4) == 0 && par3 <= 255) { par1World.setBlock(par2, par3 + 1, par4, BlockGasSteam); par1World.setBlock(par2, par3, par4, 0); } } } I am getting errors on par1World, par2, par3, par4 then the other par3 and just about everything else! Is there anything I need to change or move? Or do i just need to add ints/variables?

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.