Skip to content

Closing inventory with a shift-clicked clickable adds the item your inventory #30

Description

@ukulelelesheep
Clickable close = new Clickable(icon) {
	@Override
	public void clicked(Player p) {
		p.closeInventory();
	}
};

Shift clicking adds icon to your inventory. If any other inventory is opened, then the item gets removed. If the item is dropped and picked back up, then the item is not removed, allowing a player to get an infinite amount of the item.

The issue is also present if clickableInventory.forceCloseInventory(p) is used instead of p.closeInventory()

The issue is resolved if closing the inventory is in a bukkit runnable that is run 1 tick later. Some sort of error thrown if an inventory is tried to be closed inside a clickable and a clickableIventory.closeLater(int tick) method or something like that would be a sufficient work around. Or maybe there is a fault elsewhere that is causing this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions