Jump to content

TuSKe menus letting people put items in guis into their inventory


DeltaRays

Recommended Posts

In the Minecraft 1.16.1 update a feature to swap offhand items by pressing F while hovering over items in an inventory was added.

This feature isn't blocked by TuSKe menus, so if someone were to press F while hovering over items in a TuSKe menu they would be able to get their item into their offhand and then utilize it. Me and Nichxlxs found how to prevent that bug from happening and here is the code on how to do it:

on inventory click:
  if inv name of event-player's current inventory contains "Shop":
    if "%event-inventoryaction%" = "unknown":
      cancel event
#This one will make it so if they have an inventory named Shop open they won't be able to press F to swap items,
#and since inventory names are broken in skript it requires skBee to get the inventory name
#If you want to disable it altogether you can use
on inventory click:
  if "%event-inventoryaction%" = "unknown":
    cancel event
#which doesn't require skBee
#If you want to make it so it doesn't let them do it only if their currently open inventory has no name, you can use
on inventory click:
  if inv name of event-player's current inventory is set:
    if "%event-inventoryaction%" = "unknown":
      cancel event

 

Edited by DeltaRays
Added another example
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...