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