Clan

Discussion in 'Plugin Development' started by RexxzBR, Dec 10, 2018.

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

    RexxzBR

    Hi guys I want to know how can i code a clan system, Can anybody help me?
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    DutchJellyV2

    I'd start by making a Clann class which can store information about a clan. This information can be:
    - List of members with clan rank A;
    - List of members with clan rank B;
    * Other ranks... *
    - Name
    - Slogan
    - Claimed area
    - A clan array of allies that can't attack eachother.

    To make a clan, for example, you could make it by calling the Class constructor:
    Code:
    //Creation of a Clan object called newClan
    Clan newClan = new Clan();
    //set the name to "a new clan" using a function you made in the Clan class.
    newClan.setName("a new clan");
    //or by not using a function for it:
    newClan.name = "a new clan"
    
    I know it can be hard to start and ask the right questions. So I hope that this helps you get into the brainstorming/reseaching progress.
     
  4. For your ideas:

    Make a config file saving the uuid of a player to the rank, so that you can change this or read it later, for example, from a command.

    You're not really being specific here. If you mean the names of the players, that would go back to the config. If you're thinking about the name of the clan, that could be also read off of a config, depending on how you sort it.

    I assume this slogan would be for talking in game. Use the AsyncPlayerChatEvent for this.

    If you're thinking of something like factions, you would probably use the PlayerMoveEvent and if the playe reached the claimed area, you would let them know. Again, you should save the claimed area as a range of x,y & z values, so that you don't have to put in every block. You could also have multiple claimed areas, or exceptions (free land) inside the claimed area. How you save execute this idea is not up to me, its your plugin.

    Yeah, we are not here to spoonfeed you code. In other words, we are definitely not here to do the "brainstorming/researching progress" for you, that is your responsibility. However, if you have questions about how to code, or coding errors, this is the place.

    Javadocs
     
Thread Status:
Not open for further replies.

Share This Page