Blocker | 1.9.x - 1.14.x | 1.3.0

You won't need any other blocker anymore!

  1. MrIvanPlays
    Tested Minecraft Versions:
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    Too lazy to do art in photoshop.

    INFO ABOUT 1.8:

    The plugin can run 1.8 version, but you should disable the potion blocking, else it won't work. If you forgot to disable it into the config, the plugin will remind you in the console :) .

    Features:
    • Blocks commands
    • Blocks items
    • Blocks potions
    • Developer API
    • Metrics
    • Custom plugins
    Click here to go to metrics page.

    Pictures. Click on the links to see them because spigot doesnt want to show em idk why.
    https://i.imgur.com/6mwM8Yy.gifv
    https://i.imgur.com/Mip0DKm.gif
    https://i.imgur.com/2JVVpf3.gifv
    [​IMG]
    [​IMG]
    [​IMG]

    Commands & Permissions:

    Code (YAML):
    commands:
      blreload
    :
        description
    : Reload command
        permission
    : blocker.reload

    permissions
    :
      blocker.bypassCommands
    :
        description
    : Bypass blocked commands
      blocker.bypassPotions
    :
        description
    : Bypass blocked potions
      blocker.bypassItems
    :
        description
    : Bypass containing of blocked items in inventory
      blocker.bypass.*
    :
        description
    : All bypass permissions
      blocker.*
    :
        description
    : All permissions

    Configuration:

    Code (YAML):
    ###################
    #     Blocker     #
    # by: MrIvanPlays #
    ###################

    # All messages
    messages
    :
      no-permission
    : "&cYou are lacking the permission node: blocker.reload"
      player-ran-blocked-command
    : "&fUnknown command. Type \"/help\" for help."
      blocked-item-removed
    : "&cYour inventory was containing disallowed item \"%item%\" which was removed from your inventory."
      blocked-potion-removed
    : "&cYou inventory was containing disallowed potion \"%potion%\" which was removed from your inventory."

    # Should update checking be proceed? (RECOMMENDED LEAVING TRUE TO GET ALL NEWEST THINGS INCOMING WITH THE PLUGIN)
    update-check
    : true

    # Do you want blocking commands?
    block-commands
    : true

    # Do you want commands that contain ':' be also blocked?
    block-commands-with-char
    : true

    # List of blocked commands
    # Some of the commands like '/me' or '/?' can't be blocked with this
    # So if you define them here or no they won't get blocked
    # but if you want to block them you should scroll a bit down
    blocked-commands
    :
     - "seed"
      - "version"

    # Do you want to have custom plugins?
    # If you disable this, you should define the plugins and pl commands in the
    # blocked-commands
    enable-custom-plugins
    : true

    custom-plugins
    :
     - "I"
      - "Just"
      - "/shrug"
      - "Why"
      - "You've"
      - "Checked"

    # Block '/me' and '/?'
    # WARNING!! This won't work if you run RankedHelp
    # Instead of the message it will send the help menu for the specific rank if you run RankedHelp
    # WARNING!! If you disable it and reload the plugin the commands will still be manipulated!!!!!!!!!!
    # To prevent that, you should restart your server!!!
    manipulate-me-and-?
    : true

    # Do you want to block certain items?
    # WARNING!! THIS DOESNT WORK WITH POTIONS!!!!!! FOR POTIONS GO A BIT DOWN!!!!!
    # Items that u can block: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html (lastest Spigot version)
    block-items
    : true

    # How often do you want the plugin to check if a player's inventory has blocked item?
    # The time is in ticks
    # 20 ticks -> 1 second
    # Why did i made this? If your server has bigger ram you can decrease the time for faster check.
    check-refresh-items
    : 20

    # List of blocked items
    blocked-items
    :
     - "TNT"
      - "FLINT_AND_STEEL"
      - "LAVA_BUCKET"

    # Do you want to block certain potions?
    # Potions that u can block: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html (latest Spigot version)
    block-potions
    : true

    # How often do you want the plugin to check if a player's inventory has blocked potion?
    # The time is in ticks
    # 20 ticks -> 1 second
    # Why did i made this? If your server has bigger ram you can decrease the time for faster check.
    check-refresh-potions
    : 20

    # List of blocked potions
    # How do we block a potion
    # blocked-potions:
    #   - "<modifier>_<the potion you want to block from the list up>:<value>"
    # The value can be: 0, 1, and 2 and do the following:
    # '0' stands for blocking the potion itself (not extended time, not 2)
    # '1' stands for blocking the extended time potion
    # '2' stands for blocking the 2 potion
    # Modifier can be: LINGERING, NORMAL, SPLASH
    # WARNING!! SOME POTIONS MIGHT NOT UPGRADABLE (SUCH AS INVISIBILITY)
    # WARNING!! IF YOU WANT TO BLOCK ALL OF THE STATEMENTS YOU SHOULD REPEAT THE VALUE TASKS
    blocked-potions
    :
     - "SPLASH_INVISIBILITY:0"
      - "SPLASH_INVISIBILITY:1"
      - "NORMAL_INVISIBILITY:0"
      - "NORMAL_INVISIBILITY:1"
      - "LINGERING_INVISIBILITY:0"
      - "LINGERING_INVISIBILITY:1"
      - "SPLASH_STRENGTH:2"
      - "NORMAL_STRENGTH:2"
      - "LINGERING_STRENGTH:2"

    Developer API:


    The developer api is made out of events. They're 3: BlockedCommandRanEvent, PlayerContainsBlockedItemEvent, PlayerContainsBlockedPotionEvent.
    Their name explains everything what they do.

    If you call them, try setting a priority also, because the plugin's running them also, because I am lazy man :D .

    Here's the defaults which can be changed (a chunk of the sourcecode):

    Code (Java):
    /*
    * This code is licensed with MIT license (https://opensource.org/licenses/MIT) with copyright
    * holder MrIvanPlays and years 2018-2019
    */


    package com.github.mrivanplays.blocker.listeners;

    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.potion.PotionType;

    import com.github.mrivanplays.blocker.Blocker;
    import com.github.mrivanplays.blocker.api.events.BlockedCommandRanEvent;
    import com.github.mrivanplays.blocker.api.events.PlayerContainsBlockedItemEvent;
    import com.github.mrivanplays.blocker.api.events.PlayerContainsBlockedPotionEvent;

    public class PluginListener implements Listener {

        private Blocker plugin;

        public PluginListener(Blocker main) {
            this.plugin = main;
        }

        @EventHandler
        public void command(BlockedCommandRanEvent event) {
            CommandSender sender = event.getWhoRanCommand();
            if (event.isCustomPlugins()) {
                sender.sendMessage(event.getPluginsOrderedMessage());
                return;
            }
            sender.sendMessage(plugin.color(plugin.getConfig().getString("messages.player-ran-blocked-command")));
        }

        @EventHandler
        public void item(PlayerContainsBlockedItemEvent event) {
            Player player = event.getPlayer();
            player.getInventory().removeItem(event.getItem());
            String materialPlaceholder = event.getMaterial().toString().toLowerCase().replace("_", " ");
            player.sendMessage(plugin.color(plugin.getConfig().getString("messages.blocked-item-removed").replaceAll("%item%", materialPlaceholder)));
        }

        @EventHandler
        public void potion(PlayerContainsBlockedPotionEvent event) {
            Player player = event.getPlayer();
            PotionType type = event.getPotionData().getType();
            player.getInventory().removeItem(event.getItem());
            StringBuilder potionPlaceholderBuilder = new StringBuilder();
            if (!event.getModifier().isEmpty()) {
                potionPlaceholderBuilder.append(event.getModifier().toLowerCase()).append(" ");
            }
            String typeLower = type.toString().replace("_", " ").toLowerCase();
            if (!event.getValue().isEmpty()) {
                potionPlaceholderBuilder.append(typeLower).append(" ").append(event.getValue());
            } else {
                potionPlaceholderBuilder.append(typeLower);
            }
            String potionPlaceholder = potionPlaceholderBuilder.toString();
            player.sendMessage(plugin.color(plugin.getConfig().getString("messages.blocked-potion-removed").replaceAll("%potion%", potionPlaceholder)));
        }

    }

