File tree Expand file tree Collapse file tree
src/main/java/com/laytonsmith/core/events/drivers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ public String getName() {
661661
662662 @ Override
663663 public String docs () {
664- return "{}"
664+ return "{player: <string> }"
665665 + " Fires when a player changes which quickbar slot they have selected."
666666 + " {player | to | from: the slot the player is switching from}"
667667 + " {to: the slot that the player is switching to}"
@@ -671,6 +671,10 @@ public String docs() {
671671 @ Override
672672 public boolean matches (Map <String , Construct > prefilter , BindableEvent event ) throws PrefilterNonMatchException {
673673 if (event instanceof MCItemHeldEvent ) {
674+ MCItemHeldEvent e = (MCItemHeldEvent ) event ;
675+ if (prefilter .containsKey ("player" ) && !e .getPlayer ().getName ().equals (prefilter .get ("player" ).val ())) {
676+ return false ;
677+ }
674678 return true ;
675679 }
676680 return false ;
You can’t perform that action at this time.
0 commit comments