Posted March 9, 201411 yr Is there an easy way to send a message to all the players on a server? I have a working method but it seems a bit overkill. @SubscribeEvent public void livingDeathEvent(LivingDeathEvent event) { EntityLiving entity = (EntityLiving) event.entityLiving; boolean f1 = false; if(!entity.worldObj.isRemote) { if(entity instanceof EntityDragon) { ServerProxyRF.getWorldProperty(entity.worldObj.getWorldInfo().getWorldName(), "hasDefeatedEnderDragon", false).set(true); f1 = true; } } else { if(f1) { Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "You hear screams of terror echo throughout the dimensions...")); } } } Kain
March 9, 201411 yr That second leg of your outer if will never send the message. Your local variable (f1) is always false in that leg. It only gets set true (sometimes) in the other leg. Get rid of the "} else {" and just let the code fall through to the "if (f1) ..." part. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
March 10, 201411 yr The most simple way is: (Note: This is scala code) MinecraftServer.getServer.getConfigurationManager.sendChatMsg(chatComponent) The difference between stupidity and genius is that genius has its limits. - Albert Einstein
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.