Jump to content

MINERGUY67880

Members
  • Posts

    44
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    USA
  • Personal Text
    Making mods since 2013!

MINERGUY67880's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. How do I do that? event.entityPlayer.getHeldItem() returns an itemstack.
  2. 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.
  3. 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.
  4. Will this be sufficient? @EventHandler public void load(EntityJoinWorldEvent EntityPlayer){ System.out.println("A PLAYER JUST JOINED!"); }
  5. 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!
  6. 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 ); } } }
  7. i put in a system.out.println and it didnt write it in the console. It isn't getting called.
  8. 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?
  9. 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?
×
×
  • Create New...

Important Information

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