-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# NOTE Modified: Support Chat Action | ||
|
||
from minerl.herobraine.hero.handlers.agent.action import Action | ||
import minerl.herobraine.hero.spaces as spaces | ||
|
||
# TODO add more command support (things like what commands are allowed) from Malmo | ||
# TODO ensure other agents can send chats, not just first agent (again, check Malmo) | ||
class ChatAction(Action): | ||
""" | ||
Handler which lets agents send Minecraft chat messages | ||
Note: this may currently be limited to the | ||
first agent sending messages (check Malmo for this) | ||
This can be used to execute MINECRAFT COMMANDS !!! | ||
Example usage: | ||
.. code-block:: python | ||
ChatAction() | ||
To summon a creeper, use this action dictionary: | ||
.. code-block:: json | ||
{"chat": "/summon creeper"} | ||
""" | ||
|
||
def to_string(self): | ||
return 'chat' | ||
|
||
def xml_template(self) -> str: | ||
return str("<ChatCommands> </ChatCommands>") | ||
|
||
def __init__(self): | ||
self._command = 'chat' | ||
super().__init__(self.command, spaces.Text([1])) | ||
|
||
def from_universal(self, x): | ||
return [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters