Skip to content

Add Viewer#sendDeathProtection() #2586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: api-14
Choose a base branch
from

Conversation

MrHell228
Copy link
Contributor

@MrHell228 MrHell228 commented Mar 30, 2025

SpongeAPI | Sponge

With introduction of DEATH_PROTECTION item component it's now possible to play death protection effect with any ItemStack

@aromaa
Copy link
Member

aromaa commented Mar 31, 2025

Calling this just sendDeathProtection is going to be very vague. It should at least imply that its just visual effect. Also I think I would rather just call it totemOfUndying because thats very discoverable and understandable. Something like playConsumedTotemOfUndyingEffect, its a bit wordy and lengthy but at least the intent is clear.

@MrHell228
Copy link
Contributor Author

MrHell228 commented Mar 31, 2025

I believe the fact that it's the method in Viewer interface implies visual-only effect? If not, I can add client-only words to docs, some other methods there has this as well. But I don't really want to blend item name into method name.
Also there will be Keys.DEATH_PROTECTION_EFFECTS from other PR and I don't think you would like it to be called TOTEM_OF_UNDYING_EFFECTS? Maybe rename to playDeathProtectionEffect would be enough

@aromaa
Copy link
Member

aromaa commented Mar 31, 2025

Effects aren't abstract thing, you want to play a specific one. Abstracting things out works well in the Data API because its a common entrypoint for basically anything. Its much easier to describe the actual effects based on from where they originate. I'm just not buying it that "death protection" is specific enough to distinct itself from any other possible options (Vanilla only has one for now).

@aromaa
Copy link
Member

aromaa commented Mar 31, 2025

I should also add that the "death protection" term itself is also a very abstract concept. It could mean various things like the player is actively being protected from death, like invincibility, and many games display this by making the player semi transparent or distort the player model in different ways.

@MrHell228
Copy link
Contributor Author

Yeah, effects aren't abstract thing, I meant that it would be nice to have some consistency between these two things and if you find one, you will likely search for the same name because they originate from the same thing.
I have really no idea if someone is typing player.totem and then autocomplete. If you just find this method on player, I think it's the docs who should say you that in vanilla this is what totem usually does (And even in vanilla with command you can give yourself item that behaves like totem and on death it will pop on the screen as an actual item, not totem)

@MrHell228
Copy link
Contributor Author

I guess I can agree that it's abstract enough. But playConsumedTotemOfUndyingEffect... eh, too long and inconvenient. But apparently playTotemOfUndyingEffect is shorter than playDeathProtectionEffect. Still don't like item name being involved, but will change to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants