Jump to content

Recommended Posts

Posted

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.

Posted

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).

1.7.10 is no longer supported by forge, you are on your own.

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.