Removing holograms

Discussion in 'Plugin Development' started by Deleted user, Nov 20, 2015.

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

    Deleted user

    so i just finished a command for my plugin that lets the player create a hologram msg.
    Now the plugin works but i have a problem,you cant remove the hologram if you mistype it,
    I just want to know what the code would look like if i wanted to create another command to remove the hologram

    In case you dont know what im talking about:
     

    Attached Files:

  2. Offline

    Scimiguy

    @XX_Chris406_XX
    sounds like a problem with your code tbh, maybe you should show us that instead

    Also, we won't write code for you. That's not why we're here
     
  3. Offline

    Deleted user

    No I'm not saying that. I'm asking how would you do it , would you start a new class?

    I have a command that lets you create a hologram in the pic. But I want to add a separate command that if you do /Hgram remove (name) than it will remove the hologram
    This is the code that I have to create the hologram

    I'm wondering how I would make the delete part of it. I'm really new to Java so what parts should I change?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 20, 2015
  4. Offline

    Zombie_Striker

    @XX_Chris406_XX
    Well, that's certainly an interesting way of posting code.

    Why are you using alternate chat colors instead of ChatColor.COLOUR;

    To add a new command, check if the cmd.getName().equalsignorecase(the new command). To add a new arg, just check if the arg is whatever you're testing for.

    Please us the Insert>Code tags in order to post your whole class next time.
     
  5. Offline

    Scimiguy

    @Zombie_Striker
    Correction:
    To add a new command, create a new class for it and register it as the CommandExecutor ;)
     
    Deleted user likes this.
  6. Offline

    Zombie_Striker

    @Scimiguy
    You Can, or to save memory space you can check for both commands in the onCommand in the "main" class (the one that extends Javaplugin)
     
  7. Offline

    Scimiguy

    @Zombie_Striker
    If your server is that low on space, you should be removing entire plugins or increasing your RAM allocation. Creating a new CommandExecutor class will take very little new memory
     
Thread Status:
Not open for further replies.

Share This Page