无法解析为变量是什么意思?条件包含创建变量 Double xco 的操作,该变量等于玩家坐标差“x”。在另一种情况下,我将此变量称为:“If_(xco<10){...}” 在此阶段引发错误
@EventHandler
public <ChatMessage> void onPlayerChat(AsyncPlayerChatEvent z) {
Player p=z.getPlayer();
Location I=p.getLocation();
String a=z.getMessage();
if (a.equals("word")) {
for (Player ps : Bukkit.getOnlinePlayers()) {
Location i = ps.getLocation();
if (I.getX()<0 && i.getX()<0){
double xco = I.getX() - i.getX();}
else if (I.getX()>0 && i.getX()>0 ) {
double xco = I.getX() - i.getX();}
if (I.getY()<0 && i.getY()<0) {
double yco = I.getY() - i.getY();}
else if (I.getY()>0 && i.getY()>0 ) {
double yco = I.getY() - i.getY();}
if (I.getZ()<0 && i.getZ()<0) {
double zco = I.getZ() - i.getZ();}
else if (I.getZ()>0 && i.getZ()>0 ) {
double zco = I.getZ() - i.getZ();}
if (xco<10) {
ps.playSound(ps.getLocation(), Sound.BLOCK_ANVIL_DESTROY, 1, 5);
ps.sendMessage("Test");}