Posted July 30, 201510 yr I made a mod which can open a remote TileEntity (previously right-clicked) and you can have full interaction with it. But a lot of them like Furnaces and Workbenches have a function that checks for player position called isUsableByPlayer(EntityPlayer player), I want to make it return true, however I cannot override a vanilla class so, what how can I fix this? Thank you, Alvaro.
July 30, 201510 yr Subscribe to net.minecraftforge.event.entity.player.PlayerOpenContainerEvent, you can ALLOW/DENY opening any type of container of any mod or vanilla itself. Note: It also allows you to DENY opening given container and do any other action (e.g write chat msg or open other container). Hopefully you know how to use events, if not - use google (plenty of tuts). Quote 1.7.10 is no longer supported by forge, you are on your own.
July 30, 201510 yr Author On 7/30/2015 at 2:58 AM, Ernio said: Subscribe to net.minecraftforge.event.entity.player.PlayerOpenContainerEvent, you can ALLOW/DENY opening any type of container of any mod or vanilla itself. Note: It also allows you to DENY opening given container and do any other action (e.g write chat msg or open other container). Hopefully you know how to use events, if not - use google (plenty of tuts). Thank you, I register the event and created and it works but the event is being called all the time not just when the player opens a container is that normal?. I just dont want to create unnecessary checks but if its normal Im good. Thanks
July 30, 201510 yr Author On 7/30/2015 at 1:20 PM, diesieben07 said: Yes, that is normal. The player checks if the container can be open every tick and you can intercept it every tick. Thank you!
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.