Posted April 23, 20232 yr In my mod I'm making so that if the player tries to place some glass panes while sneaking it will be placed another block (a horizontal glass pane). To do so I'm listening to the block place game event and so far everything works. However for a split fraction you can see the vanilla glass pane before it gets replaced by the mod block. Is there any way to prevent this and instead just straight forward place the mod block without placing the vanilla block and then the modded one? You can see how I replace the block here: https://github.com/JimiIT92/MineWorld/blob/master/src/main/java/org/mineworld/event/GameEventListener.java#L40 By the way I've also tried listening to the BlockEvent.EntityPlaceEvent, cancelling and then set my own block, but that didn't worked at all (and not cancelling the event would produce the same result where you can see the placed block before is replaced)ย Edited April 23, 20232 yr by JimiIT92 solved Don't blame me if i always ask for your help. I just want to learn to be better
April 23, 20232 yr It's not possible unless it is your block so can you override the logic in BlockItem.place() This is because the vanilla client is simulating what it thinks should happen to give more immediate feedback to the player. ย The vanilla BlockItem already places the block on the client side before calling the server where the event can decide a different block should be placed. A similar thing happens when you cancel the block break event. The client momentarily displays the block as gone. 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.
April 23, 20232 yr Author Understood, so I guess it's fine till it works. ๐ Of course if it was a custom block in the first place there wasn't even the need for the event Don't blame me if i always ask for your help. I just want to learn to be better
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.