Pehkui

Pehkui

35M Downloads

[Suggestion]: Add the ability to use modifiers without them persisting.

MerchantPug opened this issue ยท 5 comments

commented

What is your suggestion?

Unfortunately, I think this would require a rewrite to the modifier system you already have, but, I would love for the ability to have non persistent modifiers, in that they wouldn't require a registry value, and that they wouldn't require saving to the player.

This is for use cases where the modifiers are handled elsewhere (for my example, an Origins power).

commented

Although for a more generalised use case, attribute modifiers work perfectly.

commented

Speaking more generally, I think it'd be nice to have this fulfilled via an attribute modifier system for scales - as in, command-with-a-uuid, type, and value kind of thing - same as vanilla. This would give the most leeway to datapackers interacting with scale temporarily in all ways.

I feel like we should have both, mainly because developers might want to have different styles of modifiers (in my case Apoli has a separate modifier system that has more options than vanilla's modifiers). Giving datapackers the ability to use attribute modifiers for Pehkui scales as modifiers would be neat though.

commented

Speaking more generally, I think it'd be nice to have this fulfilled via an attribute modifier system for scales - as in, command-with-a-uuid, type, and value kind of thing - same as vanilla. This would give the most leeway to datapackers interacting with scale temporarily in all ways.

I feel like we should have both, mainly because developers might want to have different styles of modifiers (in my case Apoli has a separate modifier system that has more options than vanilla's modifiers). Giving datapackers the ability to use attribute modifiers for Pehkui scales as modifiers would be neat though.

To elaborate, how I could see this structured.

Is that AttributeScaleModifier is a subclass of a basic ScaleModifier. Using a command, you can add an AttributeScaleModifier.
Then ScaleModifiers are rewritten/partially rewritten to allow for determining whether they save to an entity or not. (Maybe through toTag and fromTag methods inside the ScaleModifier class?). Attribute Modifiers would, but externally handled things probably wouldn't want to be saved.

commented

Speaking more generally, I think it'd be nice to have this fulfilled via an attribute modifier system for scales - as in, command-with-a-uuid, type, and value kind of thing - same as vanilla. This would give the most leeway to datapackers interacting with scale temporarily in all ways.