Posted December 21, 20222 yr 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; } } }
December 21, 20222 yr Player.getAbilities() ? Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.