Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


Forge Modder
  • Content Count

  • Joined

  • Last visited

Everything posted by xwerswoodx

  1. I know MobEffects initialization. But he asked about "I've seen around the internet that they go Potion.getPotionByID(), or was it PotionEffect.getPotionByID()? Either way, it doesn't seem to be supported here." So I answered him same way. Sorry bro but knowing "MobEffects" init doesn't make you good or bad modder. Anyway here is the code with "MobEffects" for "GOOD" mooders... player.addPotionEffect(new PotionEffect(MobEffects.POISON, 100, 0));
  2. player.addPotionEffect(new PotionEffect(Potion.getPotionById(19), 100, 0)); Here is the example. 19 is id of potion which is equals to Poison, 100 is duration of potion 20ticks per second, so 100 is equals to 5 seconds. and 0 is a level of potion. (zero-based) so if you type 2 for level, it equals level 3 potion effect. You can get ids from net.minecraft.potion.Potion.java.
  3. player.sendMessage(new TextComponentString("This is sendmessage example string."));
  4. Here is my basic ConfigHandler class, maybe help you. package net.xwerswoodx.vrenchant; import java.io.File; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; public class ConfigHandler { public static Configuration config; private static String file = "config/modID.cfg"; public static void init() { config = new Configuration(new File(file)); try { config.load(); } catch (Exception e) { System.out.println("Cannot load configuration file!"); } finally { config.save(); } } /* * Removes specific
  5. I don't know if it's possible to get from UUID from offline player (I haven't tried it before) but you can save player uuid to configuration file when he logged in server first time, and you can check his nickname from configuration file. If I remember correct, playerLoginEvent or LoggedIn event could be suitable for this.
  6. public class EmeraldArmor extends ItemArmor { public addarmor(String name, int index, int type) { super(yourmainclass.ArmorMaterial_EMERALD, index, type); this.setCreativeTab(CreativeTabs.tabCombat); this.setUnlocalizedName(name); GameRegistry.registerItem(this, name); } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if (slot == 2) { return yourmodid + ":textures/models/armor/emerald_layer_2.png"; } else { return yourmodid + ":textures/models/armor/emerald_layer_1.png"; } } } To the main code: public static ArmorMate
  7. if you didn't change your mod Id was examplemod I remember, you need to check public Static MODID from your main class, because it works for me
  8. You need to change this sections; version = "1.8-" group= "net.extend.mod" archivesBaseName = "extend" group should be same with your main class folder and extend should be your modid.
  9. I am waiting for this too, but it hasn't fixed yet or maybe I didn't see.
  10. This is helpful for me thanks for this, I remove sideonly, but it still not working. //I solved it, I can delete topic but maybe someone will make same mistake so I can explain, I used EntityPlayer for onUpdate but have to use Entity. So I change my code; public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; if (player.inventory.hasItem(stack.getItem())) { Minecraft mc = FMLClientHandler.instance().getClient(); update(mc); } } }
  11. I am trying to tick item. But onUpdate never works, how is it work? I try this; @SideOnly(Side.CLIENT) public void onUpdate(ItemStack stack, World world, EntityPlayer player, int par4, boolean par5) { if (player.inventory.hasItem(stack.getItem())) { outStream = new BufferedWriter(new FileWriter(new File("hamit.txt"), true)); outStream.write("onUpdate!"); outStream.newLine(); outStream.close(); } } But it never write onUpdate! in hamit.txt, I try to walk, run, right click, left click... How can I fix it? I can use onPlayerTick but it affect all items with same id,
  12. Ok I did what did you say Change my code to: ModelResourceLocation location = new ModelResourceLocation(ref.uid, "inventory"); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemref.ironX, 0, location); texture isn't work. I changed it ModelResourceLocation location = new ModelResourceLocation(ref.uid + ":ironx", "inventory"); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemref.ironX, 0, location); Texture works. I changed it to; ModelResourceLocation location = new ModelResourceLocation(ref.
  13. For 1.7.10 import cpw.mods.fml.common.Mod; For 1.8.0 import net.minecraftforge.fml.common.Mod; Can you try import Mod manually?
  14. You don't use quotation marks before @mod and after it. If it is work older versions, it can be because forge isn't support java 8 versions yet, but it doesn't cause @Mod error, it just not compile codes and crash game, if you use " before @Mod and at the end of the line, it can be error. @Mod(modid = "LetsMod", name = "Lets Mod", version = "1.0-1.7.10") If you don't have quotation marks I don't know why it gives error, maybe someone help you.
  15. What is the error? Could you copy your @mod line?
  16. String name = ref.uid + ":" + (item.getUnlocalizedName().substring(5)); Ah this line is means ref.uid is my modid and (item.getUnlocalizedName().substring(5)) is json file name, for 1.8.0 setTextureName isn't exists anymore, before I can do it with IIcon but now I can't register more than 1 textures for item. For 1.7.10 I can use like this; private IIcon[] iconIndexes = new IIcon[5]; @SideOnly(Side.CLIENT) @Override public void registerIcons(IIconRegister reg) { for (int x=0; x < 5; x++) { iconIndexes[x] = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substr
  17. Ok I try to explain; When I try to register blockChecker icon, I use that way; String name = ref.uid + ":" + (item.getUnlocalizedName().substring(5)); ModelResourceLocation location = new ModelResourceLocation(name, "inventory"); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, location); blockChecker unlocalized name is blockchecker_0 and when I create blockchecker_0.json, texture works in game, but when I try it to blockchecker_1.json, (I also have blockchecker_1.json) texture doesn't work in game. public void setRender(Item item, i
  18. Your sound loader should be like this; public class SoundLoadHandler { @SideOnly(Side.CLIENT) public void onSoundsLoaded(SoundLoadEvent event) { SoundManager src = event.manager; src.soundPoolStreaming.addSound("glistremod:wolf_howl.ogg"); } @SideOnly(Side.CLIENT) public void onPlayStreaming(PlayStreamingEvent event) { boolean isCont; isCont = event.name.contains("glistremod"); if (!isCont) { FMLClientHandler.instance().getClient().SoundManager.playStreaming("glistremod:" + event.name, event.x + 0.5F, event.y + 0.5F, event.z + 0.5F); } } } And your ogg files should be
  19. You need to setUnlocalizedName in your wand class. Because textures load as a name. if your items unlocalizedname is ABC it will check ABC.json file for texture, and if you paste your wand class we can help you better, because we can't see where are you register item.
  20. I don't understand what the problem is but if you use TeamViewer I can come to your pc and help you to create tab and maybe I can see the problem. If you send your crash report from file, it can give us more information about problem. Also If you use skype I can help you with sharing desktop My skype is same with my nickname
  21. You should use init event from your main class, I am not sure it is work in different class. Can you try in your main class?
  22. Have you ever check second page? Because first page is totally full and new tabs created with new page. Ok I create new tab on my pc and check it; I have create in my main class a Creative tab; public static CreativeTabs CreativeTabs_New; After that, in my main class inside of Init event; CreativeTabs_New = new CreativeTabs("New") { @Override public Item getTabIconItem() { return itemref.blackDiamond; } }; And the result; I don't have blackdiamond texture yet don't thing code is wrong And a question; Did you register your
  23. This is my adddisc function for custom records. But I am using 1.8.0 so I am not sure whether it is work on 1.7.10 or not. package net.extend.mod.functions; import java.util.HashMap; import java.util.List; import java.util.Map; import com.google.common.collect.Maps; import net.extend.mod.ref; import net.minecraft.block.BlockJukebox; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.