File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
modules/src/main/java/parallelmc/parallelutils/modules/bitsandbobs/minimodules Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ public void useSilenceNametag(PlayerInteractEntityEvent event) {
2222 if (!player .getEquipment ().getItem (slot ).getType ().equals (Material .NAME_TAG )) {
2323 return ;
2424 }
25- if (!(event .getRightClicked () instanceof LivingEntity entity )) {
25+ // If the player right clicked a non-living entity or a player, return
26+ // This is to prevent a player accidentally editing another player's playerdata
27+ if (!(event .getRightClicked () instanceof LivingEntity entity ) || event .getRightClicked () instanceof Player ) {
2628 return ;
2729 }
2830 TextComponent nametagName = (TextComponent ) player .getEquipment ().getItem (slot ).getItemMeta ().displayName ();
You can’t perform that action at this time.
0 commit comments