Posted June 28, 20187 yr This event would be called something along the lines of ItemTakeEvent, and is fired when the player tries to click on an item to move it to a different slot. It should be cancellable, and should pass the EntityPlayer and the ItemStack. I already made a fork and implemented the feature, but when I made a pull request I was notified that the way I did it would probably hinder with some mods' functions. Here is an example showing how one might use the new Event: public class FilterEventHandler { @SubscribeEvent public void onItemTake(ItemTakeEvent event) { // Stop the player from being allowed to acquire TNT through an inventory. if (event.getItemStack().getItem().getRegistryName().toString().equals("minecraft:tnt")) { event.setCanceled(true); } } } The reason I thought of this event because I am currently making a mod called InventoryFilter that allows you to write a list of regular expressions. All items that would go into your inventory are compared against this filter either as a whitelist or blacklist. I already have item pickups filtered, but when trying to filter taking items from inventories, I found out there was no event readily made for that. Hope this can be implemented! Edited July 11, 20187 yr by titanknox typo
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.