Damage on Swimming Plugin

Discussion in 'Archived: Plugin Requests' started by Rungario, Jan 18, 2014.

  1. Offline

    Rungario

    Suggested name: PreventSwimming

    What I want: Whenever the player enters the water and swims, he is damaged to the point where he is forced back onto land. He also receives a CONFIGURABLE message saying something along the lines of "&cYou are not allowed to swim!"

    The point of this is if, for example, you have an island on your world, you can keep the players stuck on the island and prevent them from swimming somewhere else.

    In the config, an option to change the damage and message the player receives would be encouraged :)

    Ideas for commands: No commands needed for this plugin.

    Ideas for permissions: preventswimming.adminbypass

    When I'd like it by: Soon
     
  2. Offline

    msnijder30

    I will do this for you
     
    Rungario likes this.
  3. Rungario Nice Idea. Maybe with per world configuration? So you may it enable only in certain worlds? ;)
     
    Rungario likes this.
  4. Offline

    Rungario


    Haha, the better it is...well...the better it is!

    Thanks! I await with eagerness the first testable version!
     
    Lionhard likes this.
  5. Offline

    Twisted_Panda

    Rungario
    <Edit by Moderator: Redacted mediafire url>

    Everything is configurable like you asked, you can change the enabled world and damage and the message recived.
     
    Last edited by a moderator: Nov 4, 2016
    Lionhard and Rungario like this.
  6. Offline

    msnijder30

    Twisted_Panda ...

    Could you tell me how you got color codes to work with the config? that was my only problem :p
     
    Rungario likes this.
  7. Offline

    timtower Administrator Administrator Moderator

    ChatColor.translateAlternateColorCodes('&',<original string>)
     
    Rungario likes this.
  8. Offline

    msnijder30

    timtower this is what I had:

    p.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("message")));
     
    Rungario likes this.
  9. Offline

    timtower Administrator Administrator Moderator

    That should work
     
    Rungario likes this.
  10. Offline

    msnijder30

    timtower it works, but if the config is:
    message: &aYou can't swim!

    and then I reload, it changes to:

    message: can't swim!

    it works if it is
    message: You &acan't swim!
    but that will only make "can't swim!" colored
     
    Rungario likes this.
  11. Offline

    MoeMix

    does the .replaceAll method work? if so how do you do it? O'm getting errors
     
    Rungario likes this.
  12. Offline

    timtower Administrator Administrator Moderator

    Put single quotes around the message and remove the one of the "can't"
     
    Rungario and msnijder30 like this.
  13. Offline

    MoeMix

    Rungario likes this.
  14. Offline

    timtower Administrator Administrator Moderator

    Not the issue
     
    Rungario likes this.
  15. Offline

    MoeMix

    anywayy, timtower
    does the .replaceAll method work? if so how do you do it? I'm getting errors
     
    Rungario likes this.
  16. Offline

    msnijder30

    timtower Thank you so much :D
    I have had that problem multiple times, now I know how to do it right :)
     
    Rungario and timtower like this.
  17. Offline

    timtower Administrator Administrator Moderator

    Post something on my profile page about this
     
    Rungario likes this.
  18. Offline

    Rungario

    Wow, you guys are great. You should make a project page for the plugin so that others can find and use it, even if you don't plan on ever updating it.
     
  19. Offline

    skore87

    I just thought I'd add to your idea. I think that they shouldn't be damaged upon touching water but instead a simple check to see how deep the water is and if it meets the threshold then start damaging them either while in the deep-end or until they exit the water (evil option, lol).
     

Share This Page