HomeJavaModsBlocker | 1.9.x - 1.14.x |
Blocker | 1.9.x - 1.14.x |
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:
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 ) ) ) ;
    }

}

Commands

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Blocker | 1.9.x - 1.14.x | is a free Minecraft Java mod. Compatible with Minecraft 1.9, 1.10, 1.11, 1.12 and newer. Downloaded 2,371 times (via Spigot). Download it and open it directly in the game.

Explore more