다른 플러그인에서 명령을 실행할 때 플레이어 인벤토리를 지울 수있는 방법이 있는지 알아야합니다. PlayerCommandPreprocessEvent를 사용할 수 있다고 생각하지만 직접 가져올 수는 없습니다. 나는 내 문제에 대해 도움을주고 싶다.Bukkit : 다른 플러그인의 다른 명령이 실행되었을 때 Inv Invoice 만들기
public class PlayerCommandPreprocessListener implements Listener {
@EventHandler
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (event.getMessage().toLowerCase().startsWith("/otherplugincommand")) {
event.getPlayer().getInventory().clear();
}
}
}
하기 전에 사건을 정상화하는 것을 잊지 마십시오 : 명령을 확인 PlayerCommandPreprocessEvent에 대한 리스너를 만드는 것은 당신이 원하는 무엇을하고 플레이어의 목록을 지우 -