Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Cannot resolve symbol 'getDamage'


Recommended Posts

Hello, everyone.
I am a newbie in "java" "forge" "gradle".
Recently I want to listen to the player's health and will perform some actions once it changes. I found the file from "
CombatEntry" method from " net.minecraft.world.damagesource.CombatEntry" but when I write the behavior to listen in my class, idea prompts me "Cannot resolve symbol 'getDamage'"

  • main.java
@Mod(Utils.MOD_ID)
@Mod.EventBusSubscriber()
public class Main {
    public static DamageSource a;
    public static int b;
    public static float c;
    public static float d;
    public static String e;
    public static float f;
    @SubscribeEvent
    public static void Demo02(getDamage) {
        //CombatEntry combatEntry = new CombatEntry(a,b,c,d,e,f);
        System.out.println("sadawedawdawdawdadwa" + c);
    }
}

Is it because "forge" doesn't support "minecraft" native events, or is "getDamage" not an event that can be listened to?

Link to comment
Share on other sites

Posted (edited)

first of all basic java is required for modding minecraft
 

21 minutes ago, iYM8jXCs3pcvblTE said:

Is it because "forge" doesn't support "minecraft" native events

what did you mean by native events?

21 minutes ago, iYM8jXCs3pcvblTE said:

or is "getDamage" not an event that can be listened to?

getDamage is a method not a class nor an Event

Edited by Luis_ST
Link to comment
Share on other sites

Posted (edited)

Yes, I'm sorry, I just realized that the previous "AttackEntityEvent" was a class/event. And "getDamage" is a method. That's why I couldn't listen to this event. I have understood the reason.
Native events, meaning events from "minecraft", not "forge" or other third party events. (Ultimately what I want to say is whether "forge" can only call/listen to events from "forge" and not from "minecraft", or whether "minecraft" has no event system)
When I checked the "forge" event system in the past two days, I didn't find any events related to listening to player health, is this because if you want to listen to player health, you can only listen to it from events that may cause damage. (For example, when the player falls, I can only insert the action I want to perform into the method that will calculate the fall damage)

Edited by iYM8jXCs3pcvblTE
Link to comment
Share on other sites

Posted (edited)
18 minutes ago, Luis_ST said:

first of all basic java is required for modding minecraft
 

what did you mean by native events?

getDamage is a method not a class nor an Event

Yes, I'm sorry, I just realized that the previous "AttackEntityEvent" was a class/event. And "getDamage" is a method. That's why I couldn't listen to this event. I have understood the reason.
Native events, meaning events from "minecraft", not "forge" or other third party events. (Ultimately what I want to say is whether "forge" can only call/listen to events from "forge" and not from "minecraft", or whether "minecraft" has no event system)
When I checked the "forge" event system in the past two days, I didn't find any events related to listening to player health, is this because if you want to listen to player health, you can only listen to it from events that may cause damage. (For example, when the player falls, I can only insert the action I want to perform into the method that will calculate the fall damage)

Edited by iYM8jXCs3pcvblTE
Link to comment
Share on other sites

1 minute ago, iYM8jXCs3pcvblTE said:

Native events, meaning events from "minecraft", not "forge" or other third party events.

there are no Events from vanilla, all Events are added by Forge

 

2 minutes ago, iYM8jXCs3pcvblTE said:

When I checked the "forge" event system in the past two days, I didn't find any events related to listening to player health, is this because if you want to listen to player health, you can only listen to it from events that may cause damage.

there is LivingHealEvent

  • Thanks 1
Link to comment
Share on other sites

12 minutes ago, Luis_ST said:

there are no Events from vanilla, all Events are added by Forge

 

there is LivingHealEvent

OK, I have understood what you are trying to say and thank you very much for your patience in answering the almost common sense questions of the rookies.

