Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement vanilla commands #126

Open
rom1504 opened this issue Nov 25, 2015 · 23 comments
Open

Implement vanilla commands #126

rom1504 opened this issue Nov 25, 2015 · 23 comments

Comments

@rom1504
Copy link
Member

rom1504 commented Nov 25, 2015

http://minecraft.gamepedia.com/Commands#Summary_of_commands

16/58

status name difficulty comments test
/achievement
done /ban
done /ban-ip
/banlist easy
/blockdata
/clear
/clone
/debug
/defaultgamemode easy
done /deop done
done /difficulty easy pretty close to gamemode
/effect
/enchant
/entitydata
/execute
/fill  similar to /setblock, interesting
partial /gamemode easy should use the names of modes instead of numbers
/gamerule
/give
partial /help should have pages and all like vanilla done
done /kick
done /kill done
/list easy
/me
done /op done
done /pardon
done /particle done
done /playsound done
/publish
/replaceitem
/save-all
/save-off
/save-on
/say
/scoreboard
/seed easy
done /setblock done
/setidletimeout
/setworldspawn
/spawnpoint
/spreadplayers
/stats
/stop easy
partial /summon done
/tell easy
/tellraw
/testfor
/testforblock
/testforblocks
done /time
/title
/toggledownfall easy
done /tp done
/trigger
partial (#240) /weather easy
/whitelist
/worldborder
done /xp done
@109C
Copy link
Contributor

109C commented Nov 26, 2015

I think they should be implementing in a plugin separate from the main repo, but installed by default.

@rom1504
Copy link
Member Author

rom1504 commented Nov 26, 2015

That might be a good idea indeed since, unlike other (internal) plugins, nothing depends on commands.

@demipixel
Copy link
Contributor

Hmm. From a plugin standpoint, I would expect

for (var c of player.commands) {
  player.commands[c].disabled = true;
}

@rom1504
Copy link
Member Author

rom1504 commented Nov 28, 2015

would be nice to put commands in api.md (or a commands.md idk). Would make it easier to know all the commands available during dev.

@rom1504
Copy link
Member Author

rom1504 commented Nov 30, 2015

We need target selector too. They'll be useful for /kill and /attach

@demipixel
Copy link
Contributor

just btw /attach isn't a real command...

Also, what format do you want for target selectors? For example, do we want to allow

new TargetSelector({
  selector: 'entity',
  type: 'player',
  position: X,
  radius: 4
});

And then deal with the text processing afterwards?

@rom1504
Copy link
Member Author

rom1504 commented Nov 30, 2015

Yeah I know it's not really a command, but it's useful for testing, once attaching is properly implemented, /attach can go in a plugin.

Are target selectors useful in the code ? I mostly meant we need them in command parameters (as in /kill @e)

Edit: ah but yeah we could define such a class to make it easier to process them once parsed.

@demipixel
Copy link
Contributor

Well, we've been using whitelist/blacklist for no (arrays of players). The only positive about a selector is that the "array" can change (hence the use of it in command blocks. Command blocks are set once but entities they affect can change).

@rom1504
Copy link
Member Author

rom1504 commented Nov 30, 2015

ah ok, yeah that makes sense

@demipixel
Copy link
Contributor

Then again, I don't think we need it for plugins. Command blocks will be parsed each time they're run, so we just recalculate the arrays then. Whitelist/Blacklist is easier to handle.

@rom1504
Copy link
Member Author

rom1504 commented Dec 6, 2015

thanks @azastrael for doing the /tp command

I think we should do a list of commands to do here with [ ] , to keep track of progress.

@rom1504
Copy link
Member Author

rom1504 commented Dec 6, 2015

I put the list in the first post

@rom1504 rom1504 added the chat label Dec 7, 2015
@demipixel
Copy link
Contributor

Started selectors (incomplete) on /demipixel/flying-squid "selector" branch

@rom1504
Copy link
Member Author

rom1504 commented Dec 7, 2015

I added "easy" labels for some commands that are pretty easy (for example because they don't require any new flying-squid feature)

I think this is a good starting point for new contributors.

@rom1504
Copy link
Member Author

rom1504 commented Dec 7, 2015

I added tests for a good portion of the currently implemented commands.
These commands tests are pretty easy to write and understand (see https://github.com/mhsjlw/flying-squid/blob/master/test/mineflayer.js#L93).

For new added commands, it would be nice to add such a test with it.

@rom1504
Copy link
Member Author

rom1504 commented Dec 9, 2015

selectors are mostly done (by @demipixel ), now we can use them in commands :)

@ghost
Copy link

ghost commented Dec 9, 2015

@rom1504 should this be in the TODO.md?

@rom1504
Copy link
Member Author

rom1504 commented Dec 9, 2015

no, issues are better really.
TODO.md is useful for a very general roadmap maybe (like currently)

@ghost
Copy link

ghost commented Dec 9, 2015

Ok

@demipixel
Copy link
Contributor

I think /me and /say would be easy.

Also, if you're not new to the project, don't do the easy ones. Thanks.

@rom1504
Copy link
Member Author

rom1504 commented Dec 25, 2015

It would be nice to add an explanation into how to add a new command in the api.md. Take an example (like

player.commands.add({
) and add comments around it to explain what is what.

@rom1504
Copy link
Member Author

rom1504 commented Aug 18, 2016

done in 6040a4a

@kotinash
Copy link
Contributor

kotinash commented Mar 2, 2022

Remove /publish command because it is available only in singleplayer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants