Aslagon1234
대표칭호 없음
이해도 | 입문자 |
---|---|
게임버전 (JE) | 1.18.2 |
게임버전 (BE) | 관련없음 |
package kr.kro.aslagon.events;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
public class MainSumoEvent implements Listener {
@EventHandler
public void onrightclick(PlayerInteractAtEntityEvent e) {
if (e.getRightClicked().getType().equals(EntityType.PLAYER)) {
Player p = e.getPlayer();
Player ep = (Player) e.getRightClicked();
p.sendMessage("hello");
ep.sendMessage("nice to meet you");
}
}
}
초록색으로 칠한 코드가 이벤트가 작동하면 2번 나옵니다.
0reo
2022.10.30https://www.spigotmc.org/threads/playerinteractentityevent-firing-two-times.127519/
해보십셔