Comments (2)
You can make it so they can't pickup any items anywhere (which would also prevent them from putting them into the top part) by attaching a global click handler:
gui.setOnGlobalClick(event -> event.setCancelled(true));
Or if you still want to allow your players to move items between the bottom part, but just not place them in the top part, you can attach a top click handler:
gui.setOnTopClick(event -> event.setCancelled(true));
Note that this also prevents any custom gui items from being picked up. If you do not want this for certain items, you can either manually override the cancellation by setting this to false again in the specific item's click handler or add checks to the global/top click handler to not cancel the event for those items.
from if.
Thank you very much
from if.
Related Issues (20)
- IllegalArgumentException: Coordinates must be in-bounds HOT 8
- GuiItem.copy do not respects previously manually provided plugin instance HOT 1
- IllegalArgumentException on Inventory creation when defining IF as library in plugin.yml instead of shading
- Support Folia
- Inventory GUIS don't sync the player inventory (1.19.4/1.20) HOT 1
- Crafting table Gui Not Getting Populated in (IF: 0.10.10 - 0.10.11) - (MC: 1.20 - 1.20.1) HOT 1
- MerchantGui not working on 1.20.1
- Hide pagination back on the first page and next on the last page HOT 1
- Calling Player#setItemOnCursor in Gui#setOnClose does not work HOT 1
- Raw index to coordinates HOT 3
- OutlinePane inside PaginatedPane doesn't register click event HOT 2
- Support Components from Adventure API HOT 1
- AnvilGui improvements HOT 4
- Profile name must not be null when trying to use Label Fonts HOT 4
- ToggleButtons dont work unless their coordinates are 0, 0 HOT 1
- Allow IF to be put in libraries block HOT 1
- Anvil GUI not working in MC 1.20.1 on v0.10.12 HOT 2
- AnvilGUI Not Working On 1.20.2 HOT 2
- Player leaving gui clears the gui for other player HOT 2
- 1.20.3/1.20.4 Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from if.