Where are the default craftbukkit.jar commands registered?

Discussion in 'Spigot Plugin Development' started by Technerder, Sep 10, 2017.

  1. like the title suggests i am trying to compile my own fork of CraftBukkit. i have removed a couple of command classes, however i cant find where the commands such as /seed are registered in the CraftBukkit.jar, would someone be able to tell me where they are?

    i tried checking org.bukkit.command.defaults however i couldn't find it.
     
  2. ./seed is a default vanilla command
     
  3. i know that, i am compiling my own bukkit fork and i was wondering where the command was registered and how i could remove the command from the server.
     
  4. ((CraftServer)Bukkit#getServer())#getCommandMap();

    If I am not mistaken.This article might help you if you want to register command to the commandMap
     
  5. Bump. again, im looking to remove all default minecraft/bukkit commands other than, /reload, /stop
     
  6. try reading the NMS class called MinecraftServer and locate it's command manager
     
  7. I legit gave you the answer with my previous reply...
     
  8. Just cancel the PlayerCommandPreprocessEvent and ServerCommandEvent?
     
    • Optimistic Optimistic x 1
  9. 2008Choco

    Resource Staff

    That's not the question. Read the original post before replying with useless information / attempts.

    @_ItzMikeGR_ is correct in saying that they are stored within the SimpleCommandMap instance in CraftServer. Though it's worth noting that the CraftBukkit alternatives of commands were completely abolished as of 1.8, I believe, and now use vanilla implementation. In fact, said CraftBukkit command implementations are currently deprecated in 1.12 and set for removal.

    EDIT: My bad, they were actually already removed in commit a1cc4b769ca
     
  10. MiniDigger

    Supporter

    in the Simplecommandmap you have a map called knownCommands where you can just remove by key to unregister commands.
     
  11. MiniDigger

    Supporter

    the code your are looking it is over 3 years old...
    bukkit no longer registers vanilla commands like that. so the updated source here https://hub.spigotmc.org/stash/proj...java/org/bukkit/command/SimpleCommandMap.java
    vanilla commands are registered here https://hub.spigotmc.org/stash/proj...a/org/bukkit/craftbukkit/CraftServer.java#353
    you can either modify that part of the code or just remove the commands from the simplecommandmap using a plugin. (they will be registered into this map, you can just remove them from here https://hub.spigotmc.org/stash/proj...a/org/bukkit/command/SimpleCommandMap.java#22 )
     
  12. I understand it is 3 year old code. I am currently using a 1.7 bukkit server. Would I be able to remove thise command classes, and then just remove the commands from setFallBackCommands() . I also would raver not use a plugin to remove the commands.
     
  13. To save yourself a lot of work you can disable any command in the superperms permission.yml and then even console cant use them.
     
  14. MiniDigger

    Supporter

    oh wow, why bother with stupidly outdated versions?
    I don't remember how things worked back then, but I think bukkit did just override the vanilla commands so removing the fallback commands will not do anything, you will use the inbuild commands.
    but since you are stuck in stoneage you are on your own there.
     
    #15 MiniDigger, Sep 13, 2017
    Last edited: Sep 13, 2017
    • Agree Agree x 1
  15. Well thanks anyway. Also the reason why I use 1.7 is because I personally enjoy it more, same thing with the competitive community. Might sound ridiculous and like a joke, but I gave up on Minecraft versions after 1.8.

    -- On topic --
     
    • Funny Funny x 1
    • Optimistic Optimistic x 1
  16. I did read the post, the OP is trying to remove some commands, there's really no reason to do something so complicated, when one can just cancel the relevant events, emulating the same effect.
     
  17. 2008Choco

    Resource Staff

    I don't think you read it quite well enough...
     
    • Agree Agree x 2
  18. There are so many answers,did none of them work out for you?
     

Share This Page