Posted September 22, 20222 yr Hello, I was just wondering how I could get the block the player is looking at Edited September 22, 20222 yr by Noxxous too formal
September 23, 20222 yr Use `Entity#pick`. Supply the scale that should be applied to the view vector, the partial tick (which is 1.0 on the server), and whether it should look for fluids.
September 23, 20222 yr Example of forge doing it on the client for the debug overlay: https://github.com/MinecraftForge/MinecraftForge/blob/98823a8f071e04c360a99ad5b46910f6c15028a8/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java#L680 Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
September 26, 20222 yr Author On 9/23/2022 at 10:02 AM, ChampionAsh5357 said: Use `Entity#pick`. Supply the scale that should be applied to the view vector, the partial tick (which is 1.0 on the server), and whether it should look for fluids. Sorry for my ignorance but I don't get the autocomplete and I'm not entirely sure how to do it
September 26, 20222 yr here's an alternative - look at the lilypad code. when the player uses lilypad item, that class checks what's exactly in front of player.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.