本文整理匯總了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");
}
}
}