Recent Reviews

  1. JJBZ03
    JJBZ03
    3/5,
    Version: 1.3.0
    The Plugin itself works, but I'm having weird feedback, like vanilla chest locks not working, command blocks not running, etc.
  2. BableBalbear
    BableBalbear
    5/5,
    Version: 1.3.0
    work like a charm. Also, there are many updates frequent and for latest version. Thank for making this! (Excuse, not good English)
  3. regitraz
    regitraz
    5/5,
    Version: 1.3.0
    Very good and complete plugin ! Hope you'll maintened it up to latest version of game
  4. RevengeForce
    RevengeForce
    5/5,
    Version: 1.2.8
    Good plugin for blocking i recommend this !
    ----------------------------------------------------------------
    1. MrIvanPlays
      Author's Response
      Thank you bro
  5. MuvooX
    MuvooX
    3/5,
    Version: 1.2.0
    I am giving it 3 stars because the plugin's code is shit. I didn't try out the plugin but I can see from the code that it would work properly.
    1. MrIvanPlays
      Author's Response
      Says a pearson with 0 posts. Also, who gave u the permission to decompile and see the source?
  6. Blake164366
    Blake164366
    1/5,
    Version: 1.2.0
    How about instead of being lazy you...I don't know put a small detail in what your plugin does? It's kinda not gonna make anyone intrested into it if they don't know what it does.
    1. MrIvanPlays
      Author's Response
      I said too lazy to do art in photoshop, not about the description. However, the description says everything about the plugin you want to know and its in good quality. Now, will you change your review, please?
  7. TheSourceCode
    TheSourceCode
    5/5,
    Version: 1.0.0
    Totally an interesting idea for a plugin! Would recommend this to anyone who needs something lite to handle some blocking!