Jump to content

Betterjakers

Members
  • Posts

    39
  • Joined

Everything posted by Betterjakers

  1. My last post was deleted and I am not sure why. Did I break the rules? Anyway, I'll post it here again in case it was an accident. I have my EventHandler and my WorldSavedData classes. Now, how do I save my variables from my class called Test.java? Thanks for any help given!
  2. Thanks you so much everyone, I got everything I wanted to done!
  3. Thanks! I did have the event bus in the wrong place. It now works. Now, how can I send a message to the killer?
  4. I changed it to EntityZombie but when a zombie dies, it does not say "Hello!" in console.
  5. What? In my main mod class, this is where I have it: public static void init1( FMLInitializationEvent event ) { MinecraftForge.EVENT_BUS.register(new SoundHandler()); MinecraftForge.EVENT_BUS.register(new Test()); }
  6. I did this, and it does not seem to work. I registered it to the event bus, so it should be working. Here is my class: package mymod.quests; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDeathEvent; public class Test { @ForgeSubscribe public void onEntityDeath(LivingDeathEvent event) { if(event.entityLiving instanceof EntityPlayer) { System.out.println("Hello!"); } } }
  7. I did not register it to the forge event bus. How can I do that?
  8. Alright, thanks! Would this work? @ForgeSubscribe public void onEntityDeath(LivingDeathEvent event) { if(event.entityLiving instanceof EntityZombie) { System.out.println("Hello!"); } }
  9. Hello! Does anyone know how to test for when a players kills a zombie? You're gonna hate me, I'm sorry, but I am on 1.6.4 :'(
  10. 1.6.4. I'll probably get no help
  11. Hello! I am trying to add a sound, but cannot seem to get it to work. I right click the iPod, but do not hear the "ipodsong" sound. The sound is at src/assets/mymod/sound. It is named "ipodsong.ogg". Here is my code:
  12. I found out how to add the message and send a random one. Thanks for your help.
  13. I found out how to add the message and send a random one. Thanks for your help.
  14. Alright, I found out how to add it. Now, is there a way I can say a random message instead of just that one? Ex: It will run only ONE of these messages: "Hi!", "Wow!", "Cool!", "Nice!", etc.
  15. Alright, I found out how to add it. Now, is there a way I can say a random message instead of just that one? Ex: It will run only ONE of these messages: "Hi!", "Wow!", "Cool!", "Nice!", etc.
  16. I'm on version 1.6.4. Is there anyway to send a message when I click (Left or right) the item? I would really like to use this, so all the help is appreciated.
  17. I'm on version 1.6.4. Is there anyway to send a message when I click (Left or right) the item? I would really like to use this, so all the help is appreciated.
  18. Hello! I am trying to send a chat message when someone clicks on the item. Here is my code. I tried to add a message, but it did not work. [embed=425,349]package mymod.items; import java.awt.Event; import java.util.Random; import org.lwjgl.input.Keyboard; import com.google.common.eventbus.Subscribe; import mymod.Main; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.common.network.Player; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class MyItem extends Item { private String texturePath = "mymod:"; public MyItem(int ItemID, String textureName) { super(ItemID); this.setUnlocalizedName(textureName); this.setCreativeTab(CreativeTabs.tabMaterials); texturePath += textureName; } public void onItemUse(EntityPlayer entityplayer) { entityplayer.addChatMessage("Welcome"); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(texturePath); } }[/embed]
  19. Hello! I am trying to send a chat message when someone clicks on the item. Here is my code. I tried to add a message, but it did not work. [embed=425,349]package mymod.items; import java.awt.Event; import java.util.Random; import org.lwjgl.input.Keyboard; import com.google.common.eventbus.Subscribe; import mymod.Main; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.common.network.Player; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class MyItem extends Item { private String texturePath = "mymod:"; public MyItem(int ItemID, String textureName) { super(ItemID); this.setUnlocalizedName(textureName); this.setCreativeTab(CreativeTabs.tabMaterials); texturePath += textureName; } public void onItemUse(EntityPlayer entityplayer) { entityplayer.addChatMessage("Welcome"); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(texturePath); } }[/embed]
  20. I am a bit new to this, so I am downright confused. How would I add it to this code? package mymod.structures; import java.util.ArrayList; import java.util.List; import java.util.Random; import mymod.Main; import mymod.dimension.MyDimensionBiome_1; import net.minecraft.block.Block; import net.minecraft.block.BlockQuartz; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; import api.Structure; public class MyStructure_1 extends Structure { public List<BiomeGenBase> biomesToGenIn; public void initStructure() { biomesToGenIn = new ArrayList<BiomeGenBase>(); //Generation biomesToGenIn.add(Main.MyDimensionBiome_1); //biomesToGenIn.add(BiomeGenBase.mushroomIsland); setChanceToGenerateInChunk(1); //Schematic setStructureShape (new Object[] { "XX XX", "X X", "XXXXXXX", " QQQQQ ", " GQ QG ", " QQ QQ ", "XXXXXXX", SLICE, "XX XX", "X X", "XXXXXXX", " QQQQQ ", " G G ", " Q Q ", "XXXXXXX", SLICE, "XX XX", "X X", "XXXXXXX", " QQQQQ ", " G G ", " Q Q ", "XXXXXXX", SLICE, "XX XX", "X X", "XXXXXXX", " QQQQQ ", " G G ", " QC EQ ", "XXXXXXX", SLICE, "XX XX", "X X", "XXXXXXX", " QQQQQ ", " GQQQG ", " QQQQQ ", "XXXXXXX", 'X', Main.MyDimensionBlock_1, 'G', Item.ingotGold, 'Q', Block.blockNetherQuartz, 'C', Block.workbench, 'E', Block.enchantmentTable, 'P', Block.flowerPot, }); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { int rotation = random.nextInt(5); float chance = (float)getChanceToGenerateInChunk() / 100F; if (random.nextFloat() <= chance) { int xCoord = (chunkX * 16) + random.nextInt(16); int zCoord = (chunkZ * 16) + random.nextInt(16); int yCoord = getBiomeTopBlock(world, xCoord, zCoord); if (yCoord != -1) { //check if biome is in our list BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); if (biomesToGenIn.contains(biome)) { generateStructure(random, xCoord, yCoord, zCoord, world, rotation); } } } } }
  21. Hello! That did not work. This worked (No errors): Block.blockNetherQuartz I used it in this code: public static ItemStack quartzPillar = new ItemStack(Block.blockNetherQuartz, 1, 2); Using this worked. Though one question, I want to generate this now, also, in a structure, but I need to turn this into a block. Right now, I assume, it is trying to spawn it in the structure as an item, but I need it to spawn as the actual block. Is there any way to do that?
  22. Hello everyone! I am currently making a mod, and am wanting to use a quartz pillar in my recipe. I have found out how to register dyes (Like cocoa beans) but not blocks. Here is the cocoa beans code: public static ItemStack cocoaBeans = new ItemStack(Item.dyePowder, 1, 3); Does anyone know how I could change that into a quartz pillar? I tried changing Item.dyePowder to Block.blockNetherQuartz, but that did not work. EDIT: I would like to add a block, quartz pillar, to my structure. I am currently on 1.6.4. Can anybody help?
×
×
  • Create New...

Important Information

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