Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Block place event #3687

Open
raoulvdberge opened this issue Apr 4, 2024 · 3 comments
Open

[Suggestion] Block place event #3687

raoulvdberge opened this issue Apr 4, 2024 · 3 comments

Comments

@raoulvdberge
Copy link

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

@karatebiscuit
Copy link

karatebiscuit commented Apr 5, 2024

Nevermind, misread this.

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

@raoulvdberge
Copy link
Author

Is this a serious comment?

@karatebiscuit
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants