Inactive [FUN] ItemCommands v1.15 - Command Hotkeys Using Inventory[1060]

Discussion in 'Inactive/Unsupported Plugins' started by Cutch, Apr 23, 2011.

  1. Offline

    Cutch

    ItemCommands - Command Hotkeys, Using Inventory
    Version: v1.15
    Works with Permissions v2.7.4 - 3.x, Help 2.4 and iConomy 4.xx-5.0

    Check this plugin out at BukitDev
    It is now maintained by Belf

    Description
    Allows a user or admin to set commands that can be triggered when left/right clicking with the selected item or slot. You also have the choice to set items or money to be consumed, or given to a player. It also has the ability to run commands a user does not have permissions for.

    Features

    • Works with Permissions and Basic Customizable OP support
    • Bind a command to a item/slot in your hand
    • Ordering if no item is found a slot command is run, and vice-versa
    • Use left and right mouse buttons to triggers commands
    • Allow a Global control/command list or Player
    • Can also send a message to a player instead of a command
    • Can enable or disable the original click events after running a command
    • Has the ability to consume or give items/money on command run
    • Colours, Random and String Replacements
    • Multiple Commands per binding
    • Cooldowns per command
    • Allow and Deny Commands for different materials
    Download: ItemCommands.jar


    Source Page --- Help Page
    If you find any errors just PM me the stack thx

    Todo
    • Add Per Group Command Support
    • If you have any suggestions post or pm me
    Known Bugs

    • None at the moment hopefully :)
    Commands / Permissions (open)


    /icmd #Shows this help in game with only commands you can use
    ICmds.create
    /icmd add [-i item|-s slot] <flags> [command] #Add command
    /icmd remove [id] #Remove command by ID
    /icmd change [id] <flags> #Change properties of IDs command
    /icmd swap [id #1] [id #2] #Swap commands by ID (Commands with a smaller ID are run first)
    /icmd flags #Shows flags and their usage
    ICmds.use
    To be able to use a Command!
    /icmd list <-i item|-s slot> <-g global> #List commands available
    ICmds.admin
    /icmd bind (add|set|remove|list)
    /icmd reload
    ICmds.super gives a player the ability to run any command even without permissions (Not Recommended to use with the ICmds.create node)
    ICmds.super.global gives a player the ability to run any global icmd command regardless of permissions
    ICmds.free allows the running of commands without money or reagents
    ICmds.global node for global command changes
    Changelog:
    v1.15:
    Added /icmd bind (add|set|remove|list)
    Support for Permissions 3
    v1.14:
    Added random replacements <a|b|...|c>
    Added options for multiple commands:
    -al (all) -cy (cycle) -ra (random) -sh (shuffle)
    Added a * option to consumables takes item from hand
    Changelog (Cont.) (open)
    v1.13:
    Added an internal /wait [seconds] <command/message> command
    Added random integer replacement <n1-n2> (random number between n1 and n2 inclusively)
    v1.12:
    Small update, added cooldowns for each commands
    Updated for 766
    v1.11:
    Consumables are now working
    Supports iConomy v5.0
    Added ICmds.super gives a player the ability to run any command even without permissions
    Added ICmds.super.global gives a player the ability to run any global icmd command regardless of permissions
    ICmds.free allows the running of commands without money or reagents
    v1.1 Pre-Release:
    Introduce ID System and Flag System for Clean Syntax (Still /icmd)
    Added Colours and String Replacements
    Added ICmds.global node for global command changes
    Multiple Commands per binding (Macros)
    Console Commands Work
    v1.02:
    Updated for 740
    Changed command ic -> icmd conflict with CraftBookCircuits
    Fixed permission documentation
    v1.01:
    Added ability to enable or disable click events
    Added ordering if the current binded slot/item has no command, a binded item/slot will be run
    This plugin was created from The Plugin Request Pages thx Mr.Magical [cake]
     
    Slaughtz, cee, Janb and 1 other person like this.
  2. Offline

    MrMagical

    Works just as expected and it's awesome.
    I'll be using this to create a more immersive, command-less experience and make administration easier.
    Me and the ~100 players on my server thank you for this. [diamond]
     
  3. Offline

    Afatsum

    I scripted a lightning command from a weather plugin to a book's right click
    Result = Swearing friends ;)
     
  4. Offline

    Janb

    Any plans for an option to consume the item on use?
     
  5. Offline

    Cutch

    Yep added with 1.01 use the /ic clickevent t/on function to set whether items will be placed, and consumed normally :)
     
  6. Offline

    MrMagical

    Ideas:
    • Allow different commands for each click type.
    • Clean command syntax:
    Commands (open)

    No commands which temporarily flip individual settings (like now).
    Everything is specified when adding or removing a command.

    /addic [-r|-l] [-c] [-g] <Command>
    Binds <Command> to current slot/item.
    If slot is empty, bind to slot.
    If slot contains an item, bind to item.
    -r/-l for Left/Right click (otherwise use default from config)
    -c to not abort the normal click event (default to aborting)
    -g to make it global (default to per-player)

    /remic [-r|-l] [-g]
    Removes binding to current slot/item.
    If slot is empty, unbind slot.
    If slot contains an item, unbind item.
    -r/-l for Left/Right click (otherwise use default from config)
    Only needed if different commands for each click type are implemented.
    -g to edit the global config (default to per-player)

    /ic [list|reload]
    Displays help for the plugin by itself.
    list to display a list of item commands avaliable
    reload to reload the list of item commands
     
  7. Offline

    Janb

    What I'm hoping for is something that will do the wonderful things your mod does but also allows the item to be consumed, even if it's not normal behavior. So for example you right-click a feather and you do some wonderful thing, but also the item is deleted on use, sorta like a reagent.

    I'll install it and see what you mean, I've been wanting something like this forever! Thank you!
     
  8. Offline

    Cutch

    All 3 are great ideas, and will be featured in the next release, give it a couple days as im also on multiple commands per item/slot and an id system.

    Apparently with the last build I thought that having the flip for all of the original create nodes would be a good idea so changed the documentation but didnt change the code :eek: so the command nodes for 1.01 are the same as 1.0
     
    Janb likes this.
  9. Offline

    MrMagical

    Would be a bit useless unless you block the command from being typed manually.
     
  10. Offline

    Cutch

    Ill see about adding super functionality so you can grant commands and maybe iConomy support
     
  11. Offline

    Plague

    Please update for latest recommended
     
  12. Offline

    Janb

    Right, like with permissions. The suggestion was based on the premise that the mod executes commands as a superuser, or has the capability to do so. :)
     
  13. Offline

    MrMagical

    The latest version crashes without iConomy, would be good to either mention that in the first post or make it work without it. :)

    "/icmd add -i /spawnmob Chicken" only adds the last word, "Chicken", as the command. It's easy to edit Commands.db if you have a little common sense, but it's still a bug?

    My server is basically command free now except for chat, documentation and admin commands. It pleases me because the overall experience becomes so much more... minecraftian.
     
  14. Offline

    Cutch

    Thx both are bugs, the second is now fixed, just going to look into the iConomy problem havn't tried without it. Will be re-uploaded soon :)

    Update: Its uploaded and both bugs are fixed
     
  15. Offline

    MrMagical

    If ItemCommands attempts to load before Permissions, it spits out this error and doesn't load:
    Error message (open)
    Code:
    21:44:27 [SEVERE] Could not load 'plugins\ItemCommands.jar' in folder 'plugin
    s':
    java.lang.NoClassDefFoundError: com/nijiko/permissions/PermissionHandler
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:160)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:191)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:115)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:100)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:260)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.nijiko.permissions.PermissionHa
    ndler
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:36)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:24)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            ... 11 more

    If I rename ItemCommands.jar to zItemCommands.jar, it seems to load properly.

    Overriding permissions didn't seem to work.
    Recieved a message about insufficient permissions when triggering the command /home with a book. I had the permission nodes ICmds.use, ICmds.super.global and ICmds.super

    Tested with: CB766, ItemCommands 1.12, Permissions 2.7 and HomeSweetHome (simple /home plugin which uses permissions).
     
  16. Offline

    Cutch

    Sorry it took so long, ive uploaded an update (No Version Change), super is tested and working with permissions ill check op support later. Thanks for the help :)
     
    MrMagical likes this.
  17. Offline

    Janb

    Awesome, thank you so much!
     
  18. Offline

    Phat32

    I am using cb740 and getting this error over and over and over:
    Code:
    2011-05-12 09:27:28 [SEVERE] Could not pass event PLAYER_INTERACT to ItemCommands
    java.lang.NullPointerException
            at com.Cutch.bukkit.ICmds.ItemCommands.checkPermissions(ItemCommands.java:1058)
            at com.Cutch.bukkit.ICmds.PlayerEvents.onPlayerInteract(PlayerEvents.java:27)
            at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:254)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
            at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:64)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:433)
            at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Nevermind. Seems witha slightly older one I just found kicking around on my server works

    RE-correction. I just updated to 766 to see if it will work and I get this error:
    Code:
    14:03:18 [SEVERE] Could not pass event PLAYER_INTERACT to ItemCommands
    java.lang.NullPointerException
            at com.Cutch.bukkit.ICmds.ItemCommands.checkPermissions(ItemCommands.java:1058)
            at com.Cutch.bukkit.ICmds.PlayerEvents.onPlayerInteract(PlayerEvents.java:27)
            at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:280)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:289)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:133)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:496)
            at net.minecraft.server.Packet15Place.a(SourceFile:57)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  19. Offline

    Cutch

    Yep thx will look into it and should be up within a couple hours.
    Now Supers not working again :p Damn Permissions
    Update: All right seems to work, OP super supports glitchy, but permission support is okay :) and errors are fixed, again no version change
    Update 2: OP super support is fixed and working and Current build should now be stable
     
  20. Offline

    Phat32

    Thanks for the update! So far it seems to be loading fine. Just wanted to point out an error I got when it was loading. It hasn't seemed to effect the plugin from working, but still just incase:

    Code:
    2011-05-13 09:24:54 [SEVERE] String index out of range: 11 loading ItemCommands v1.12 (Is it up to date?)
    java.lang.StringIndexOutOfBoundsException: String index out of range: 11
            at java.lang.String.substring(String.java:1934)
            at com.Cutch.bukkit.ICmds.ItemCommands.getVersion(ItemCommands.java:931)
            at com.Cutch.bukkit.ICmds.ItemCommands.readDB(ItemCommands.java:542)
            at com.Cutch.bukkit.ICmds.ItemCommands.onEnable(ItemCommands.java:78)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:632)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:218)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:116)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:94)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
     
  21. Offline

    Rurikar22

    Another feature that would be amazing is if you could bind multiple commands to an item and have it pick one of them randomly.

    This alone combined with other mods would do some amazing things.

    Warp to a random place.

    Russian Roulette, 1/6 chance to hit yourself with lightning!

    Random Block of Color.

    One more quick request. Can you make a way so that the commands are "Global" in the sense that once you make a binding, everyone can use it?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  22. Offline

    Cutch

    This is already implemented just use the -g flag and make sure u have the ICmd.Admin node.
    As for the random idea ill work on that next its a good feature, as of 2 seconds ago fixed a couple bugs and added a small random feature <n1-n2> is replaced with a random number between the two inclusively.
    Ex: /icmd add -s /i 35:<0-15>
     
  23. Offline

    Rurikar22

    The power of this mod gets me really excited by the way. I can't wait to put this into full force once we get it all setup.

    Another option if you have time is a /wait command. So for example we could have an item that uses the /vanish mod but after 10 seconds it types it again and you reappear. Or how about /sphere 20 5 command with world edit giving you a shield of glass and then 5 seconds later a simple undo. Stuff like this with a wait would open up thousands of combinations.

    This mod can REALLY maximize the ease to use and configurations of all command based mods. I'm really pumped for what your doing here keep it up!
     
  24. Offline

    MrMagical

    Been playing with CommandHelper. It has a very powerful scripting language. ItemCommands doesn't trigger the commands created by CommandHelper.

    Edit: ...maybe it's for the best since some people would probably hack together entire psuedo-plugins (without a line of real code) if they actually worked together. :p
     
  25. Offline

    Cutch

    I can look into support I have CommandHelper but havn't tried making commands with it, ill see if adding support is worth it :) as for /wait should be appearing in the next release
    Update: Added an internal /wait [seconds] <command/message>
     
  26. Offline

    Rurikar22

    Whats the proper code for stringing commands together? I cannot for the life of me get it to work and most of the time it just "breaks" the item.
     
    Lunacy likes this.
  27. Offline

    Cutch

    You should should just add them to the same item/slot.
    /icmd add -s /heal
    /icmd add -s You have been healed!
    You can /icmd list and make sure they have the same item/slot
    They should be run together when you activate them
     
  28. Offline

    Rurikar22

    Is there currently a way to remove global commands? I'm find that if I remove ANY command the plugin breaks until I go and edit the database myself.

    Also with the stringing of commands, do it do it in the order I set? If so. You rock Cutch!
     
  29. Offline

    Cutch

    For stringing commands they go in order of IDs, if u need to change ordering use /icmd swap [id1] [id2].
    Also I think you have to select the item/slot you are trying to remove.
    As for the remove function there may be an error in it not sure if i fixed it, will look into it now.
    Update: Ya swap and remove aren't working for global commands.
    Fixed: They work now BTW you may need the ICmds.global node, wasn't in the description
     
    cee likes this.
  30. Offline

    Rurikar22

    Another thing I would mention. Global Cooldowns are shared. This creates the problem where say I make an item that players use as a "Hearth Stone" to teleport to the spawn, if I put a cooldown, everyone shares the same cooldown for it.


    Still trying to find a mod that deletes 1 of the item in your hand to make a sort of regent spell system with this too hint hint ;)

    You rock Cutch.
     

Share This Page