Jump to content

satyamedh

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by satyamedh

  1. destroyBlock dosent exists
  2. bruh Thats the only command intellij tells me
  3. It is basically what the client does
  4. I checked it a long time ago. heres the new code I updated but didnt post: public static boolean attack(){ ClientPlayerEntity player = Minecraft.getInstance().player; if ((player == null)) {return false;} RayTraceResult lookingAt = Minecraft.getInstance().objectMouseOver; assert lookingAt != null; System.out.println(lookingAt.getType().toString()); if (lookingAt.getType() == RayTraceResult.Type.BLOCK) { if (lookingAt.getType().toString() == "a"){ System.out.println("Yeaaa"); } double x = lookingAt.getHitVec().getX(); double y = lookingAt.getHitVec().getY(); double z = lookingAt.getHitVec().getZ(); net.minecraftforge.client.event.InputEvent.ClickInputEvent inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(0, Minecraft.getInstance().gameSettings.keyBindAttack, Hand.MAIN_HAND); if (inputEvent.shouldSwingHand()) { Minecraft.getInstance().particles.addBlockHitEffects(new BlockPos(x, y, z), (BlockRayTraceResult) lookingAt); Minecraft.getInstance().player.swingArm(Hand.MAIN_HAND); } player.world.getBlockState(new BlockPos(x, y, z)) .getBlock(). harvestBlock( player.world, player, new BlockPos(x, y, z), player.world.getBlockState(new BlockPos(x, y, z)), player.world.getTileEntity(new BlockPos(x, y, z)), player.getHeldItemMainhand() ); } return true; }
  5. Do u know the function that is called?
  6. okay. so how do I continue?
  7. It is basically a helper mod for my project. All I need this mod to do is to do what a normal player can whenever I ask it to do something from python. the python-java communication is flawless. just need a way to contol the player. so I guess it is up to you who says what I need
  8. Hello! I have this code now: public static boolean attack(){ ClientPlayerEntity player = Minecraft.getInstance().player; if ((player == null)) {return false;} RayTraceResult lookingAt = Minecraft.getInstance().objectMouseOver; assert lookingAt != null; System.out.println(lookingAt.getType().toString()); if (lookingAt.getType() == RayTraceResult.Type.BLOCK) { if (lookingAt.getType().toString() == "a"){ System.out.println("Yeaaa"); } double x = lookingAt.getHitVec().getX(); double y = lookingAt.getHitVec().getY(); double z = lookingAt.getHitVec().getZ(); Minecraft.getInstance().particles.addBlockHitEffects(new BlockPos(x, y, z), (BlockRayTraceResult) lookingAt); Minecraft.getInstance().player.swingArm(Hand.MAIN_HAND); player.world.getBlockState(new BlockPos(x, y, z)) .getBlock(). harvestBlock( player.world, player, new BlockPos(x, y, z), player.world.getBlockState(new BlockPos(x, y, z)), player.world.getTileEntity(new BlockPos(x, y, z)), player.getHeldItemMainhand() ); } return true; } And It just animates the block breaking, but dosent drop the block. pls help
  9. Exactly what class isit? How do i go there in intellij?
  10. Where do I start
  11. I mean the funcions And what a quick reply :rofl:
  12. And LOL I answered so quick there :')
  13. How to check what events are fired I mean.
  14. Okay, How to I use this thing u told me? ---------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------
  15. Okay I'm like a real newbie to the blocks n stuff. How can I trace the code? do I set a debug breakpoint on every line or wut?
  16. Uhh can you explain? I am using block.harvestBlock. figuring out its arguments
  17. So I want the player to break the block. Like if he is in survival break with correct speed, in creative instamine. I also want it to drop I am assuming there is a function I need to call in order for that to happen thx!
  18. Player.move? Ok I'll try it
  19. They why the advertise it like that LOL And pls help me Hehe
  20. okay, I just wanted to know if there is a dedicated event to it also can you hekp me with the main question? thx
  21. So I want to control the player using code. I am a (sort of)newbie to forge. is it done using the player entity object? Please dont be like stackoverflow and downvote as it was already asked. I cant seem to find it. Thx in advance ps: also is there a event for killing the ender dragon/beating the game??
×
×
  • Create New...

Important Information

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