No to czesc, dostalem sie do java pluginu Skript, co mam zedytowac zeby wiadomosc gdy nie ma takiego gracza byla: "Uzyj komendy: (komenda)"
/* 765 */Classes.registerClass((newClassInfo(Player.class,"player"))/* 766 */.user(newString[]{"players?"/* 767 */}).name("Player")/* 768 */.description(newString[]{"A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player.",/* *//* 770 */"You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly."/* *//* *//* 773 */}).usage(newString[]{""/* 774 */}).examples(newString[]{""/* 775 */}).since("1.0")/* 776 */.defaultExpression((DefaultExpression)newEventValueExpression(Player.class))/* 777 */.after(newString[]{"string","world"/* 778 */}).parser(newParser<Player>()/* */{/* */@Nullable/* */publicPlayer parse(String s,ParseContext context){/* 782 */if(context ==ParseContext.COMMAND){/* 783 */if(s.matches("(?i)[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}"))/* 784 */returnBukkit.getPlayer(UUID.fromString(s));/* 785 */List<Player> ps =Bukkit.matchPlayer(s);/* 786 */if(ps.size()==1)/* 787 */return ps.get(0);/* 788 */if(ps.size()==0){/* 789 */Skript.error(String.format(Language.get("commands.no player starts with"),newObject[]{ s }));/* */}else{/* 791 */Skript.error(String.format(Language.get("commands.multiple players start with"),newObject[]{ s }));/* 792 */}returnnull;/* */}
Pytanie
AxonGames 5
No to czesc, dostalem sie do java pluginu Skript, co mam zedytowac zeby wiadomosc gdy nie ma takiego gracza byla: "Uzyj komendy: (komenda)"
Odnośnik do komentarza
Udostępnij na innych stronach
6 odpowiedzi na to pytanie
Rekomendowane odpowiedzi