custom item effect 처리

itemeffect
poopki 3 years ago
parent 90f3bfded3
commit 13d55d7653
  1. 5
      itemeffect_eventhandler.java

@ -14,7 +14,7 @@ public class itemeffect_eventhandler implements Listener {
if (e.getEntity().hasMetadata("shotgun")) { //만약 화살이 명령어로 생성되었다면 if (e.getEntity().hasMetadata("shotgun")) { //만약 화살이 명령어로 생성되었다면
Arrow arrow = (Arrow) e.getEntity(); //객체를 화살로 변환 Arrow arrow = (Arrow) e.getEntity(); //객체를 화살로 변환
arrow.getWorld().createExplosion(arrow.getLocation(), 1); //화살의 착탄 위치에 폭발 생성 arrow.getWorld().createExplosion(arrow.getLocation(), 1); //화살의 착탄 위치에 폭발 생성
arrow.remove(); //화 삭제 arrow.remove(); //화 삭제
} }
} }
@ -29,7 +29,8 @@ public class itemeffect_eventhandler implements Listener {
if (item != null) { //플레이어 손에 무언가 있으면 if (item != null) { //플레이어 손에 무언가 있으면
switch (item.getType()) { switch (item.getType()) {
case BOW: //그 무언가가 활이라면 case BOW: //그 무언가가 활이라면
player.performCommand("itemeffect:shotgun"); //산탄화살 발사 player.performCommand("User_DB:shotgun"); //산탄화살 발사
}
} }
} }
} }

Loading…
Cancel
Save