Problem with /setHome plugin

Discussion in 'Plugin Development' started by De4thpr0x4, Apr 19, 2020.

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


    Hello, i wrote a plugin to set a home.
    I want to set me a home but only i can set a home or a other player set one but i cant.
    I know that im wrote that only one home can be set but i want it that everybody only set one home.
    Thats the src-code from my

    I`am new and i`am so good with Spigot/Java.
    And sorry for my English iam German :D
    Pleas help me and make me better.

    I mean if i set a home, a other player can not set a home but i want it to set everyone one home.
    Last edited: Apr 20, 2020
  2. Offline

    timtower Moderator Moderator

    @De4thpr0x4 1. Store based on UUID, not name.
    2. Then you need to give a second argument to the command, the target player.
  3. Offline


    can you send me an example pleas
  4. Offline


    How do you know who is asking for home ? When i watch ur code, i feel like there's only one home for everybody
  5. Offline

    timtower Moderator Moderator

    cfg.set(p.getName() + ".world", world);
  6. Offline


    Also you shouldn't be embedding the color character and why are you manually serializing the position of home? Location implements ConfigurationSerializable, so you can just do
    cfg.set(p.getUniqueId() + "." + args[0].toLowerCase(), p.getLocation());

    I wrote that assuming you switch to UUID which is better, and that you actually use the name that is given. I noticed in your code you require a name be passed, but nowhere do I see you using it save for the message at the end.
Thread Status:
Not open for further replies.

Share This Page