Advertisement
Guest User

Untitled

a guest
Apr 29th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public static final ResourceLocation keybindDown = new ResourceLocation("morelayers",
  2. "keybinddefaultimplementation");
  3.  
  4. @SubscribeEvent
  5. public static void attachCapability(AttachCapabilitiesEvent event) {
  6. event.addCapability(keybindDown, new KeybindProvider());
  7. }
  8.  
  9. @SubscribeEvent
  10. public static void keybindEvent(ClientTickEvent event) {
  11. if (Minecraft.getMinecraft().inGameHasFocus) {
  12. KeybindInterface keybindInterface = Minecraft.getMinecraft().player
  13. .getCapability(KeybindProvider.capability, null);
  14. keybindInterface.setKeybindDown(Minecraft.getMinecraft().gameSettings.keyBindSprint.isKeyDown());
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement