Skript: Selected hotbar slot expression

Created on 5 Jan 2018  路  7Comments  路  Source: SkriptLang/Skript

Feature request

Ability to check if the item in player's hand is in a specific item slot.

Ex:

  • player is holding {_item} in slot 6
enhancement low

All 7 comments

Closed cause I thought you were talking about something else #oops

What exactly are you asking to be able to do (since IMO that syntax doesn't make much sense)? Are you asking to be able to check which hotbar slot they have selected, or to be able to check what item is in a particular inventory slot?

TL;DR: check which hotbar slot they have selected

We have a plugin that sells the item you are currently holding. If the item a player is holding is in slot 6, we want to cancel the event. As slot 6 can be a gadget (something they shouldn't be able to sell).

It's been a while since I've made a script. Basically my example is trying to check if the item a player is holding is in a specific slot in their hotbar.

Alright, so you basically want a selected hotbar slot expression that you can check, correct? Something like if player's selected hotbar slot is 6?

Yes that is correct

Sounds good, updated title to reflect that a bit better as well. I agree that this would make sense to have in vanilla Skript. For now if you're in dire need you could use SkQuery since it has this exact expression.

@Snow-Pyon Can be closed, but can you add [s] to the syntaxes? so "hotbar slots of players"

Will close since it's fixed, Snow-Pyon should have your request via tag so if he agrees with the syntax change I'm sure he'll make the update. Thanks for the reminder!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GiraffeCubed picture GiraffeCubed  路  3Comments

MrScopes picture MrScopes  路  3Comments

Snow-Pyon picture Snow-Pyon  路  4Comments

ghost picture ghost  路  3Comments

ghost picture ghost  路  3Comments