
satyamedh
Members-
Posts
24 -
Joined
-
Last visited
Everything posted by satyamedh
-
destroyBlock dosent exists
-
bruh Thats the only command intellij tells me
-
It is basically what the client does
-
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; }
-
Do u know the function that is called?
-
okay. so how do I continue?
-
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
-
It is both
-
Then, ?
-
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
-
Thanks!
-
Exactly what class isit? How do i go there in intellij?
-
Where do I start
-
I mean the funcions And what a quick reply :rofl:
-
And LOL I answered so quick there :')
-
How to check what events are fired I mean.
-
Okay, How to I use this thing u told me? ---------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------
-
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?
-
Uhh can you explain? I am using block.harvestBlock. figuring out its arguments
-
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!
-
Player.move? Ok I'll try it
-
They why the advertise it like that LOL And pls help me Hehe
-
okay, I just wanted to know if there is a dedicated event to it also can you hekp me with the main question? thx
-
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??