Jump to content

ScuffedItalian

Members
  • Posts

    1
  • Joined

  • Last visited

ScuffedItalian's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I have a simple event that when a chat message is sent the player gains the ability of flight. The PlayerAbility does not exist, how can I make this run correctly? package net.anthony.modtest; import net.minecraft.client.Minecraft; import net.minecraftforge.client.event.ClientChatEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = modtest.MOD_ID) public class modevents { public final String flyCom = ">_fly"; public void clientChatFly(ClientChatEvent event) { String msg = event.getMessage(); if(msg.startsWith(flyCom)) { Minecraft mc = Minecraft.getInstance(); PlayerAbilities abilities = mc.player.abilities; boolean canFly = !abilities.allowFlying; abilities.allowFlying = canFly; abilities.isFlying = canFly; } } }
×
×
  • Create New...

Important Information

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