Jump to content

Recommended Posts

Posted

So I want to give the player the strength effect when they use a totem, but I can't get it to work. I've tested and if you have an effect when you use a totem, it is removed when you get revived (presumably because you "die.") After testing with System.out.print(), I've concluded the entity is given strength then has it immediately removed. This occurs even if I set the event priority to lowest. Does anyone have any ideas on getting around this? Thanks!

Posted (edited)
7 hours ago, Warren Tode said:

I copied the Totem of Undying event for my coin charm, and as you can see in line 113 it has the method removeAllEffects in there, so if you're building a similar event, simply don't add the method to prevent it from removing effects.

https://github.com/toadie-odie/TodeCoins/blob/1.3.2/src/main/java/net/warrentode/todecoins/event/ModEvents.java

Unfortunately this is not the case. I’m trying to add this effect on the base game Totem via an enchantment. This does help though, I’ll take a look at the code and see if I can find a work around! Do you know if there is a way to put a tick delay on a function? Like have the effect added the tick after the event completes, or even at the end of the current tick?

Edited by Braquen
Posted

Okay so you want to modify the existing totem's function and not create a brand new function or totem? Do I understand this correctly?

If so, you'll probably need a mixin of some kind that targets the "checkTotemDeathProtection" in the LivingEntity class - that's the method I copied for my coin charm, but it's the built-in method for the game's totem. This is the way I would approach it at least.

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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