Fabric API

Fabric API

106M Downloads

[Suggestion] Block place event

raoulvdberge opened this issue ยท 3 comments

commented

There is UseBlockCallback, but I'm not sure if that is what I need.

commented

Nevermind, misread this.

We already have this. Override Block#onPlaced(). Most modern editors, such as Eclipse or IntelliJ should recommend this using Intellisense.

commented

Is this a serious comment?

commented

Keep in mind player Events have to listen for methods in ClientPlayerInteractionManager and ServerPlayerIneractionManager (both seperate to the Fabric API) in their Mixins for hooking in events, and LivingEntites have to listen for methods in ServerPlayerEntity and PlayerEntity (which are also separate to the Fabric API) in their Mixins for hooking in events - and there isn't a method that focuses on the onPlaced method - in fact the onPlaced method is never accessed to any classes accesible to the Fabric API so this is pretty much impossible to implement without a very hacky solution or attempting to modify the Minecraft packages. For now I'd suggest possibly just creating classes that extend Block and use those instead until something like this could be solved.