![](https://forums.minecraftforge.net/uploads/set_resources_2/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
ashtonr12
-
Posts
479 -
Joined
-
Last visited
Posts posted by ashtonr12
-
-
yes i know it is a good source of information but this requires other people to constantly answer simply questions when you could just spend 5 minutes googling it instead and they can focus on the parts like when you get stuck and cant find an answer or some or the harder modifications. In short your just being lazy and it is taking up people time.
-
there are tutorials for all of this beginning stuff all over the internets, stop coming on here first jeez, only come one here when you cant find the answer any where else.
http://www.minecraftforge.net/wiki/Basic_Modding
http://darkhaxspace.weebly.com
three great examples to prove my point and that was 2 secs of looking
-
wait for diesieben07 hell probably know whats wrong.
-
you need .addPotionEffect((new PotionEffect(Potion.confusion.getId(), 100, 5)));
the .confusion can be exchanged out for other potion effects, the 100 is the duration and 100 is about 5 seconds, the 5 is the power modifyer of the potion effect.
-
i found the correct code;
ChestGenHooks.getInfo(ChestGenHooks.Catagory).addItem(new WeightedRandomChestContent(new ItemStack(package.Item), Min, Max, Chance));
-
here is an example i know works because i use it
for your main class before you init,
@PreInit public void registerMyEvents(FMLPreInitializationEvent e){ MinecraftForge.EVENT_BUS.register(new BatDrops());{ } }
the seperate class
package ashtonsmod.common; import net.minecraft.block.Block; import net.minecraft.block.BlockBreakable; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityBat; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntitySquid; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; public class BatDrops { public static double rand; @ForgeSubscribe public void onEntityDrop(LivingDropsEvent event) { if (event.source.getDamageType().equals("player")) { rand = Math.random(); if (event.entityLiving instanceof EntityBat) { //The integer at the end relates to how many Items will be dropped(percentage). if (rand < 0.75d){ //The integer at the end relates to how many Items will be dropped(amount). event.entityLiving.dropItem(Item.potatoe.itemID, 1); } }}}
this makes a bat on death have a 75% chance of dropping one potatoe
-
the firs method is undefinable and the second is unaccpetable
-
someone must have updated a mod with similar problems?
-
anybody?
-
errr
-
a PR?
-
i have created this but the methods are out of date and i don't know how to update them. help appreciated
package ashtonsmod.common; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class WoodStaff extends Item { public WoodStaff(int par1) { super(par1); } public boolean onItemUse(ItemStack is, EntityPlayer player, World w, int x, int y, int z, int l, float f, float f1, float f3){ if(w.getBlockId(x, y, z) == Block.planks.blockID){ w.setBlockMetadataWithNotify(x, y, z, w.getBlockMetadata(x, y, z)+1); if(w.getBlockMetadata(x, y, z) == 4){ w.setBlockMetadata(x, y, z, 0); } else if(w.getBlockId(x, y, z) == Block.wood.blockID){ w.setBlockMetadataWithNotify(x, y, z, w.getBlockMetadata(x, y, z)+1); if(w.getBlockMetadata(x, y, z) == 4){ w.setBlockMetadata(x, y, z, 0); } }else if(w.getBlockId(x, y, z) == Block.stairsWoodSpruce.blockID){ w.setBlockWithNotify(x, y, z, Block.stairsWoodBirch.blockID); }else if(w.getBlockId(x, y, z) == Block.stairsWoodBirch.blockID){ w.setBlockWithNotify(x, y, z, Block.stairsWoodJungle.blockID); }else if(w.getBlockId(x, y, z) == Block.stairsWoodJungle.blockID){ w.setBlockWithNotify(x, y, z, Block.stairCompactPlanks.blockID); }else if(w.getBlockId(x, y, z) == Block.stairCompactPlanks.blockID){ w.setBlockWithNotify(x, y, z, Block.stairsWoodSpruce.blockID); return false; } } } }
the errors are under all of the .setBlockWithNotify and the .setBlockMetadataWithNotify
i know they updated these methods
-
how would i go about setting the player on fire when he/she is wearing armour piece X?
-
its not that bad of an idea as it is something you have an enthusiasm towards, the learning style is different.
if you learn java first then you just have to put in place what you have learnt, if you learn by modding then you just have to learn part by part. ie learn how to add a custom block, then a custom item, etc
and then in your next mod you already know how to do these things and if you forget you can refer to your old one
-
title says it all, it would be nice to be able to manipulate the players reach on variables like which armour set your wearing or what weapon your using etc.
-
what format does it have to be and where do i put it?
-
Did It
-
that was not my question.
-
Can someone give me an example of the code needed (in the main class) of how to add a dungeon loot i have spent a lot of time trying to figure this out with no such luck and my old post was kind of off on a tangent. I am asking for a clear example because i am not very good at understanding java yet and have a tendacy to be a moron
.
-
so you wont help me?
-
i did but clearly i dont understand or cant find them which is why i am asking for your help, as someone who can read find and understand the code.
-
thats where i found the first three but i cant pt any order too them or discover what the other two are
-
no need to start getting upset with each other
i do not know very much about java at it isnt my fualt that they changed the dungeon hooks thing but all i am looking for the new solution, last night i got this far;
chestGenHooks.additem("dungenChest", new WeightedRandomChestContent(1,1,1,1,1))
and i know what some of the didgets do but not all of them and i cant find the right order and i dnot know if this is actually correct it just gives no errors
(the didgets are maxstacksize, minstacksize,chance and i dont knwo the other two and i dont knwo the order)
if this is incorrect could someone just post the correct one? if it is correct can someone tell me the order of the numbers and what they each mean please?
-
Go and learn some correct English grammar first.
Custom Mob Drops
in Modder Support
Posted
i can understand why you would find this funny but i only ask a question on here after i have googled it alot
only if i cannot find the answer to my problems elsewhere do i ask a question on here. Well i try anyway i search for the answer on my own before i ask the forums, it is silly to ask for you to repeat something that is written down somewhere else.