Jump to content

carkey

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

carkey's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hi, I'm having a go at doing a custom HUD too but don't quite understand your code. Could you post the whole class or add some comments please? That would really help. Thanks!
  2. The arduino part isnt the problem, I've got my own thread pulling in the data and then calling MC functions. I just found setVelocity() and that seems to work thanks Is there any documentation on these sorts of things? Instead of looking at the list of all functions on 'player', is there a guide to say things like "If you want to move the player used setVelocity() etc? Thanks
  3. Okay after some searching I found player.setPositionAndUpdate() But that seems to be doing nothing for me. I get x and z from my Arduino and then do: player.setPositionAndUpdate(player.posX + x, player.posY, player.posZ + z); But nothing happens
  4. Hi, I think this is a pretty simple problem but after searching the forums I couldn't find a post about it. I'm trying to move the player using my own custom code. I've got an arduino with a joystick. I am successfully getting the data from the arduino into Minecraft and can get the player to jump with jump(). What I want to do now is use the joystick data to move the player. I've tried using just player.moveEntity(x, y, z); (Where I get 'player' from: player = Minecraft.getMinecraft().thePlayer;) but this moves the player in a jerky way. Is there a function to smooth move the player in the same way that the W key moves the player forward and A key to the left etc? Thanks for your time.
  5. Ah okay great, thanks for the info! So does it make sense to have my own thread receiving the serial data and then a locked method for faking keypresses all within the minecraft mod code (point 2. from above)? I'll have a go at looking at the KeyBindings code now and report back.
  6. Sorry for the shameless bump but there must be a way to do this right? I can think of 2 ways to do it: 1. Create a tray app (separate from the mod) which gets commands from Arduino over serial and spoofs Keyboard/Mouse commands (same as how Minecontrol etc. work). 2. Poll serial within the Mod itself and call functions/spoof keyboard/mouse from inside the Java code. I'd much prefer to do the 2nd method but I can't see how to get access to the Input polling in Minecraft. It is based on LWJGL right? So there must be a Keyboard/Mouse polling thread somewhere? Any ideas would be greatly appreciated. Thanks for your time
  7. Hello, I was wondering if anyone has tried writing code to make a custom input controller work other than spoofing mouse/keyboard events? I have used Arduino and Microsoft Gadgeteer before and written an application that sits in the tray, converting inputs into mouse/keyboard events (system-wide) but I was wondering if there was a more elegant way of doing it? For example, my controller sends strings over virtual serial port (over USB), I have written the Java code to get this stream of strings in and parse them into "button 1 pressed/button 2 released" etc. but I am new to Minecraft modding and don't see how I can then hook this data into input events within minecraft. Has anyone ever tried this? Or would know where to start? I've found this controller mod on github (https://github.com/ljsimin/MinecraftJoypadSplitscreenMod/tree/master/MinecraftJoypadSplitscreenMod/src/com/shiny/joypadmod) but I'm not quite sure where it is hooking into Minecraft. Thanks for your time!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.