本文整理汇总了Java中org.bukkit.entity.Player.chat方法的典型用法代码示例。如果您正苦于以下问题:Java Player.chat方法的具体用法?Java Player.chat怎么用?Java Player.chat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.Player
的用法示例。
在下文中一共展示了Player.chat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rightClick
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@EventHandler
public void rightClick(PlayerInteractEntityEvent e)
{
if (!(e.getRightClicked() instanceof Player)) {
return;
}
Player player = e.getPlayer();
Player p = (Player)e.getRightClicked();
if ((modMode.contains(player.getName())) && ((p instanceof Player)) && ((player instanceof Player)) && (player.getItemInHand().getType() == Material.BOOK)) {
player.openInventory(p.getInventory());
player.sendMessage(ChatColor.GRAY + " §6§ §rNow opening the inventory of §e" + p.getName() + ChatColor.GRAY + "§r.");
}
else if ((modMode.contains(player.getName())) && ((p instanceof Player)) && ((player instanceof Player)) && (player.getItemInHand().getType() == Material.PACKED_ICE)) {
player.sendMessage(ChatColor.GRAY + " §6§ §rAttempting to freeze §e"+ p.getName() + "§r.");
player.chat("/ss " + p.getName());
}
}
示例2: onRightClick2
import org.bukkit.entity.Player; //导入方法依赖的package包/类
@EventHandler
public void onRightClick2(PlayerInteractEvent event)
{
if(event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
Player player = event.getPlayer();
if ((modMode.contains(player.getName())) && (player.getItemInHand().getType() == Material.FEATHER)) {
player.chat("/v");
}
}
}