Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

As the title states I am trying to subscribe to LivingChangeTargetEvent but it cant find the definition, I tried different annotations and that didnt work. My current annotation is 

@Mod.EventBusSubscriber(modid = Main.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)

And this is the method I'm using

@SubscribeEvent
    public static void onTarget(LivingChangeTargetEvent e){
        LivingEntity entity = e.getEntityLiving();
        if(entity.getPersistentData().contains(XprtData.GALAXUS_SLAVE)){
            if(!entity.getLevel().isClientSide()){
                ServerLevel lvl = (ServerLevel) entity.getLevel();
                UUID id = entity.getPersistentData().getUUID(XprtData.GALAXUS_SLAVE_OWNER);
                if(lvl.getPlayerByUUID(id)!=null){
                    Player p = lvl.getPlayerByUUID(id);
                    if(e.getNewTarget().equals(p) || e.getNewTarget().getId() == p.getId()){
                        e.setCanceled(true);
                    }
                }
            }
        }
    }

this is just a simple turn any entity to do ur bidding code and I remember in past projects using LivingChangeTargetEvent and it worked. Do I have to rebuild the entire project and run mappings updates or something??

By the way I am only using my mod and optifine(removing optifine doesnt change anything) and the debug.log just says what the title says.

Edited by sFXprt

https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.2.2/forge-1.18.2-40.2.2-changelog.txt

Quote

40.1.84 [1.18.x] Make LivingSetAttackTargetEvent compatible with the Brain/Behavior system. (#8918)

From what I understand that event was added during the above change.

The previously available LivingSetAttackTarget is currently marked as deprecated in 1.19 in favour of that new event.

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.

  • Author
13 hours ago, warjort said:

https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.2.2/forge-1.18.2-40.2.2-changelog.txt

From what I understand that event was added during the above change.

The previously available LivingSetAttackTarget is currently marked as deprecated in 1.19 in favour of that new event.

I am on version 40.2.0 still no class def, ill try to update to the latest

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.