Flockshot
-
Posts
22 -
Joined
-
Last visited
Posts posted by Flockshot
-
-
I dont think so.Because the armors texture were working fine in eclipse.
-
*facepalm*
A jar is a zip file with a different extension.
I know that but it didnt worked for me until it wasnt in a .zip file extension
-
Okay sorry i fixed that.
If anyone is having the same problem he can do what i did.
When i built my mod it give me a .jar file.
I just changed the .jar file to .zip file and it worked.
Now how to change .jar to .zip. It is simple
Extract the files form .jar and then archive it.
Well sorry for disturbing guys.
-
I am facing a very strange problem
I created a armor and it worked perfectly in eclipse.
But when i built that the texture of the armors were not loading.
Here is my armor class
public class BlazeArmor extends ItemArmor { public String TexturePath = Refrence.MODID + ":" + "/textures/armors/" ; public BlazeArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int part4, String type) { super(par1, par2EnumArmorMaterial, par3, part4); this.setCreativeTab(CreativeTabs.tabCombat); this.setMaxStackSize(1); this.setTextureName(type, part4); } public void setTextureName( String Type, int part ){ if( armorType == 0 || armorType == 1 || armorType == 3 ){ this.TexturePath += "Armor_1.png"; } else{ this.TexturePath += "Armor_2.png"; } } // public String getArmorTexture( ItemStack itemstack, Entity entity, int slot, int layer){ return this.TexturePath; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister register){ this.itemIcon = register.registerIcon( Refrence.MODID + ":" + this.getUnlocalizedName().substring( 5 ) ); } }
-
Then... the variable doesn't belong to the Item, because the Item is eaten. -.-
You need to store it into the Player, use IExtendedEntityProperties.
Can you give example on how to use that
-
To get the data from the ItemStack you need to get the ItemStack first of course. Where do you want that to be? In the players inventory? Somewhere else?
Well as it is a food item so i wanna check if player has ever eaten this which i am storing in the nbt then on tickhandler i wanna check that if the player has ever eaten that and if true then the process carry on if false than break.
Actually i am trying to make an infinite potioneffect for the food. That can last even after the player die or close the game or drink milk. I will add a new item which will break this process.
-
Thanks i am able to add data to nbt but how can i take data from there.
I want to use the if statement for the data in TickHandler.
I dont know how can i check that. If that nbt key have the proper data saved in it.
-
As always: It depends™.
Where does that variable belong to?
To a Block? Use a TileEntity or metadata (only 4 bits, most likely not enough if you say "variable").
To an Item? Use the NBTTagCompound attached to every ItemStack.
To an Entity? Use writeToNBT / readFromNBT or IExtendedEntityProperties in case it is not your entity.
To a specific world (=dimension)? Use WorldSavedData with World#perWorldStorage.
To a save file? Use WorldSavedData with World.mapStorage.
To the Mod in general? Use the Configuration class provided by forge, or just a normal file for more complex data (you can use the normal Java file writing mechanics here).
I want to do it on an food item.
Can you give an example on how can i do this.
-
-
Well i want to save a variable that even after user quit the game it remain the same.So how could i make a file in which i could save it.
-
Can somebody tell me how can i generate my custom fluid pools in overworld
-
Helo i made a custom fluid but when ever i throw a bucket of water the fluid the water spawn and then become the fluid how can i solve it ,
-
Here is an example well it will add potion effect ressisstence for some seconds when you are holding the specific item.The seconds will not decrease until you dont have that specific item in hand
Its using ClientTickHandler
see here how to make 1.
In the video he is using server proxy if you are using client proxy change do it in client proxy.
Then in TickHandler Class add this
package com.Flockshot.UltraDaimond.Proxy; import java.util.EnumSet; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; public class ClientTickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if(type.equals(EnumSet.of(TickType.PLAYER))) { onPlayerTick((EntityPlayer) tickData[0]); } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.PLAYER, TickType.CLIENT); } @Override public String getLabel() { return null; } private void onPlayerTick(EntityPlayer player){ if(player.getCurrentItemOrArmor(0) != null){ ItemStack hand = player.getCurrentItemOrArmor(0); if(hand.getItem() == Your item here ){ //Your item here player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 10, 0 ) ); } } } }
-
Thanks i have found the solution
@Override public void onEntityCollidedWithBlock( World world, int x, int y, int z, Entity entity ) { entity.attackEntityFrom(DamageSource.magic, 3); //((EntityLiving)entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 1)); }
-
didnt understand.
can you give a example.
-
Raise the amount of max uses.
Can set to 1million
dont know about infinite but it will break after 1million uses.
-
Try to change the -1 in maxuses
public static EnumToolMaterial onyxEnum = EnumHelper.addToolMaterial("onyxEnum", 3 , -1 , 6.0F, 3.0F, 22); //-1 here
Give it a positive number and then try.
Edit: I was right, I tried it. Give the maxuses a positive number
Because the maxuses is the amount of time it can be used.
So it cant be negetive.
-
Do you get any error in console .Please post it .
And this is the method to add a material
EnumHelper.addToolMaterial(String name, int harvestLevel, int maxUses, float efficiency, float damage, int enchantability);
You have done it right in your code but if the last integer in stater which is of enchantability is set to 0 it cant be enchanted.
-
So i made a fluid.But now i want to add that any entity that touch it gets damage including player.How could i do that.
I am new to minecraft modding so dont know all the funcs yet.
-
So i am making a custom sword but i dont know how to change its damage i dont want to change the DamagevsEntity of the material because that will increase others tools as well.Can anyone tell me how can set damage to my sword.
-
Hello guys i am new in modding. I have forge graddle can someone tell me how can i make mods in it i searched for videos but they were all of simple forge.
Please anyone tell me how can i make mods in graddle 1.6.4 If there is a video about it give me its link.
Armors texture not loading when build
in Modder Support
Posted
What i said previosly about the .zip file working it wasnt that it was the folder of my mod that was working .zip isnt working