本文整理汇总了Java中org.bukkit.entity.NPC类的典型用法代码示例。如果您正苦于以下问题:Java NPC类的具体用法?Java NPC怎么用?Java NPC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NPC类属于org.bukkit.entity包,在下文中一共展示了NPC类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPlayerInteractEntityEvent
import org.bukkit.entity.NPC; //导入依赖的package包/类
@EventHandler
public void onPlayerInteractEntityEvent(PlayerInteractEntityEvent event) { Entity entity = event.getRightClicked();
if (!(entity instanceof NPC))
return;
final Player p = event.getPlayer();
event.setCancelled(true);
Bukkit.getServer().getScheduler().runTaskLater((Plugin) this, new Runnable(){
public void run(){
p.sendMessage(ChatColor.GRAY + "0o==================" + ChatColor.GREEN + ChatColor.BOLD + "MineZ" + ChatColor.GRAY + "==================o0");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "Welcome to MineZ");
p.sendMessage(ChatColor.GREEN + "This is a quick tutorial about the gamemode");
p.sendMessage(ChatColor.GREEN + "Let's get started!");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GRAY + "0o=================================================o0");
}
}, 200);
Bukkit.getServer().getScheduler().runTaskLater((Plugin) this, new Runnable(){
public void run(){
p.sendMessage(ChatColor.GRAY + "0o===============" + ChatColor.GREEN + ChatColor.BOLD + "Gameplay" + ChatColor.GRAY + "==============o0");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");// Add message here
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GREEN + "");
p.sendMessage(ChatColor.GRAY + "0o=================================================o0");
}
}, 400);
}
开发者ID:MineZDev,项目名称:MineZ,代码行数:36,代码来源:VillagerListener.java
示例2: onDisable
import org.bukkit.entity.NPC; //导入依赖的package包/类
@Override
public void onDisable() {
getServer().getWorlds().forEach(world -> world.getEntitiesByClass(NPC.class).forEach(e -> e.remove()));
}
开发者ID:DenAbr,项目名称:GlowNPC,代码行数:5,代码来源:GlowNPCPlugin.java
示例3: isNPCEntity
import org.bukkit.entity.NPC; //导入依赖的package包/类
public static boolean isNPCEntity(Entity entity) {
return (entity == null || entity.hasMetadata("NPC") || entity instanceof NPC || entity.getClass().getName().equalsIgnoreCase("cofh.entity.PlayerFake"));
}
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:4,代码来源:Misc.java
示例4: isNPCEntity
import org.bukkit.entity.NPC; //导入依赖的package包/类
public static boolean isNPCEntity(Entity entity) {
return (entity == null || entity.hasMetadata("NPC") || entity instanceof NPC);
}
开发者ID:TfT-02,项目名称:Ghosts,代码行数:4,代码来源:Misc.java
示例5: canBeShop
import org.bukkit.entity.NPC; //导入依赖的package包/类
/**
* Checks if an entity can be shop.
*
* @param entity
* the entity
* @return true, if successful
*/
public static boolean canBeShop(Entity entity) {
return entity instanceof Animals || entity instanceof NPC;
}
开发者ID:ngasull,项目名称:well-auction,代码行数:11,代码来源:EntityShopEntity.java
注:本文中的org.bukkit.entity.NPC类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论