Code Monkey home page Code Monkey logo

controllable's Introduction

Controllable Banner

Download Minecraft Curseforge

Controllable

I noticed a lack of support for controller for the Java Edition of Minecraft, this is where Controllable comes in. Controllable adds that ability into the game. This mod has been heavily influenced by the controls in the Bedrock Edition of the game, however it is much more configurable (coming soon) and supports more controllers (coming soon)! There is also an API available for mod developers to add controller support to your own mod.

Features:

  • On-screen button indicators (just like Bedrock Edition)
  • Easy inventory management
  • An easy controller mapping system to add new controllers (Coming soon)
  • Many options in config to change to your liking
  • A simple API with events for integration into third party mods.

Supported Controllers:

  • Sony PS4 Wireless Controller (via USB)
  • Other controllers coming soon!

Note: Support for other controllers will be a community effort. Once the controller mapping system is added, I will be accepting pull requests on GitHub for controller mappings. This is simply because I do not have access to different types of controllers.

Developers:

If you are a developer and want to add Controllable support to your own mod, you can simply do so by adding this to your build.gradle file.

repositories {
    maven {
        name = "CurseForge"
        url = "https://minecraft.curseforge.com/api/maven/"
    }
}

dependencies {
    compile 'controllable:Controllable:1.12.1:0.2.1'
}

minecraft {
    useDepAts = true
}

You will then need to run gradlew setupDecompWorkspace again as Controllable uses an access transformer. Once completed, you can start implementing controller support to your mod. The available events you can use are:

  • ControllerEvent.Move - This event is fired when the player is moved when using a controller. This can be cancelled. An example can be found in MrCrayfish's Vehicle Mod
  • ControllerEvent.Turn - This event is fired when the player turns it's view with a controller. This can be cancelled.
  • ControllerEvent.ButtonInput - This event is fired when a button is either pressed down initially and when it's released. This event can be cancelled and is useful for overriding default behavior. An example can be found in MrCrayfish's Vehicle Mod
  • AvailableActionsEvent - This event allows you to control the button actions that are rendered to the screen. This allows you to remove or add your own actions. This event can not be cancelled. An example can be found in MrCrayfish's Vehicle Mod
  • RenderAvailableActionsEvent - This event is fired every time the available actions are rendered. This event can be cancelled.
  • RenderPlayerPreviewEvent - The event is fired every time the player preview in the top left corner is rendered. In case this is drawing over your GUI elements, this event can be cancelled, which stops it from renderering. An example can be found in MrCrayfish's Vehicle Mod

It's best practice that when you override any of the default controls that they should be based on a certain condition. For instance, in MrCrayfish's Vehicle Mod, controls are only overridden when riding a vehicle. It does not affect normal gameplay in any way.

controllable's People

Contributors

mrcrayfish avatar xfusionlordx avatar hugoalh avatar duhnunes avatar rubenverg avatar skybird23333 avatar darkpred avatar fitfc avatar hugman76 avatar jellybean13 avatar jarrettgilliam avatar mjkim0727 avatar loweredgames avatar mertsa avatar raulsmartin avatar comp500 avatar magiczocker10 avatar natickyt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.