
King_Arthur_III
Members-
Posts
19 -
Joined
-
Last visited
Everything posted by King_Arthur_III
-
So I now the code looks like this, and it works better than before, with a few exceptions. The good part is that the fireball shoots in a much less random direction. However, much of the time it seems to get very buggy once it goes relatively far. Also, it shoots much faster than normal, which is not necessarily bad, but strange. @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(Items.redstone)) { par2World.playSoundAtEntity(par3EntityPlayer, "fireball", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote){ //Minecraft minecraft = Minecraft.getMinecraft(); //EntityPlayerSP player = minecraft.thePlayer; //par2World.spawnEntityInWorld(new EntityLargeFireball(par2World, par3EntityPlayer, vec3.xCoord, vec3.yCoord, vec3.zCoord)); Vec3 vec3 = par3EntityPlayer.getLookVec(); EntityLargeFireball entitylargefireball = new EntityLargeFireball(par2World, par3EntityPlayer, vec3.xCoord, vec3.yCoord, vec3.zCoord); entitylargefireball.accelerationX = vec3.xCoord; entitylargefireball.accelerationY = vec3.yCoord; entitylargefireball.accelerationZ = vec3.zCoord; par2World.spawnEntityInWorld(entitylargefireball); } } return par1ItemStack; }
-
Thanks for the answer, I tried to find what would I could use but I figured out that they are accelerationX, accelerationY, and accelerationZ, so it doesn't sound like it has anything to do with pitch, yaw, and roll. Also, I don't think roll would be one of them because Minecraft only has pitch and yaw.
-
I am trying to make a sword that shoots a large fireball when right clicked in the direction that the player is pointing. But the fireball takes three parameters at the end that I don't know what they do. When I make them 10, 10, 10, the fireball always goes in a set direction no matter which way I am pointing. It seems like these parameters would be coordinates or something, but I don't know how to have them change depending on where the mouse is pointing. ? = mystery parameter @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(Items.redstone)) { par2World.playSoundAtEntity(par3EntityPlayer, "fireball", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityLargeFireball(par2World, par3EntityPlayer, ?, ?, ?)); } } return par1ItemStack; }
-
I am trying to make my first entity ( 1.8 ) but when I run the client I get this message: "java.lang.IllegalArgumentException: Can not set static com.kingarthur.elementalswords.ClientProxy field com.kingarthur.elementalswords.ClientProxy.modInstance to com.kingarthur.elementalswords.Main" This is the relevant code in my client proxy: public class ClientProxy extends CommonProxy { @Instance(Main.MODID) public static ClientProxy modInstance; @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); ModEntities.mainRegistry(); ItemRenderRegister.registerItemRenderer(); } And this is the code in my ModEntities file: public class ModEntities { public static void mainRegistry() { registerEntity(); } public static void registerEntity() { createEntity(EntityFireGuardian.class, "Guardian of Fire", 0xF20505, 0xD8DE31); } public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor) { int randomId = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomId); EntityRegistry.registerModEntity(entityClass, entityName, randomId, ClientProxy.modInstance, 80, 3, true); createEgg(randomId, solidColor, spotColor); } private static void createEgg(int randomId, int solidColor, int spotColor) { EntityList.entityEggs.put(Integer.valueOf(randomId), new EntityList.EntityEggInfo( randomId, solidColor, spotColor)); } }
-
This is my current folder structure. Minecraft (project) src/main/java package package package src/main/resources package package package So my question is, how do I separate the packages, or do I just leave them as they are?
-
So I can have projects inside of the Minecraft project?
-
I was about to make my second mod, but then I wondered if there was some standard way of organizing mods, or if I should just keep all the packages for all my mods in the same source folder. Anyone know what I should do?
-
I have made my first item, but there is no way to obtain it except through creative mode. How do I make mobs drop it?
-
When I try to start my world, I get this error: Forge Mod Loader detected missing blocks/items. There are 1 missing blocks and items in this save. If you continue the missing blocks/items will get removed. A world backup will automatically created in your saves directory. Missing Blocks/Items: tutorial:tutorial_item. Any idea where this error might be coming from?
-
When I attempt to run my very simple mod, I get this crash report: "java.lang.IllegalArgumentException: Can not set static com.arti.artismod.ArtisMod field com.arti.artismod.ArtisMod.instance to com.example.examplemod.ExampleMod" The code: package com.arti.artismod; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = ArtisMod.MODID, name = ArtisMod.MODNAME, version = ArtisMod.VERSION) public class ArtisMod { public static final String MODID = "tutorial"; public static final String MODNAME = "Tutorial Mod"; public static final String VERSION = "1.0.0"; @Instance public static ArtisMod instance = new ArtisMod(); @EventHandler public void preInit(FMLPreInitializationEvent e) { } @EventHandler public void init(FMLInitializationEvent e) { } @EventHandler public void postInit(FMLPostInitializationEvent e) { } }
-
setTextureName method not working
King_Arthur_III replied to King_Arthur_III's topic in Modder Support
I found this webpage and made the changes that were suggested, and I don't get any errors, but when I try to enter my minecraft world I get this error, "Forge Mod Loader detected missing blocks/items. There are 1 missing blocks and items in this save. If you continue the missing blocks/items will get removed. A world backup will be automatically created in your saves directory. Missing Blocks/Items: arti_artismod:Key" The webpage: http://www.wuppy29.com/minecraft/1-8-tutorial/updating-1-7-to-1-8-part-2-basic-items/#sthash.jYdavYL4.dpbs -
setTextureName method not working
King_Arthur_III replied to King_Arthur_III's topic in Modder Support
Minecraft 1.8.7, and the latest recommended version of Forge, which is 11.14.3.1450. -
setTextureName method not working
King_Arthur_III replied to King_Arthur_III's topic in Modder Support
I agree, it seems to be a bug or something, but I took the code that I posted and copied it into the file and the error is still there. -
I am trying to make my first item, but for some reason the setTextureName method gives me an error that says "The method setTextureName(String) is undefined for the type ItemKey". But, when I do certain things to the code such as change "MODID" in the setTextureName method to "modid", the error for setTextureName disappears and I instead get an error for modid, (which makes sense). Also, if I remove the quotation marks from the colon in the setTextureName method, the error on setTextureName once again goes away, but I get errors on the colon, + sign, and "key". Since I am relatively new to modding I might be missing something obvious. package com.arti.artismod; import net.minecraft.item.Item; import net.minecraft.creativetab.CreativeTabs; public class ItemKey extends Item { private String name = "key"; public ItemKey() { setUnlocalizedName(ArtisMod.MODID + "_" + "key"); setTextureName(ArtisMod.MODID + ":" + "key"); setCreativeTab(CreativeTabs.tabMisc); } }