Everything posted by Aquillian
-
[SOLVED]Help with achievements code. Forge 1.7.2 modding
To register an achievement public static Achievement achievementName; in your FMLInitializationEvent func new Achievement(unLocalizedName, achievement name(used when adding an achievement on to it) , x, y, ItemStack(icon), (Achievement)parent(group)) achievementName = new Achievement("achievement.achievementName", "achievementName", 0, 0, Blocks.stone, (Achievement)null).registerStat(); then in your PickupHandler if(event.pickedUp.getEntityItem().isItemEqual(new ItemStack(Your item or block))){ System.out.println("Aquired. ..."); event.player.addStat(ModClass.achievementName , 1); }
-
[Solved] Bonemeal Event not working on Crops any help would be lovely.
This work for me. if(event.world.getBlockId(event.X, event.Y, event.Z) == ScienceBase.TestingCrop.blockID){ (ScienceBase.TestingCrop).fertilize(event.world, event.X, event.Y, event.Z, event.entityPlayer); }
-
[UNRESOLVED]Help Removing Ores
Any Editing of Base Classes will be undone by forge if you release the mod since removing anything from vanilla Minecraft is bad and could/ would cause major conflicts with other mods.
-
ModLoader mod in FML
are you using forge api + ModLoader or you have made a mod in ModLoader and are placing in the clients side mod folder. cause to use ModLoader in forge you will need to import it import net.minecraft.src.BaseMod; import net.minecraft.src.ModLoader; and then use the normal code you have.
-
ModLoader mod in FML
Forge fully supports ModLoader Mods and even includes ModLoader as part of the api. your only issue may come from item/ block conflicts since ModLoader only supports 256 block ids and forge increase that.
-
Adding a startup message for a mod?
http://www.minecraftforge.net/forum/index.php?topic=1303.0 this post may also be helpful to you
-
How do you patch a minecraft class?
when you say patch are you offering it as a patch to an allready availble mod or are you trying to patch a core file? also :- && = AND || = OR
-
Custom Creative Tab Trouble!
net.minecraft.item.Item.Java Line 212 = public final int shiftedIndex;
-
Overriding a block
Even that would still require a core code change since you would need to add s subtype to the BlockStone class
-
Custom Creative Tab Trouble!
public int getTabIconItemIndex() { return MoreCraft.OBSIDIAN_PEARL.shiftedIndex; } you need to add the shiftedIndex
-
Custom Creative Tab Trouble!
@Override @SideOnly(Side.CLIENT) public ItemStack getIconItemStack() { return new ItemStack(MoreCraft .OBSIDIAN_PEARL); } should fix it.
-
Adding Suffixes/Extended tooltips for Items and Blocks?
This is how i would do it. public class FallFood extends ItemFood { private final String setInfo; private final String setColor; public FallFood (int par1, int par2, float f, boolean par3) { super(par1, par2, par3) ; setCreativeTab(CreativeTabs.tabMaterials); this.setInfo = "It smells weird"; this.setColor = "\u00A7a"; } public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean bool) { list.add(setToolTipData()); } private String setToolTipData(){ return this.setColor + this.setInfo; } public String getTextureFile() { return"/gemstone_mod/Items.png"; } } hopefully this gets you on track and color refrence
-
Overriding a block
WoW if your looking to override a core block then Forge may not be the API for you since the purpose of the API is there to negate the need to change core code and override existing id's.
-
[Solved]Entity Player Flying
public boolean onBlockActivated(World world, int xCoord, int yCoord, int zCoord, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) { entityPlayer.capabilities.allowFlying = true; entityPlayer.motionY += 1.0; entityPlayer.capabilities.isFlying = true; entityPlayer.fallDistance = 0; return true; } works for me
-
[Solved]Entity Player Flying
entity.motionY += 1.0; maybe.
-
tool durability
thanks for the help so far... Ok so i have got to this - public boolean hitEntity(ItemStack itemStack, EntityLiving entity, EntityLiving entityLiving) { this.iDmg = itemStack.getItemDamage(); if (iDmg == toolMaterial.getMaxUses()) { itemStack.damageItem(0, entityLiving); }else{ itemStack.damageItem(1, entityLiving); } return true; } Works as expected public int getDamageVsEntity(Entity entity) { if(iDmg == toolMaterial.getMaxUses()){ return this.weaponDamage = 1; }else{ return this.weaponDamage = 9; } } Also works as expexted But when i set return this.weaponDamage = 1; to 0 it stops doing damage as expected. but the weapon damage stay at 0 after switching to a undamaged weapon. has anyone got any sort of solution for this thanks for any help any help is great appreciated.
-
tool durability
need to stop my tools from breaking when they hit 0 durability I have read through so many classes and can't find anywhere where tools are told to break at 0 durability. i would appreciate help locating the class or method that deals with this or if you happen to have a code snippet that may help i would be greatly appreciative. thanks for reading.
IPS spam blocked by CleanTalk.