Jump to content

Jarle

Members
  • Posts

    9
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Jarle's Achievements

Tree Puncher

Tree Puncher (2/8)

-2

Reputation

  1. Yeah I am a teenager hwo are trying to learn coding so that speaks for it self... but thanks
  2. Hi there! I am trying to check if the player kills a Zombie and not anything else. I am new at minecraft modding so please help me! import net.minecraft.entity.Entity; import net.minecraft.entity.monster.EntityZombie; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class Inheritance { EntityZombie entityZ = new EntityZombie(null); @SubscribeEvent public void LivingDeathEvent(AttackEntityEvent event){ if(event.target == entityZ){ System.out.println("You killed a zombie"); } } } I am not getting any errors but it still doesn't print out
  3. sorry forgot to tell you i am modding in 1.8
  4. What i want to do: I want to make a mod, where the player can jump much higher then normal height. The height should be 15 times higher then normal height. This function will only be available if my position is on an slime_block. I no this mod may be really strange, but why not? The code package jattys.mods.devox4kids; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class SuperJump { @SubscribeEvent public void BouncySlimeBlock(LivingJumpEvent event){ if(!(event.entity instanceof EntityPlayer)) { return; } if(event.entity.worldObj.(where i get an error)getBlock( ((int) Math.floor(event.entity.posX)), ((int) Math.floor(event.entity.posY)) - 2, ((int) Math.floor(event.entity.posZ))) != Blocks.slime_block){ return; } event.entity.motionY *= 15; } } The error The method getBlock(int, int, int) is undefined for the type World. What can i actually do?
  5. Jarle

    Event.block

    I am a freaking noob Sorry Faillander, but i couldn't make the BlockPos idea to work. event.world.createExplosion( null, BlockPos(x, y, z), 10 , true ); It just gives me an syntax error.
  6. Jarle

    Event.block

    oh tank you man you saved me a lot of time!
  7. Jarle

    Event.block

    Thanks for the help but what about the x,y and z tough?
  8. Jarle

    Event.block

    Yeah, i am in version 1.8
  9. Hi i am reading Minecraft modding forge (Arun Gupta). The book is about modding Minecraft, of course. unfortunately the book was made in version 1.6.4, so the codes have changed . I have actually copied the code from the book and pasted it right to the machine. Still i get an syntax error from: event.block and event.x/y/z. Can anyone help me with this new code? package jattys.mods.forge; import java.util.Random ; import net.minecraft.init.Blocks ; import net.minecraftforge.event.world.BlockEvent.BreakEvent ; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent ; public class DiamondOreTrap { @SubscribeEvent public void explode ( BreakEvent event ) { if ( (syntax error)event.block != Blocks . diamond_ore ) { return ; } event.world.createExplosion( null , (syntax error)event.x , event.y , event.z , 10 , true ); } } Whats wrong?
×
×
  • Create New...

Important Information

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