本文整理匯總了Java中net.citizensnpcs.api.event.NPCRemoveEvent類的典型用法代碼示例。如果您正苦於以下問題:Java NPCRemoveEvent類的具體用法?Java NPCRemoveEvent怎麽用?Java NPCRemoveEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NPCRemoveEvent類屬於net.citizensnpcs.api.event包,在下文中一共展示了NPCRemoveEvent類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onNPCRemoved
import net.citizensnpcs.api.event.NPCRemoveEvent; //導入依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
void onNPCRemoved(NPCRemoveEvent event) {
NPC npc = event.getNPC();
if (npc.hasTrait(CitizensShopkeeperTrait.class)) {
CitizensShopkeeperTrait shopkeeperTrait = npc.getTrait(CitizensShopkeeperTrait.class);
shopkeeperTrait.onTraitDeletion();
}
}
示例2: onRemove
import net.citizensnpcs.api.event.NPCRemoveEvent; //導入依賴的package包/類
@EventHandler
public void onRemove(NPCRemoveEvent event) {
callHandlers("entity.remove", event, event.getNPC().getEntity());
}
示例3: onNPCRemove
import net.citizensnpcs.api.event.NPCRemoveEvent; //導入依賴的package包/類
@EventHandler
public void onNPCRemove(NPCRemoveEvent event) {
callHandlers("npc.remove", event);
}