Jump to content

chiyin00

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by chiyin00

  1. Hi, I made a mod that works fine in client but when I load it in a Cauldron Server It crashes, I looked at the crash report and I think the problem is the armor prefix Here's the crash report: http://pastebin.com/hXkSpET9 and here's my mod's main class: http://pastebin.com/SZbMFnkv Please help guys
  2. I would like to use keybinding to open my gui. I could see my KeyBinding in the setting but when I press P it does not pop the GUI out. This is what I've done: Main Class: @EventHandler public void postInit(FMLPostInitializationEvent event) { KeyBindingRegistry.registerKeyBinding(new KeyBindingHandler()); KeyBindingHandler class: public class KeyBindingHandler extends KeyHandler { public KeyBindingHandler() { super(arrayOfKeys, areRepeating); } public static KeyBinding test = new KeyBinding("SAO", Keyboard.KEY_P); public static KeyBinding[] arrayOfKeys = new KeyBinding[] {test}; public static boolean[] areRepeating = new boolean[] {false}; public Minecraft mc; @Override public String getLabel() { return "Test KeyBinding"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { mc.displayGuiScreen(new YourGui()); } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { } @Override public EnumSet<TickType> ticks() { return null; } } My Test GUI class: public class YourGui extends GuiScreen{ private GuiScreen parentScreen; public void initGui() { } public void drawScreen(int par1, int par2, float par3) { drawDefaultBackground(); super.drawScreen(par1,par2,par3); } } Please help guys
  3. I made a custom armor but Minecraft crashed after I clicked on the creative tab that the armor is in. Here's the armor package com.chiyin.FractureiTem.armor; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import com.chiyin.FractureiTem.FractureiTem; public class armor1 extends ItemArmor{ private String [] armourTypes = new String [] {"helmet1", "chestplate1", "leggings1", "boots1"}; public armor1(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { super(p_i45325_1_, p_i45325_2_, p_i45325_3_); } @Override public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String layer){ if(itemstack.getItem().equals(FractureiTem.helmet1)|| itemstack.getItem().equals(FractureiTem.chestplate1)|| itemstack.getItem().equals(FractureiTem.boots1)){ return "chiyin:textures/armor/armor1_1.png"; } if(itemstack.getItem().equals(FractureiTem.leggings1)){ return "chiyin:textures/armor/armor1_2.png"; } else return null; } @Override public void registerIcons(IIconRegister reg){ if(this == FractureiTem.helmet1) this.itemIcon = reg.registerIcon("chiyin:helmet1"); if(this == FractureiTem.chestplate1) this.itemIcon = reg.registerIcon("chiyin:chestplate1"); if(this == FractureiTem.leggings1) this.itemIcon = reg.registerIcon("chiyin:leggings1"); if(this == FractureiTem.boots1) this.itemIcon = reg.registerIcon("chiyin:boots1"); } } Here's the core file public static Item helmet1 = new armor1(ItemArmor.ArmorMaterial.CLOTH, 5, 0).setCreativeTab(FractureiTemTabArmor); public static Item chestplate1 = new armor1(ItemArmor.ArmorMaterial.CLOTH, 5, 0).setCreativeTab(FractureiTemTabArmor); public static Item leggings1 = new armor1(ItemArmor.ArmorMaterial.CLOTH, 5, 0).setCreativeTab(FractureiTemTabArmor); public static Item boots1 = new armor1(ItemArmor.ArmorMaterial.CLOTH, 5, 0).setCreativeTab(FractureiTemTabArmor); GameRegistry.registerItem(helmet1, "helmet1"); GameRegistry.registerItem(chestplate1, "chestplate1"); GameRegistry.registerItem(leggings1, "leggings1"); GameRegistry.registerItem(boots1, "boots1"); RenderingRegistry.addNewArmourRendererPrefix("5"); and last, the crash report ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 14年6月27日 下午3:33 Description: Rendering item java.lang.NullPointerException: Rendering item at net.minecraft.client.renderer.entity.RenderItem.renderIcon(RenderItem.java:733) at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:493) at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560) at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:291) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118) at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:672) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1145) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1024) at net.minecraft.client.Minecraft.run(Minecraft.java:912) at net.minecraft.client.main.Main.main(Main.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.client.renderer.entity.RenderItem.renderIcon(RenderItem.java:733) at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:493) -- Item being rendered -- Details: Item Type: com.chiyin.FractureiTem.armor.armor1@1e3b094 Item Aux: 0 Item NBT: null Item Foil: false Stacktrace: at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:560) at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:291) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:118) at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:672) -- Screen render details -- Details: Screen name: net.minecraft.client.gui.inventory.GuiContainerCreative Mouse location: Scaled: (192, 45). Absolute: (385, 388) Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2 -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player187'/370, l='MpServer', x=-19.98, y=82.62, z=329.29]] Chunk stats: MultiplayerChunkCache: 224, 225 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (-20,64,256), Chunk: (at 12,4,0 in -2,16; contains blocks -32,0,256 to -17,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 210942 game time, 108686 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 125 total; [EntityBat['Bat'/275, l='MpServer', x=32.53, y=29.57, z=397.25], EntityZombie['Zombie'/274, l='MpServer', x=46.50, y=31.00, z=399.50], EntityPig['Pig'/273, l='MpServer', x=45.50, y=76.00, z=374.31], EntityCreeper['Creeper'/272, l='MpServer', x=39.00, y=53.00, z=381.56], EntitySkeleton['Skeleton'/283, l='MpServer', x=51.50, y=14.00, z=252.50], EntityPig['Pig'/287, l='MpServer', x=56.50, y=71.00, z=269.31], EntityPig['Pig'/286, l='MpServer', x=55.94, y=71.00, z=266.97], EntityPig['Pig'/258, l='MpServer', x=37.66, y=66.00, z=279.47], EntityPig['Pig'/259, l='MpServer', x=42.34, y=69.00, z=274.47], EntitySkeleton['Skeleton'/262, l='MpServer', x=50.30, y=36.00, z=298.70], EntitySkeleton['Skeleton'/263, l='MpServer', x=44.53, y=41.00, z=295.88], EntityZombie['Zombie'/260, l='MpServer', x=50.47, y=42.00, z=299.03], EntityZombie['Zombie'/261, l='MpServer', x=47.50, y=41.00, z=298.50], EntityBat['Bat'/266, l='MpServer', x=25.09, y=37.00, z=313.03], EntityZombie['Zombie'/267, l='MpServer', x=42.91, y=55.00, z=347.31], EntityCreeper['Creeper'/264, l='MpServer', x=47.13, y=41.00, z=302.22], EntityBat['Bat'/265, l='MpServer', x=36.75, y=46.10, z=310.53], EntityPig['Pig'/270, l='MpServer', x=43.50, y=73.00, z=362.69], EntityZombie['Zombie'/271, l='MpServer', x=39.00, y=31.00, z=379.56], EntityPig['Pig'/268, l='MpServer', x=35.47, y=72.00, z=336.56], EntityBat['Bat'/269, l='MpServer', x=28.16, y=47.26, z=364.50], EntityBat['Bat'/288, l='MpServer', x=51.94, y=39.10, z=281.47], EntityBat['Bat'/289, l='MpServer', x=54.25, y=42.10, z=294.38], EntityZombie['Zombie'/290, l='MpServer', x=56.84, y=38.00, z=303.84], EntitySpider['Spider'/291, l='MpServer', x=54.72, y=40.00, z=307.81], EntityBat['Bat'/292, l='MpServer', x=60.69, y=38.39, z=302.50], EntityBat['Bat'/294, l='MpServer', x=47.63, y=23.23, z=350.69], EntityPig['Pig'/295, l='MpServer', x=59.94, y=71.00, z=341.53], EntityChicken['Chicken'/296, l='MpServer', x=58.47, y=82.00, z=383.47], EntitySpider['Spider'/297, l='MpServer', x=49.50, y=54.00, z=396.50], EntityZombie['Zombie'/298, l='MpServer', x=55.50, y=57.00, z=395.50], EntityCreeper['Creeper'/299, l='MpServer', x=58.50, y=60.00, z=386.50], EntitySkeleton['Skeleton'/300, l='MpServer', x=59.50, y=60.00, z=385.50], EntityBat['Bat'/301, l='MpServer', x=47.50, y=54.85, z=394.31], EntitySpider['Spider'/303, l='MpServer', x=50.34, y=61.00, z=402.72], EntityBat['Bat'/100, l='MpServer', x=-98.72, y=16.10, z=337.00], EntityZombie['Zombie'/99, l='MpServer', x=-99.50, y=51.00, z=312.50], EntitySheep['Sheep'/106, l='MpServer', x=-97.19, y=71.00, z=387.50], EntityBat['Bat'/104, l='MpServer', x=-99.13, y=14.92, z=381.84], EntityBat['Bat'/105, l='MpServer', x=-94.47, y=17.16, z=403.75], EntityBat['Bat'/117, l='MpServer', x=-87.50, y=11.82, z=402.03], EntityBat['Bat'/116, l='MpServer', x=-85.53, y=12.33, z=410.75], EntitySheep['Sheep'/115, l='MpServer', x=-86.50, y=71.00, z=393.19], EntityZombie['Zombie'/114, l='MpServer', x=-98.06, y=38.00, z=329.41], EntityBat['Bat'/113, l='MpServer', x=-81.53, y=14.98, z=263.66], EntityZombie['Zombie'/112, l='MpServer', x=-87.78, y=15.00, z=281.28], EntityZombie['Zombie'/127, l='MpServer', x=-76.78, y=59.00, z=283.47], EntityZombie['Zombie'/126, l='MpServer', x=-76.19, y=59.00, z=282.91], EntityZombie['Zombie'/125, l='MpServer', x=-79.59, y=57.00, z=294.63], EntityZombie['Zombie'/124, l='MpServer', x=-75.88, y=58.00, z=287.84], EntityPig['Pig'/123, l='MpServer', x=-75.19, y=72.00, z=270.78], EntityBat['Bat'/141, l='MpServer', x=-54.41, y=35.76, z=253.69], EntityBat['Bat'/142, l='MpServer', x=-55.69, y=35.00, z=253.44], EntityZombie['Zombie'/129, l='MpServer', x=-78.50, y=59.00, z=276.50], EntityZombie['Zombie'/128, l='MpServer', x=-78.50, y=59.00, z=279.50], EntityPig['Pig'/131, l='MpServer', x=-69.69, y=71.00, z=325.47], EntityPig['Pig'/130, l='MpServer', x=-75.16, y=78.00, z=296.03], EntityZombie['Zombie'/133, l='MpServer', x=-72.53, y=30.00, z=391.03], EntityPig['Pig'/132, l='MpServer', x=-77.38, y=63.00, z=343.78], EntityZombie['Zombie'/135, l='MpServer', x=-67.47, y=30.00, z=391.94], EntityZombie['Zombie'/134, l='MpServer', x=-75.50, y=31.00, z=386.50], EntityCreeper['Creeper'/152, l='MpServer', x=-62.50, y=35.00, z=348.50], EntityZombie['Zombie'/153, l='MpServer', x=-63.44, y=35.00, z=348.03], EntityZombie['Zombie'/154, l='MpServer', x=-68.06, y=39.00, z=345.50], EntityPig['Pig'/155, l='MpServer', x=-60.16, y=64.00, z=345.78], EntitySkeleton['Skeleton'/156, l='MpServer', x=-58.63, y=44.00, z=362.31], EntityCreeper['Creeper'/157, l='MpServer', x=-58.00, y=39.00, z=364.50], EntityPig['Pig'/158, l='MpServer', x=-53.88, y=65.00, z=360.22], EntityPig['Pig'/144, l='MpServer', x=-54.78, y=70.00, z=263.47], EntityPig['Pig'/145, l='MpServer', x=-51.91, y=72.00, z=270.22], EntityClientPlayerMP['Player187'/370, l='MpServer', x=-19.98, y=82.62, z=329.29], EntityPig['Pig'/146, l='MpServer', x=-54.81, y=72.00, z=268.47], EntityPig['Pig'/147, l='MpServer', x=-56.97, y=75.00, z=294.47], EntityPig['Pig'/148, l='MpServer', x=-49.78, y=67.00, z=307.50], EntitySkeleton['Skeleton'/149, l='MpServer', x=-53.50, y=34.00, z=334.50], EntityZombie['Zombie'/150, l='MpServer', x=-58.50, y=36.00, z=330.50], EntityPig['Pig'/151, l='MpServer', x=-65.50, y=69.00, z=325.31], EntityCreeper['Creeper'/171, l='MpServer', x=-34.66, y=61.00, z=340.00], EntityPig['Pig'/170, l='MpServer', x=-34.69, y=69.00, z=336.47], EntityPig['Pig'/169, l='MpServer', x=-41.84, y=70.00, z=304.03], EntityPig['Pig'/168, l='MpServer', x=-42.88, y=67.00, z=286.13], EntitySquid['Squid'/173, l='MpServer', x=-35.66, y=62.34, z=370.50], EntityPig['Pig'/172, l='MpServer', x=-42.19, y=66.00, z=354.16], EntityPig['Pig'/167, l='MpServer', x=-34.22, y=70.00, z=252.34], EntityPig['Pig'/166, l='MpServer', x=-34.72, y=74.00, z=259.50], EntitySkeleton['Skeleton'/186, l='MpServer', x=-31.50, y=23.00, z=372.50], EntityBat['Bat'/187, l='MpServer', x=-22.25, y=31.10, z=388.75], EntityPig['Pig'/184, l='MpServer', x=-24.53, y=70.00, z=336.31], EntityPig['Pig'/185, l='MpServer', x=-21.50, y=72.00, z=354.69], EntitySkeleton['Skeleton'/190, l='MpServer', x=-18.00, y=52.00, z=396.50], EntityZombie['Zombie'/191, l='MpServer', x=-13.47, y=46.00, z=390.16], EntityZombie['Zombie'/188, l='MpServer', x=-19.50, y=61.00, z=386.50], EntityZombie['Zombie'/189, l='MpServer', x=-21.50, y=61.00, z=388.50], EntitySkeleton['Skeleton'/182, l='MpServer', x=-16.50, y=65.00, z=284.50], EntityCreeper['Creeper'/183, l='MpServer', x=-22.56, y=66.00, z=274.97], EntityPig['Pig'/181, l='MpServer', x=-25.16, y=66.00, z=281.84], EntityPig['Pig'/207, l='MpServer', x=-2.50, y=73.00, z=301.69], EntityPig['Pig'/223, l='MpServer', x=5.97, y=67.00, z=261.88], EntitySkeleton['Skeleton'/212, l='MpServer', x=-10.88, y=46.00, z=401.50], EntitySkeleton['Skeleton'/213, l='MpServer', x=-10.75, y=44.00, z=402.84], EntityCreeper['Creeper'/214, l='MpServer', x=-12.63, y=44.00, z=404.72], EntityCreeper['Creeper'/215, l='MpServer', x=-10.66, y=40.00, z=409.06], EntityPig['Pig'/208, l='MpServer', x=-2.84, y=72.00, z=288.44], EntityBat['Bat'/209, l='MpServer', x=7.97, y=44.39, z=377.66], EntitySkeleton['Skeleton'/210, l='MpServer', x=-10.53, y=44.00, z=386.78], EntityWitch['Witch'/211, l='MpServer', x=-15.50, y=53.00, z=389.50], EntityChicken['Chicken'/239, l='MpServer', x=19.53, y=67.00, z=250.47], EntityZombie['Zombie'/232, l='MpServer', x=6.50, y=12.00, z=359.50], EntityZombie['Zombie'/231, l='MpServer', x=6.50, y=12.00, z=360.50], EntityPig['Pig'/230, l='MpServer', x=13.72, y=75.00, z=349.22], EntityPig['Pig'/229, l='MpServer', x=11.47, y=73.00, z=343.66], EntityZombie['Zombie'/228, l='MpServer', x=10.34, y=47.00, z=345.34], EntitySkeleton['Skeleton'/227, l='MpServer', x=5.88, y=52.00, z=307.47], EntitySkeleton['Skeleton'/226, l='MpServer', x=5.84, y=51.00, z=306.34], EntitySkeleton['Skeleton'/225, l='MpServer', x=14.16, y=52.00, z=307.50], EntityPig['Pig'/224, l='MpServer', x=12.50, y=67.00, z=274.31], EntityBat['Bat'/249, l='MpServer', x=21.75, y=27.10, z=409.34], EntityZombie['Zombie'/246, l='MpServer', x=18.50, y=55.00, z=369.50], EntityBat['Bat'/247, l='MpServer', x=39.72, y=11.82, z=400.56], EntityPig['Pig'/244, l='MpServer', x=19.50, y=77.00, z=333.50], EntityZombie['Zombie'/245, l='MpServer', x=30.53, y=25.00, z=382.97], EntityPig['Pig'/242, l='MpServer', x=18.69, y=70.00, z=300.47], EntityPig['Pig'/243, l='MpServer', x=27.91, y=71.00, z=318.25], EntityPig['Pig'/240, l='MpServer', x=18.81, y=67.00, z=265.97], EntityPig['Pig'/241, l='MpServer', x=35.03, y=66.00, z=279.97]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2523) at net.minecraft.client.Minecraft.run(Minecraft.java:934) at net.minecraft.client.main.Main.main(Main.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Windows 8 (x86) version 6.2 Java Version: 1.7.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation Memory: 774409128 bytes (738 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 16965 (950040 bytes; 0 MB) allocated, 3458 (193648 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available cyFractureiTem{1.0} [Fracture iTem] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: Intel(R) HD Graphics 4400 GL version 4.2.0 - Build 10.18.10.3304, Intel Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: ?体中文 (中) Profiler Position: N/A (disabled) Vec3 Pool Size: 3494 (195664 bytes; 0 MB) allocated, 1070 (59920 bytes; 0 MB) used Anisotropic Filtering: Off (1) Sorry for my bad english, please help!
  4. How can I make a custom sword unbreakable? If can't how could I set the durability of the sword?
  5. Even the level is 0 it still heals my bar full. Because I got a 1 second instant heal effect. And it heals me 10 hearts in just a second. But if I set the time to 0 second. It won't heal me. What should I do?
  6. Hi, I am working on a food that will heal the player 2 hearts after ate. I've used the method setPotionEffect, I've tested it with moveSpeed and it worked. But the Instant heal seems not working Here's the code this.setPotionEffect(Potion.heal.id, 1, 4, 100); When I test the food. It didn't heal me 2 hearts but heal my bar full. How should I modify the method so that it will only heal 2 hearts? Sorry for my bad English. But please help
  7. Hi, I got the same problem and searched around. Finally I found a installed 1.6.2 src If you need it, skype me :chiyin2000 hope it helps
  8. I was wondering how can I create a mob that only get damage / killed when being attack the head
  9. Is there anyway to make a custom block drop multi items?Like an apple and a diamond Because I don't think idDropped can do this function.
  10. Because one of my friends is running a 1.6.2 modded server and he needs me to code him some item So, I must use 1.6.2
  11. I've downloaded a Forge 1.6.2 src. And run the install.bat But it failed to download the mcp anyone could help or send me the src + mcp file?
  12. package tutorial.basic; import java.awt.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.world.World; public class GenericSword extends ItemSword { public GenericSword(int id, EnumToolMaterial par2EnumToolMaterial) { super(id, par2EnumToolMaterial); setCreativeTab(CreativeTabs.tabCombat); setUnlocalizedName("generic_Sword"); setTextureName("chiyin:generic_sword"); } public static final int COOLDOWN = 2000; //200 - cooldown in ticks. 1 sec - 20 ticks. public void onUpdate(ItemStack iStack, World world, Entity entity, int esotericInt, boolean agravaineBoolean){ if(!world.isRemote){ Cooldownable.onUpdate(iStack, COOLDOWN); } } public ItemStack onItemRightClick(ItemStack iStack, World world, EntityPlayer player){ if(Cooldownable.canUse(iStack, COOLDOWN)){ player.motionY++; } return iStack; } public void addInformation(ItemStack iStack, EntityPlayer player, List info, boolean esotericBoolean){ Cooldownable.displayCooldown(iStack, info); //display current cooldown } } I've created the 2 class : Cooldownable.class & AgravaineNBTHelper.class
  13. Hi, tried your codes. But still not working anyway, thx for replying
  14. Is it possible to change a weapon's attack speed like 2 attacks per second Or the weapon cools down for 2 seconds after attacking once? If yes, how could I do it? *Sorry for my bad English
  15. I have tired to use the method idDropped. But after I recompile it, it doesn't works
  16. How could I modify a vanilla block/item? I had tried to modify the class file. But it doesn't work after I pack the mod. e.g. Make a dirt Block drop a diamond
  17. I've created a custom rendered block. It worked In client. But It crashed on server Heres the crash report of the server 2014-05-18 22:04:26 [資訊] [ForgeModLoader] Searching C:\Users\ChiYin\Desktop\Minecraft Modding\HaloCraft Extra\mcp\jars\mods for mods 2014-05-18 22:05:01 [資訊] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load 2014-05-18 22:05:01 [資訊] [mcp] Activating mod mcp 2014-05-18 22:05:01 [資訊] [FML] Activating mod FML 2014-05-18 22:05:02 [資訊] [Forge] Activating mod Forge 2014-05-18 22:05:03 [資訊] [cyHCE] Activating mod cyHCE 2014-05-18 22:05:03 [資訊] [ForgeModLoader] Registering Forge Packet Handler 2014-05-18 22:05:03 [資訊] [ForgeModLoader] Succeeded registering Forge Packet Handler 2014-05-18 22:05:03 [資訊] [sTDERR] java.lang.NoClassDefFoundError: net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer 2014-05-18 22:05:03 [資訊] [sTDERR] at java.lang.Class.forName0(Native Method) 2014-05-18 22:05:03 [資訊] [sTDERR] at java.lang.Class.forName(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:462) 2014-05-18 22:05:03 [資訊] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-05-18 22:05:03 [資訊] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201) 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) 2014-05-18 22:05:03 [資訊] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2014-05-18 22:05:03 [資訊] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2014-05-18 22:05:03 [資訊] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112) 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:511) 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) 2014-05-18 22:05:03 [資訊] [sTDERR] at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) 2014-05-18 22:05:03 [資訊] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) 2014-05-18 22:05:03 [資訊] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2014-05-18 22:05:03 [資訊] [sTDERR] Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer 2014-05-18 22:05:03 [資訊] [sTDERR] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) 2014-05-18 22:05:03 [資訊] [sTDERR] at java.lang.ClassLoader.loadClass(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] at java.lang.ClassLoader.loadClass(Unknown Source) 2014-05-18 22:05:03 [資訊] [sTDERR] ... 30 more 2014-05-18 22:05:03 [資訊] [sTDERR] Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer for invalid side SERVER 2014-05-18 22:05:03 [資訊] [sTDERR] at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) 2014-05-18 22:05:03 [資訊] [sTDERR] at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274) 2014-05-18 22:05:03 [資訊] [sTDERR] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172) 2014-05-18 22:05:03 [資訊] [sTDERR] ... 32 more 2014-05-18 22:05:03 [嚴重] [Minecraft-Server] Encountered an unexpected exception NoClassDefFoundError java.lang.NoClassDefFoundError: net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:462) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112) at cpw.mods.fml.common.Loader.loadMods(Loader.java:511) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 30 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172) ... 32 more 2014-05-18 22:05:03 [嚴重] [Minecraft-Server] This crash report has been saved to: C:\Users\ChiYin\Desktop\Minecraft Modding\HaloCraft Extra\mcp\jars\.\crash-reports\crash-2014-05-18_22.05.03-server.txt What is the problem?
  18. I have used the method onBlockActivated so that if player rightclicked the block with an arrow, it turns the arrow into an diamond But what I wanted to do is arrow, iron ingot and gold. This three item also can be changed into a diamond What should I do? I had tried if(par5EntityPlayer.getCurrentEquippedItem().itemID != (Item.arrow.itemID && Item.ingotIron.itemID)) But not working, anyhelp? Here's my code @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){ if(!par1World.isRemote){ if (par5EntityPlayer.getCurrentEquippedItem() == null)//prevents npe exceptions (NullPointerException) return false; if(par5EntityPlayer.getCurrentEquippedItem().itemID != Item.arrow.itemID) return false; par5EntityPlayer.inventory.mainInventory[par5EntityPlayer.inventory.currentItem] = new ItemStack(Item.diamond.itemID, 1, 0); par1World.setBlockToAir(par2, par3, par4); } return false;
  19. I have tried to use it, but still get error... any help? public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if World.isRemote == false; ItemStack dirt = new ItemStack(Block.dirt); EntityItem test = new EntityItem(par1World, par2, par3, par4, dirt); World.spawnEntityInWorld(test) end if
  20. Can you give me an example code? Because im new in modding
  21. How can I create a block that drops item on right click? I have tried to use the method onBlockActivated, but still get error... any help? public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if World.isRemote == false; ItemStack dirt = new ItemStack(Block.dirt); EntityItem test = new EntityItem(par1World, par2, par3, par4, dirt); World.spawnEntityInWorld(test) end if
  22. Hi, thx for your help. But can you please give me an example?
  23. What would I want to know, is will it be possible for me to use other mod's item in my mod. E.g. I create a block, after I break it I got a HaloCraft's Gun( a mod's gun item) If it is possible, how could I do it? please help, guys
  24. Do anyone got any tutorial for creating a pane block? Because I got problem on creating one If you dont get one you can also send me an example file thankyou
×
×
  • Create New...

Important Information

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