A plugin for Minecraft Forge that provides an API for YouTube live chat services. This is not an official Google product.
Clone this repository, and open a terminal to the root directory. Navigate to http://files.minecraftforge.net and pick the latest or recommened MDK version. Update the mdkVersion definition in setup.gradle, then run the installMdk task:
./gradlew -b setup.gradle
Next, setup the decompiled workspace and save the build dependencies:
./gradlew setupDecompWorkspace
./gradlew saveDependencies
Build the jar:
./gradlew build
A single .jar file will be output to build/libs, e.g. ytchat-1.0.0.jar.
If you have Intellij Idea installed and plan to use it for development, perform these steps to setup the project directory.
Run the following gradle task:
./gradlew idea
Copy the YouTube Chat jar to one these folders depending on your OS:
Create a project in the Google API Console
Click Create credentials. Select OAuth client ID from the dropdown, followed by Other for the Application type.
Open the API Library and ensure that your application is registered to use the YouTube Data API.
Download the client ID JSON by clicking the following icon for your project:
Run the YouTube Chat jar from a terminal to obtain authorization credentials, pasting the downloaded json when prompted:
java -jar ytchat-1.0.3.jar login
If you want to clear your credentials or sign in as a different user, run logout:
java -jar ytchat-1.0.3.jar logout
Credentials are saved to ~/.oauth-credentials.
YouTube Chat supports the following commands in Minecraft:
/ytchat [start|stop|logout|echoStart|echoStop]
/ytcmock <mock author id/name> <mock input>
Provides mock input for testing without a YouTube live chat connection.
To use YouTube Chat, copy the jar into the libs folder of your Forge directory. Regenerate the project with gradle, or manually add a dependency to the jar in the project settings.
Add ytchat to the dependencies field in mcmod.info, e.g.:
"dependencies": ["ytchat"]
Get an instance of the YouTubeChatService interface:
YouTubeChatService service = YouTubeChat.getService();
Join the discussion group at https://groups.google.com/forum/#!forum/youtube-chat-for-minecraft