CommandItems - Item based commands, permissions, cooldowns and more!

This is a discussion topic for the Ore project, CommandItems. View the full project on Ore for downloads and more information.


Want quick support? Join my discord server: https://discord.gg/YttMwEr

CommandItems

CommandItems is a simple Sponge plugin that aims to bring the command items features from the old CraftBook plugin to Sponge. With this plugin, you can have custom items that can be used and execute commands, consume the item, execute only on right or left click, execute commands as player/console, etc!

Setup

The plugin is drag and drop: once it loaded, edit the config as you like. If you want to add more items to the config, use /citems create in-game so it creates a new item with the specified name and inserts in the current config.

Commands and Permissions

  • /citems create [name] | commanditems.create | Creates a item on your config
  • /citems give [name] [amount] [player] | commanditems.give | Gives [amount] keys named name for you or player, if specified. The item can be created via /citems create [name] (see above), or you can rename the name in the config to another name and use it here.
  • /citems | commanditems.main | Main plugin command, lists the other commands and their usage

Download

You can download this plugin on Ore: Eufranio / CommandItems

If you find any issues, report them to the plugin’s issue tracker. If you want, you can donate for me trough PayPal, my paypal email is [email protected].

2 Likes

This plugin is simply… AMAZING <3
I hope @Eufranio can do what I told him :smiley:

You can update it to API 7

does this have support for like item damage and such? Would love to combine this with your spongybackpacks plugin and use a texture pack for creating different physical backpacks.

Nope, but I see that being useful. Mind opening a ticket in the github repo so I can take a look on it later?

ok will do, and one other question. I see you have permission=“backpack.large” here. Is it possible to make it remove the item from a players inventory upon trying to use it if they no longer have permission? I do see theres the general consume option but my goal here is to create upgrade-able backpacks and I’ve got 75% of it completed using the 2 plugins in conjunction. if it doesnt already do this i take it i should create a ticket aswell? just want to confirm before i do incase im just overlooking something.

Hello, can you update this plugin to API7?
Can I add a citems give UUID player amount command?
Can I change citems newkey to citems create name?

A new version has been released for CommandItems, it is available for download here.


Update SpongeAPI version
Change /citems newkey to /citems create
Add amount to /citems give

What would the configuration will be like to hit with the right button and freeze the hit player Using the nucleus /freezeplayer command?

I cant use this plugin, everytime i right click with an item ive made or even the default stone it says “you don’t have permissions to use this item!” am i missing something? im op’d and owner on my server and have luckperms

[13:18:59] [Server thread/WARN] [Sponge]: /*                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /* Since the event can be modified during the event's listener, there could be adverse side effects of the exception occuring
such that duplications or other game breaking issues could exist.
Due to the nature of the exception, this is not likely an exception
that is covered by SpongeForge or Forge itself, and therefor should
be reported to the mod/plugin author first prior to reporting to
Sponge or Forge. */
[13:18:59] [Server thread/WARN] [Sponge]: /* Owning Mod/Plugin: commanditems                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /* Exception:                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /* java.lang.ArrayIndexOutOfBoundsException: 1                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     io.github.eufranio.commanditems.config.CommandItem.proccess(CommandItem.java:86)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     io.github.eufranio.commanditems.CIListener.onItemInteract(CIListener.java:21)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.listener.InteractItemEventListener_CIListener_onItemInteract396.handle(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:381)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:345)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.extendedPost(SpongeModEventManager.java:446)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:415)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:465)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:247)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.SpongeCommonEventFactory.callInteractItemEventSecondary(SpongeCommonEventFactory.java:833)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.management.PlayerInteractionManager.func_187250_a(PlayerInteractionManager.java:999)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.NetHandlerPlayServer.redirect$impl$checkStateAfter$zih000(NetHandlerPlayServer.java:2957)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:765)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.play.client.CPacketPlayerTryUseItem.func_148833_a(SourceFile:32)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.play.client.CPacketPlayerTryUseItem.func_148833_a(SourceFile:9)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.tracking.phase.packet.PacketPhaseUtil.onProcessPacket(PacketPhaseUtil.java:209)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.PacketThreadUtil$1.redirect$impl$redirectToPhaseTracker$zkp000(SourceFile:540)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     java.util.concurrent.FutureTask.run(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.util.Util.func_181617_a(SourceFile:529)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:308)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.redirect$onRun$zjd000(MinecraftServer.java:4716)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:723)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     java.lang.Thread.run(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

(Moderator edit: cleaned up formatting)

[13:18:59] [Server thread/WARN] [Sponge]: /*                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /* Since the event can be modified during the event's listener,
 there could be adverse side effects of the exception occuring
such that duplications or other game breaking issues could exist.
Due to the nature of the exception, this is not likely an exception
that is covered by SpongeForge or Forge itself, and therefor should
be reported to the mod/plugin author first prior to reporting to
Sponge or Forge. */
[13:18:59] [Server thread/WARN] [Sponge]: /* Owning Mod/Plugin: commanditems                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /* Exception:                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /* java.lang.ArrayIndexOutOfBoundsException: 1                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     io.github.eufranio.commanditems.config.CommandItem.proccess(CommandItem.java:86)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     io.github.eufranio.commanditems.CIListener.onItemInteract(CIListener.java:21)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.listener.InteractItemEventListener_CIListener_onItemInteract396.handle(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:381)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:345)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.extendedPost(SpongeModEventManager.java:446)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:415)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:465)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:247)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.SpongeCommonEventFactory.callInteractItemEventSecondary(SpongeCommonEventFactory.java:833)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.management.PlayerInteractionManager.func_187250_a(PlayerInteractionManager.java:999)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.NetHandlerPlayServer.redirect$impl$checkStateAfter$zih000(NetHandlerPlayServer.java:2957)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:765)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.play.client.CPacketPlayerTryUseItem.func_148833_a(SourceFile:32)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.play.client.CPacketPlayerTryUseItem.func_148833_a(SourceFile:9)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.event.tracking.phase.packet.PacketPhaseUtil.onProcessPacket(PacketPhaseUtil.java:209)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.PacketThreadUtil$1.redirect$impl$redirectToPhaseTracker$zkp000(SourceFile:540)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     java.util.concurrent.FutureTask.run(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.util.Util.func_181617_a(SourceFile:529)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:308)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.redirect$onRun$zjd000(MinecraftServer.java:4716)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:723)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /*     java.lang.Thread.run(Unknown Source)                                                                                                       */
[13:18:59] [Server thread/WARN] [Sponge]: /***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

(Moderator edit: cleaned up formatting)

Is there a faster way to create and test items other than restarting the server?

You can use /sponge plugins reload commanditems.

A new version has been released for CommandItems, it is available for download here.


  • Rewrote most of the plugin
  • Added -d flag to the give command that drops the remaining items into the ground if not all items could be delivered

A new version has been released for CommandItems, it is available for download here.


  • Fix error when using the SQL storage type

A new version has been released for CommandItems, it is available for download here.


  • Fix the config not loading on newer Sponge versions