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
Commands & Permissions:
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:
###################
# 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):
/*
* 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)));
}
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta