StackBan - Ban a variety of item actions

StackBan

Ban a variety of item actions, including crafting a configured item, placing and breaking, picking up and more

:gift: Donations

Creating plugins for Sponge takes time and effort. If you enjoy the hard work I’ve put into to this please feel free to get my a cup of coffee. It is much appreciated.

Donate

:package: FEATURES

  • Multi-World support
  • Configurable item actions
  • break
  • craft
  • drop
  • modify
  • pickup
  • place
  • use

:open_file_folder: DOWNLOADS

Release: Download Here
Development Builds Download Here

:wrench: COMMANDS

/sban
/sban set
/sban remove
/sban list
/sban log
/sban whatsthis

:hammer: PERMISSIONS

stackban.cmd.sban
stackban.cmd.sban.set
stackban.cmd.sban.remove
stackban.cmd.sban.list
stackban.cmd.sban.log
stackban.cmd.sban.whatsthis
stackban.admin
stackban.log

:warning: Bugs

Known:

  • Drop action not working

If you find a bug or are having a problem with StackBan, please create a ticket at GitHub

10 Likes

A few things:

  • Why do you not inject anything? Relying on static Sponge calls isn’t a very good way to get dependencies.
  • Rather than doing tab-completion yourself, and just using String for the command arguments, why not use the types you’re trying to get? e.g. GenericArguments.catalogedElement(key, ItemType.class) GenericArguments.world(key) GenericArguments.bool(key). This also saves you the trouble of parsing them, and the worry that you might do something wrong.
  • All the stuff you’re doing with Help can be done in setExtendedDescription(Text), which is a multiline Text that shows when you hover over it in the default /help menu. Retracted, they’re subcommands and Sponge subcommand help menus suck.
  • Also on the topic of commands: I’m confused as to why you’re specifying all arguments as optional, and saying that they didn’t type the command correctly if they were left out (which is the opposite of optional).
  • You can use anything implementing Translatable, including CatalogTypes such as ItemType, directly in Text.of(), and it will use the type’s display name (and localized, too!)
  • If the CommandSource is doing something wrong, it’s recommended to throw a CommandException instead of using CommandResult.empty().
  • If there’s nothing in their main hand, why not allow them to use the item in their off hand?
  • CMDWhatsThis.java:48 confuses the hell out of me. Internally, it’s stored as a byte. You then get it as an object, call toString(), and then parse an int out of it. Why not just use .getByte(query)?
  • While using the PaginationService technically follows the same route, why not just use PaginationList.builder()?
  • Rather than iterating over a list of Text and sending each one, why not just use CommandSource#sendMessages? And for that matter, why not send a paginated list to the source even if they’re not a player? While you can’t technically click the ‘forward’ and ‘back’ buttons in a command prompt, it’s just as easy to type /page next and etc.
  • Don’t just put @First, put @Root. Otherwise, the listener will trip even if the player was only slightly related, but was the only player involved.
  • Why do you create an ItemStack from the ItemStackSnapshot? I’d think it’d be the other way around, on other events - you’re not concerned with a live stack, you’re concerned with what the stack was at a specific moment.
1 Like

Does the version 2.0.1 is compatible with 4.2.X of Sponge API?

No

What API is this compatiable with? Is this API 5 or API 4? Can I block the crafting of an item, but still allow players to use the item?

what should I do??

Usage:
/sban set [world] [itemType/ID] [–break] [–craft] [–drop] [–modify] [–pickup] [–place] [–use]

Example:
/sban set world minecraft:stone
/sban set minecraft:wool:5
/sban set global minecraft:diamond --craft --break --drop --modify --pickup --place --use

1 Like

I can use the number ID?
I don’t like Eng ID.:sweat:

Minecraft doesn’t use numerical IDs anymore, and Sponge certainly doesn’t.

It’s possible to add a custom message per every type of ban?
Example:
Craft: You can’t craft this item
Use: You can’t use this item
etc…

I like this plugin very much.I want to share this plugin in MCBBS.Can you agree with me?
www.mcbbs.net

Sure. You don’t have to ask on every plugin. Any plugin of mine you can share

thanks~:blush::blush:

it doesn’t work… 1.8.9 API 4.2.0

Does not support damage to the machine
Stone was destroyed

Please add new feature clear ban items in inventory of player because player can not remove ban items.

Inventory is not in chest and enderchest.

Its already supposed to do that…got some issues I still need to work out

Hi,

I want to deny the placing of wither skulls in one of my world.
For this I tried to use this command:
/sban set world minecraft:skull:1

In this case the player can’t hold the Item in his hand, nether he was able to pickup od drop the item. But he was able to place and break the skull.

I think the problem is, that the item has another ID than the placed block(skull)

Would you be so kind to give me any advice?

When player drop a item.It was send this message.So clutter.

1 Like

How to set config ban craft only.