CC:Gamepad
No reviews yet
CC: Gamepads adds a CC:Tweaked peripheral block which lets ComputerCraft computers read real gamepad/controller input from players.
Focuses on automation and resource processing through scientific and mechanical means, utilizing systems like electricity (RF/FE/etc), air pressure, or rotation.
Includes quality of life improvements and small tweaks to enhance and customize gameplay.
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
CC: Gamepads adds a CC:Tweaked peripheral block which lets ComputerCraft computers read real gamepad/controller input from players.
The controller is read on the player client, sent to the server, and exposed to Lua through a bound Gamepad Peripheral. This works in singleplayer, LAN, and dedicated multiplayer servers.
- Minecraft 1.21.1
- NeoForge 21.1.x
- CC:Tweaked 1.117.1
- Place a
Gamepad Peripheralblock next to, or connected by modem to, a CC:Tweaked computer. - Hold a
Gamepaditem. - Sneak-right-click the Gamepad Peripheral with the Gamepad item to bind it.
- Keep the bound Gamepad item in your main hand or off hand.
- Plug in/connect with bluetooth your/a controller and run Lua code on the computer.
Up to 4 players can send input to the same Gamepad Peripheral at once. Each player gets a slot from 1 to 4.
CC: Gamepads adds a CC:Tweaked peripheral block which lets ComputerCraft computers read real gamepad/controller input from players.
The controller is read on the player client, sent to the server, and exposed to Lua through a bound Gamepad Peripheral. This works in singleplayer, LAN, and dedicated multiplayer servers. Requirements
Minecraft 1.21.1
NeoForge 21.1.x
CC:Tweaked 1.117.1
How To Use
Place a Gamepad Peripheral block next to, or connected by modem to, a CC:Tweaked computer.
Hold a Gamepad item.
Sneak-right-click the Gamepad Peripheral with the Gamepad item to bind it.
Keep the bound Gamepad item in your main hand or off hand.
Plug in/connect with bluetooth your/a controller and run Lua code on the computer.
Up to 4 players can send input to the same Gamepad Peripheral at once. Each player gets a slot from 1 to 4. Lua Peripheral
Wrap the peripheral like any other CC:Tweaked peripheral:
local pad = peripheral.find("gamepad")
Functions getPlayers()
Returns a list of connected controller states.
Each entry includes:
slot: player slot, 1 to 4
player: player name
playerId: player UUID
controllerId: client controller id
controllerName: controller name
guid: controller GUID
buttons: numbered button table
buttonNames: named button table
axes: numbered axis table
axisNames: named axis table
updatedAt: server timestamp
getState(slot)
Returns the full state table for one slot.
Throws an error if no controller is bound to that slot. isDown(slot, button)
Returns true if a numbered button is held.
Buttons:
A
B
X
Y
Left bumper
Right bumper
Back/select
Start
Guide/home
Left stick
Right stick
D-pad up
D-pad right
D-pad down
D-pad left
isButtonDown(slot, name)
Returns true if a named button is held.
Names:
a b x y leftBumper rightBumper back select start guide home leftStick rightStick dpadUp dpadRight dpadDown dpadLeft
getAxis(slot, axis)
Returns a numbered axis value.
Axes:
Left X, -1 to 1
Left Y, -1 to 1
Right X, -1 to 1
Right Y, -1 to 1
Left trigger, 0 to 1
Right trigger, 0 to 1
getAxisValue(slot, name)
Returns a named axis value.
Names:
leftX leftY rightX rightY leftTrigger rightTrigger
getMaxPlayers()
Returns 4. getButtonCount()
Returns 15. getAxisCount()
Returns 6. Events
When controller state changes, attached computers receive:
cc_events, "gamepad", slot, playerName, controllerId
Example:
local event, kind, slot, player, controllerId = os.pullEvent("cc_events") if kind == "gamepad" then print(player .. " updated slot " .. slot) end
Example Lua Program
This prints basic state for slot 1 and exits when Start is pressed.
local pad = peripheral.find("gamepad") if not pad then error("No gamepad peripheral found") end
print("Waiting for gamepad input...")
while true do local event, kind, slot, player = os.pullEvent("cc_events") if kind == "gamepad" and slot == 1 then local lx = pad.getAxisValue(1, "leftX") local ly = pad.getAxisValue(1, "leftY") local a = pad.isButtonDown(1, "a") local b = pad.isButtonDown(1, "b")
term.clear()
term.setCursorPos(1, 1)
print("Player: " .. player)
print(("Left stick: %.2f %.2f"):format(lx, ly))
print("A: " .. tostring(a))
print("B: " .. tostring(b))
print("Start exits")
if pad.isButtonDown(1, "start") then
break
end
end end
Multiplayer Notes
Controller input is only accepted from the player who sent it.
The player must be holding a Gamepad item bound to the target peripheral.
Controller IDs and GUIDs are verified server-side.
Packet sizes, string lengths, button counts, axis counts, and axis values are validated before the state is accepted.
Player state is cleared when they disconnect or when their controller list changes.
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers