Paragliders

Paragliders

24M Downloads

[Rquest] Allowing player states to be registered as attributes

Closed this issue ยท 1 comments

commented

Hi, i would like to ask if its possible to register player states as attributes? Reason being is that i would like to intergrate with PMMO. I am making a modpack and PMMO can auto update attributes when a player levels up, demonstrated in the snippet below is an example of how PMMO manipulates the attribute, with the ability to determine max_boost applied to the default, and below it a use case of how I am using a built in command to update the stamina levels on skill up. I am on minecraft 1.20.1, forge.

		[[Perks.For_Event.SKILL_UP]]
			skill = "endurance"
			per_level = 0.05
			perk = "pmmo:attribute"
			attribute = "minecraft:generic.max_health"
			max_boost = 10.0

		[[Perks.For_Event.SKILL_UP]]
			skill = "endurance"
			perk = "pmmo:command"
			command = "paraglider give stamina_vessel @s 1"
commented

Sorry but I do not follow what you want to achieve. Player states represent a physical state of a player mutually exclusive to other states, and doesn't have an inherent functionality other than affecting stamina delta. (excluding paragliding/ascending state, which has a functionality)

If your goal is to provide integration for a mod-added player action with player state, write an addon with Paraglider movement plugin that registers a corresponding state, then connects it into IDLE state with appropriate checker as a condition. Since the player state doesn't affect external systems, you'll have to figure out ways to control it from the origin mod's side.

If you want to simply change the amount of stamina delta applied by certain player states, write an addon that registers StaminaReductionLogic that queries your own attribute. I have an example mod that implements this. But beware that you'll see little to no effects on the stamina delta because the base values are too small and the system can only express stamina as integer values. I recommend boosting both default stamina delta and max stamina to fixed amount. (Example mod does this - the max stamina should be set from the server config file)

21.x onwards Paraglider provides stamina efficiency attributes by default, as well as having decimal based stamina system, but alas.

Closing this issue, but feel free to comment if you have other questions.