Kill Area, kills the player when enters the selected zone

Discussion in 'Plugin Requests' started by RainbowMatvey, Feb 8, 2017.

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

    RainbowMatvey

    Plugin category: Moderation and fun

    Minecraft version: 1.11

    Suggested name: KillArea

    What I want: I would like for the plugin to kill people that enter the selected area.

    Ideas for commands: /KA create (name) /KA timelimit (name) (time before death) /KA remove (name) /KA immune (optional: player)

    Ideas for permissions:
    killarea.create killarea.delete killarea.time killarea.use killarea.immune killarea.immune.others

    When I'd like it by... I DON'T CARE, TAKE YOUR TIME, but it would be nice ASAP.

    Thanks in advance! :)
     
    Last edited: Feb 8, 2017
  2. Offline

    Binner_Done

    How would you define the area for a KillArea?
     
  3. Offline

    RainbowMatvey

    It's possible to do like MVPortals maybe. If the player has Worldedit the W/E wand will be used, but if the player does not have it, the wand will be assigned to the tool the player's holding.
     
  4. Online

    timtower Administrator Administrator Moderator

    @RainbowMatvey @Binner_Done Why not based on WorldGuard region name?
    Then you can set a worldguard region, run /KA create <region name> and it will kill everybody.
     
  5. Offline

    RainbowMatvey

    I suppose that's a good idea. Thanks for the suggestion :)

    But if possible, a version without WorldGuard could be good, since I don't really use Worldguard.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 9, 2017
    timtower likes this.
  6. Offline

    crysis992

    Just a little hin in case you don't know :)
    Since WorldGuard 6.2 (or even 6.1) it is possible to register custom flags and flaghandlers, this request would be possible with flags. A kill flag would be much more user-friendly and it doesnt require any additional commands. (StateFlag for the instant kill, and Integer/Double flag for the timelimit)

    In case someone wants to do this, I've already included this feature in my private plugin, here's the code:

    The sourcecode (Just a very basic solution) (open)

    Code:
    public class KillFlag extends FlagValueChangeHandler<Boolean> {
    
        public static final Factory FACTORY = new Factory();
      
      
        public static class Factory extends Handler.Factory<KillFlag> {
            @Override
            public KillFlag create(Session session) {
                return new KillFlag(session);
            }
        }
    
        public KillFlag(Session session) {
            super(session, WGExtraFlags.kill);
        }
      
    
    
        @Override
        protected boolean onSetValue(Player player, Location from, Location to, ApplicableRegionSet toSet, Boolean currentValue, Boolean lastValue, MoveType moveType) {
            if (currentValue) {
                player.damage(40D);
            }
            return true;
        }
    
        @Override
        protected boolean onAbsentValue(Player player, Location from, Location to, ApplicableRegionSet toSet, Boolean lastValue, MoveType moveType) {
            return true;
        }
        @Override
        protected void onInitialValue(Player player, ApplicableRegionSet set, Boolean value) {
        }
    }
    
    + the main class:
    Code:
    public static final BooleanFlag kill = new BooleanFlag("kill");
        public void onLoad() {
            wg = initializeWorldGuard();
            wg = getWorldGuard();
            FlagRegistry registry = wg.getFlagRegistry();
            registry.register(kill);
        }
    [code][/spoiler]
     
    timtower likes this.
  7. Offline

    RainbowMatvey

    I'm really new with WorldGuard and I don't know ANYTHING about making plugins myself, but, uh, I guess I can try. But, wouldn't that also kill the person if they're just passing through? Is there a thing to make you immune by toggle?
     
  8. Offline

    b00pie16

    I will write this plugin for you, no dependencies.

    Edit: Someone already is.
     
    Last edited: Feb 17, 2017
Thread Status:
Not open for further replies.

Share This Page