Command.

Discussion in 'Plugin Development' started by Adelin, Feb 22, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Adelin

    Hello. I just want to add a custom command to this disguise plugin. Also, when someone is doing /disguise , his name is disguised but his rank is not. Like:
    [Owner] Adelin: Hello.
    [Owner] Adelin: /disguise
    [Owner] StrangerName: Hello.

    I hope you know what I mean. What I want? If the player type /disguise:
    [Owner] Adelin: Hello.
    [Owner] Adelin: /disguise
    [Member] Disguise: Hello.

    If the player type /undisguise:
    [Member] Disguise: Hello.
    [Member] Disguise: /undisguise
    [Owner] Adelin: Hello.

    My permissions plugin have a custom command for this.
    When the player is typing /disguise, the plugin will execute this command too with the player name:
    /manuaddv [name] prefix &6&lMember

    When the player is typing /undisguise, the plugin will execute this command too with the player name:
    /manudelv [name] prefix

    Also, nothing complicated. When someone is typing /disguise, the plugin will execute an extra command. This thing with /undisguise too. :)

    Here is the code:

    No more for you guys! :).
     
    Last edited: Feb 24, 2016
  2. Offline

    Zombie_Striker

    @Adelin
    1. DO NOT BLIND CAST! How do you know the sender will be a player (Please do not respond with 'only players will use this command ')? Please check if the sender is an instanceof Player before casting it to be a player.
    2. You should use multiple classes for handling multiple commands

    3. You created 5 instances of Random for every time you run that method. You only need one instance for any plugin. Create a random field instead of a variable and only use that one instance of random.
    As for your disguise problem: create a command, set the player's display name to be that of the disguised player, and use something like ProtocolLib to add the fake player.
     
  3. Offline

    teej107

    ThreadLocalRandom
     
  4. Offline

    Adelin

    @Zombie_Striker I don't have created this plugin. I just want to add this command, nothing else. Can't you see the credits? ' Made by MCGamer Dev Team '
     
    Last edited: Feb 22, 2016
  5. Offline

    MOMOTHEREAL

    @Adelin
    Now, how the hell did you get your hands on a private plugin made by a server network? This plugin is most probably copyrighted and/or obtained illegally, as far as I can know.
     
  6. Offline

    ShaneCraftDev

    @MOMOTHEREAL
    No, it seems to me that he obtained it legally, the original poster created a thread last month and this class was posted as comment on that thread where as he further replied he recieved this from the original author.
    link
     
  7. Offline

    Adelin

    @MOMOTHEREAL Go and ask MCGamer Developers for it. They will give it to you for money. Btw, can someone add these 2 commands or not... :( ?
     
  8. Offline

    mythbusterma

    @Adelin

    We don't support modifying others' code here. You're welcome to figure it out yourself, however.
     
  9. Offline

    mcdorli

    You know, posting something ypu got legally doesn't make it legal, see for example torrenting.
     
    Zombie_Striker likes this.
  10. Offline

    Adelin

    I just thinked this community will help me with this. Ty for this. ! <3
     
Thread Status:
Not open for further replies.

Share This Page