New Feature: Custom Chat Commands

  • hmm, no idea why, I tried to implement it to my server, but as soon I placed the .cs file into the mods folder, the server throws endless error messages and crashes :(

  • @Ubivis When I spoke to nfuller about the chat commands last week, I was told it isn't possible until the new build is out or you shoehorn the chat related mod code back into the first alpha build.

    I do not believe what is called "Alpha 1.0" or the original version number has the feature available.

  • Ah yes sorry, should have been more clear. This is coming out in the soon™ build.

  • Ah, thank you... read like a tutorial on how to apply this as a mod ;)

  • Do we keep the class as named MyCustomChatCommandHandler, or are we supposed to give it a new name? I tried the code you posted (but with "tppos" instead of "move" and TPPosCommandHandler instead of the original), and it didn't work.

    Any clue what's wrong? :)

  • @anna naming shouldn't be matter at all as long as you implement IChatCommandHandler interface.
    And as long as you hosted server and you logged into that server it should works fine.
    Try setting position line with this.
    player.SetPosition(new Vector3(Convert.ToInt32(pos[0]), Convert.ToInt32(pos[1]), Convert.ToInt32(pos[2])));
    Let me know it still doesn't' work

  • I think one of my problems was I left out commas when testing out the command, actually. To handle three different inputs (/move 100 100 100, /move 100, 100, 100, or /move 100,100,100), would I have to make three different if statements, or...?

  • @anna var pos = args.Split(new[] { ',' }, 3); this will seperate "100, 100, 100" into {"100" , "100" , "100"} if you want to use 100 100 100 as input there is no ',' so it can't seperate. Furthremore if you use /move 100, 100, 100, it will be {"100","100","100,"} which "100," is not a number so don't want to do that

  • @SLG_K Thank you!!

  • Hi, what are the min-max values for Eco position coordinates? Certain coordinates crash the server I'm playing on when I use /move.

    (Also - I would like to suggest enabling the !isAdminPlayer part for the /move command because server owners don't really know that they have the /move command enabled on their server automatically in the Mods>Misc folder. So anyone can use /move on any server where the owner hasn't poked around in the files.)

  • @anna depends on world generation size. Each chunk currently is 12x12x12 blocks, so generating a world of size 50x50 is 600x600 in size ([0-599, 0-599] in coordinates)

  • @Metachronism Thank you!

  • Is there some sort of player.disconnect or something? I am trying to make a kick command and even a ban command....

  • Howdy Not yet. There is some addition to the api that needs to be done to make this work ;)

  • The best you can do right now if you want to ban somone is blacklist them and restart the server

Log in to reply