Jump to content

[SOLVED][1.7.10]Changing name when commmand is fired and coloring string


Recommended Posts

Posted

Hello,

I have 2 questions :

1. I'm subscribing name format event for changing username when something is true ... and im changing something to true when my command is fired ... but then name format is changing only when i relog so my question is : is there a way to change it rightaway the command is pressed ?

 

2.How to color the string which will be displayed in displayname in name format event ?iv tried &6&l in lang folder but it doesnt work

 

Thx in advance :)

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

Posted

@SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)

    public void onEvent(NameFormat event)

    {

        if (event.username.equalsIgnoreCase("failender"))

        {

            event.displayname = event.username+" the modder";

        }       

       

  }

 

This works for me. As for changing colors.. I dont know sorry

Maybe show some code?

Posted

Command :

 

  Reveal hidden contents

 

 

NameFormatEvent

 

  Reveal hidden contents

 

The difference here is your name isnt changing

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

Posted

Thank you :) andcolored string ?

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

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.