Jump to content

Set Entities to Glow Green?


Neoka

Recommended Posts

Hi, i'm trying to do something that should be fairly simple. All I want to do is get players in a radius, have them pass a certain check and if they pass make them glow green with Minecraft's spectral arrow effect. Here is what I've come up with:

 

Create a team and set the color to green (This runs when the user decides to enable the feature): 

public void setupTeam() {
        team = mc.world.getScoreboard().createTeam("Guild");
        team.setColor(TextFormatting.GREEN);
        String playerName = mc.player.getDisplayName().getFormattedText();
        if(playerName.contains("]")) {
            int index = playerName.indexOf("]");
            guildName = playerName.substring(0, index + 1);
        } else {
            guildName = playerName;
        }
    }


Check in a 100 block radius for players, add them to the team and set them to glow: 

AxisAlignedBB bb = new AxisAlignedBB(mc.player.posX - 100.0D, mc.player.posY - 100.0D, mc.player.posZ - 100.0D,
                    mc.player.posX + 100.0D, mc.player.posY + 100.0D, mc.player.posZ + 100.0D);
            List<EntityPlayer> nearbyPlayers = mc.world.getEntitiesWithinAABB(EntityPlayer.class, bb);
            for (EntityPlayer player : nearbyPlayers) {
                if (player.getDisplayName().getFormattedText().contains(guildName) && mc.world.getScoreboard().getPlayersTeam(player.getName()) != team) {
                    mc.world.getScoreboard().addPlayerToTeam(player.getUniqueID().toString(), team.getName());
                    player.setGlowing(true);
                }
            }


The players are glowing, but the color is not green. I should also mention that I am only doing this client side as I wont have access to the server.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.