:)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • are you sure this file does not exists and the log is the latest debug.log?
    • [03Jul2022 15:58:31.768] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, BradyDyson, --version, 1.19-forge-41.0.62, --gameDir, /Users/bradydyson/Library/Application Support/minecraft, --assetsDir, /Users/bradydyson/Library/Application Support/minecraft/assets, --assetIndex, 1.19, --uuid, 518f76ab883b4d1a826ecb2231ce9a9e, --accessToken, ❄❄❄❄❄❄❄❄, --clientId, MjgwREQ1MEY5NzNCNEZGM0JGNEIwRTI2MThBRkNEOEI=, --xuid, 2535470977180090, --userType, msa, --versionType, release, --launchTarget, forgeclient, --fml.forgeVersion, 41.0.62, --fml.mcVersion, 1.19, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220607.102129] [03Jul2022 15:58:31.771] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.1+10.0.1+main.e9521dc3 starting: java version 17.0.3 by Microsoft; OS Mac OS X arch aarch64 version 12.0.1 [03Jul2022 15:58:31.783] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [fmlclientdev,forgeclient,minecraft,forgegametestserverdev,fmlserveruserdev,fmlclient,fmldatauserdev,forgeserverdev,forgeserveruserdev,forgeclientdev,forgeclientuserdev,forgeserver,forgedatadev,fmlserver,fmlclientuserdev,fmlserverdev,forgedatauserdev,testharness,forgegametestserveruserdev] [03Jul2022 15:58:31.790] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [srgtomcp] [03Jul2022 15:58:31.796] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,slf4jfixer,object_holder_definalize,runtime_enum_extender,capability_token_subclass,accesstransformer,runtimedistcleaner] [03Jul2022 15:58:31.800] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services [03Jul2022 15:58:31.803] [main/ERROR] [net.minecraftforge.fml.loading.ModDirTransformerDiscoverer/]: Zip Error when loading jar file /Users/bradydyson/Library/Application Support/minecraft/mods/BiomesOPlenty-1.19-17.0.0.136.jar java.util.zip.ZipException: zip END header not found     at java.util.zip.ZipFile$Source.findEND(ZipFile.java:1469) ~[?:?]     at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1477) ~[?:?]     at java.util.zip.ZipFile$Source.<init>(ZipFile.java:1315) ~[?:?]     at java.util.zip.ZipFile$Source.get(ZipFile.java:1277) ~[?:?]     at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709) ~[?:?]     at java.util.zip.ZipFile.<init>(ZipFile.java:243) ~[?:?]     at java.util.zip.ZipFile.<init>(ZipFile.java:172) ~[?:?]     at java.util.zip.ZipFile.<init>(ZipFile.java:186) ~[?:?]     at net.minecraftforge.fml.loading.ModDirTransformerDiscoverer.visitFile(ModDirTransformerDiscoverer.java:54) ~[fmlloader-1.19-41.0.62.jar%2393!/:1.0]     at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]     at java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]     at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845) ~[?:?]     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]     at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]     at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]     at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]     at net.minecraftforge.fml.loading.ModDirTransformerDiscoverer.scan(ModDirTransformerDiscoverer.java:44) ~[fmlloader-1.19-41.0.62.jar%2393!/:1.0]     at net.minecraftforge.fml.loading.ModDirTransformerDiscoverer.candidates(ModDirTransformerDiscoverer.java:27) ~[fmlloader-1.19-41.0.62.jar%2393!/:1.0]     at cpw.mods.modlauncher.serviceapi.ITransformerDiscoveryService.candidates(ITransformerDiscoveryService.java:48) ~[modlauncher-10.0.1.jar%2381!/:10.0.1+10.0.1+main.e9521dc3]     at cpw.mods.modlauncher.TransformationServicesHandler.lambda$discoverServices$14(TransformationServicesHandler.java:123) ~[modlauncher-10.0.1.jar%2381!/:?]     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) [?:?]     at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) [?:?]     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) [?:?]     at java.util.ServiceLoader$ProviderSpliterator.tryAdvance(ServiceLoader.java:1499) [?:?]     at java.util.Spliterator.forEachRemaining(Spliterator.java:332) [?:?]     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) [?:?]     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) [?:?]     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) [?:?]     at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) [?:?]     at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) [?:?]     at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) [?:?]     at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) [?:?]     at cpw.mods.modlauncher.TransformationServicesHandler.discoverServices(TransformationServicesHandler.java:125) [modlauncher-10.0.1.jar%2381!/:?]     at cpw.mods.modlauncher.Launcher.run(Launcher.java:86) [modlauncher-10.0.1.jar%2381!/:?]     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.1.jar%2381!/:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.1.jar%2381!/:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.1.jar%2381!/:?]     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.1.jar:?] [03Jul2022 15:58:31.813] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services: java.util.stream.ReferencePipeline$3@5ca17ab0 [03Jul2022 15:58:31.856] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found transformer services : [mixin,OptiFine,fml] [03Jul2022 15:58:31.856] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Transformation services loading [03Jul2022 15:58:31.856] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loading service mixin [03Jul2022 15:58:31.856] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loaded service mixin [03Jul2022 15:58:31.857] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loading service OptiFine [03Jul2022 15:58:31.857] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFineTransformationService.onLoad [03Jul2022 15:58:31.857] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFine ZIP file URL: union:/Users/bradydyson/Library/Application%20Support/minecraft/mods/preview_OptiFine_1.19_HD_U_H8_pre1.jar%23144!/ [03Jul2022 15:58:31.861] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFine ZIP file: /Users/bradydyson/Library/Application Support/minecraft/mods/preview_OptiFine_1.19_HD_U_H8_pre1.jar [03Jul2022 15:58:31.862] [main/INFO] [optifine.OptiFineTransformer/]: Target.PRE_CLASS is available [03Jul2022 15:58:31.867] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loaded service OptiFine [03Jul2022 15:58:31.867] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loading service fml [03Jul2022 15:58:31.868] [main/DEBUG] [net.minecraftforge.fml.loading.LauncherVersion/CORE]: Found FMLLauncher version 1.0 [03Jul2022 15:58:31.868] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML 1.0 loading [03Jul2022 15:58:31.868] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found ModLauncher version : 10.0.1+10.0.1+main.e9521dc3 [03Jul2022 15:58:31.869] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found AccessTransformer version : 8.0.4+66+master.c09db6d7 [03Jul2022 15:58:31.869] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found EventBus version : 6.0.0+6.0.0+master.901864e5 [03Jul2022 15:58:31.869] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Found Runtime Dist Cleaner [03Jul2022 15:58:31.870] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: FML found CoreMod version : 5.0.1+15+master.dc5a2922 [03Jul2022 15:58:31.870] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Found ForgeSPI package implementation version 6.0.0+6.0.0+master.42474703 [03Jul2022 15:58:31.870] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Found ForgeSPI package specification 5 [03Jul2022 15:58:31.871] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Loaded service fml [03Jul2022 15:58:31.872] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Configuring option handling for services [03Jul2022 15:58:31.874] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Transformation services initializing [03Jul2022 15:58:31.875] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initializing transformation service mixin [03Jul2022 15:58:31.882] [main/DEBUG] [mixin/]: MixinService [ModLauncher] was successfully booted in cpw.mods.cl.ModuleClassLoader@1f2586d6 [03Jul2022 15:58:31.890] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/Users/bradydyson/Library/Application%20Support/minecraft/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2390!/ Service=ModLauncher Env=CLIENT [03Jul2022 15:58:31.892] [main/DEBUG] [mixin/]: Initialising Mixin Platform Manager [03Jul2022 15:58:31.892] [main/DEBUG] [mixin/]: Adding mixin platform agents for container ModLauncher Root Container(ModLauncher:4f56a0a2) [03Jul2022 15:58:31.892] [main/DEBUG] [mixin/]: Instancing new MixinPlatformAgentMinecraftForge for ModLauncher Root Container(ModLauncher:4f56a0a2) [03Jul2022 15:58:31.893] [main/DEBUG] [mixin/]: MixinPlatformAgentMinecraftForge rejected container ModLauncher Root Container(ModLauncher:4f56a0a2) [03Jul2022 15:58:31.893] [main/DEBUG] [mixin/]: Instancing new MixinPlatformAgentDefault for ModLauncher Root Container(ModLauncher:4f56a0a2) [03Jul2022 15:58:31.893] [main/DEBUG] [mixin/]: MixinPlatformAgentDefault accepted container ModLauncher Root Container(ModLauncher:4f56a0a2) [03Jul2022 15:58:31.894] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initialized transformation service mixin [03Jul2022 15:58:31.894] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initializing transformation service OptiFine [03Jul2022 15:58:31.894] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFineTransformationService.initialize [03Jul2022 15:58:31.894] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initialized transformation service OptiFine [03Jul2022 15:58:31.894] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initializing transformation service fml [03Jul2022 15:58:31.894] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Setting up basic FML game directories [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing GAMEDIR directory : /Users/bradydyson/Library/Application Support/minecraft [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path GAMEDIR is /Users/bradydyson/Library/Application Support/minecraft [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing MODSDIR directory : /Users/bradydyson/Library/Application Support/minecraft/mods [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path MODSDIR is /Users/bradydyson/Library/Application Support/minecraft/mods [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing CONFIGDIR directory : /Users/bradydyson/Library/Application Support/minecraft/config [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path CONFIGDIR is /Users/bradydyson/Library/Application Support/minecraft/config [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path FMLCONFIG is /Users/bradydyson/Library/Application Support/minecraft/config/fml.toml [03Jul2022 15:58:31.895] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Loading configuration [03Jul2022 15:58:31.914] [main/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing default config directory directory : /Users/bradydyson/Library/Application Support/minecraft/defaultconfigs [03Jul2022 15:58:31.914] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Preparing ModFile [03Jul2022 15:58:31.915] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Preparing launch handler [03Jul2022 15:58:31.915] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Using forgeclient as launch service [03Jul2022 15:58:31.925] [main/DEBUG] [net.minecraftforge.fml.loading.FMLLoader/CORE]: Received command line version data  : VersionInfo[forgeVersion=41.0.62, mcVersion=1.19, mcpVersion=20220607.102129, forgeGroup=net.minecraftforge] [03Jul2022 15:58:31.926] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Initialized transformation service fml [03Jul2022 15:58:31.926] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Current naming domain is 'srg' [03Jul2022 15:58:31.927] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Identified name mapping providers {} [03Jul2022 15:58:31.927] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Transformation services begin scanning [03Jul2022 15:58:31.927] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Beginning scan trigger - transformation service mixin [03Jul2022 15:58:31.927] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: End scan trigger - transformation service mixin [03Jul2022 15:58:31.927] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Beginning scan trigger - transformation service OptiFine [03Jul2022 15:58:31.927] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: End scan trigger - transformation service OptiFine [03Jul2022 15:58:31.927] [main/DEBUG] [cpw.mods.modlauncher.TransformationServiceDecorator/MODLAUNCHER]: Beginning scan trigger - transformation service fml [03Jul2022 15:58:31.927] [main/DEBUG] [net.minecraftforge.fml.loading.FMLServiceProvider/CORE]: Initiating mod scan [03Jul2022 15:58:31.932] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModListHandler/CORE]: Found mod coordinates from lists: [] [03Jul2022 15:58:31.933] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/CORE]: Found Mod Locators : (mods folder:null),(maven libs:null),(exploded directory:null),(minecraft:null),(userdev classpath:null) [03Jul2022 15:58:31.933] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/CORE]: Found Dependency Locators : (JarInJar:null)   I just launched Minecraft after deleting my mods. 
    • please post debug.log without mods
    • No mods work, even launching it without mods still doesnt work.
  • Topics

×
×
  • Create New...

Important Information

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