나는 Bukkit의 config API에 대해 매우 익숙하다. 질문 : 플레이어를 나타내는 % player %와 같은 것을 포함하는 YAML 파일의 문자열을 설정하는 방법 (예 : 누군가가 구성 할 수있는 발신자 이름). config.yml에서 sender.getDisplayName()을 % player %로 파싱하는 방법은 무엇입니까?bukkit - config.yml에서 변수를 사용하는 방법은 무엇입니까?
내 코드는 바로 지금입니다 :
String message = core.getConfig().getString("message"); //Get the message from the config file
message = message.replace("%player%", player.getDisplayName()); //Replace %player% with the player's name.
ChatColor.translateAlternateColorCodes('&', message);
Bukkit.broadcastMessage(message);
내 config.yml은 다음과 같습니다
message: &6%player% just launched the cow party!
오류는 다음과 같습니다
가http://pastebin.com/8AdA5Xe1 (너무 오래)
, 더 나은 귀하의 질문에 설명 : 당신의 오류에 대해서는
– Kerooker
그 밖의 무엇을해야합니까? config.yaml 문자열의 % player %가 sender.getDisplayName() 인 것을 코드에 알리고 싶습니다. @Kerooker – MucaP
퀘스트를 작성한 방식 on, 나는 당신이 원하는 것을 이해할 수 없다. – Kerooker