Jump to content

ashtonr12

Members
  • Posts

    479
  • Joined

  • Last visited

Posts posted by ashtonr12

  1. 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.

  2. 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.

  3. 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.minecraftforum.net/topic/1452051-15-wip-again-deverions-forge-modding-tutorials-updated-16-03-2013-15-tutorials-1/

    http://www.minecraftforum.net/topic/1431137-147-forge-smp-modding-tutorials-updated-3-3-2013-english-chinese-german-swedish-and-polish/

    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

  4. 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

  5. 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 :)

  6. 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 :)

  7. 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 :).

  8. 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?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.