Posted October 19, 20195 yr As the title says i want to persist some modified player attributes when the player respawn. Say i've modified the strength or the health of the player, how can i reapply those modified values when the player respawn? Edited October 20, 20195 yr by JimiIT92 Solved Don't blame me if i always ask for your help. I just want to learn to be better
October 20, 20195 yr 1 hour ago, diesieben07 said: Probably store them in a capability and re-apply in PlayerRespawnEvent. Clone, not PlayerRespawnEvent.
October 20, 20195 yr 51 minutes ago, Differentiation said: Clone, not PlayerRespawnEvent. ```kotlin @SubscribeEvent fun onPlayerRespawn(event: PlayerEvent.PlayerRespawnEvent) { ``` ```java @SubscribeEvent public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) { ``` upd: sorry, I thought you did not find the event. Edited October 20, 20195 yr by MairwunNx
October 20, 20195 yr Author Thank you, i was able to do this catching the Clone event Ps: looks like notifications are broken, i haven't got one for this thread Don't blame me if i always ask for your help. I just want to learn to be better
October 20, 20195 yr Author But then how can i retrieve the capability of the "original" player, the entity that is dead? Since there is no "getOriginal" or something like that in the respawn event Don't blame me if i always ask for your help. I just want to learn to be better
October 20, 20195 yr 3 hours ago, diesieben07 said: No, this is NOT what the clone event is for... What would it be used for then if not making data persist across death, and what event would you use for making data persist across death because there is no way to use PlayerRespawnEvent to do so. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 21, 20195 yr 22 hours ago, diesieben07 said: Probably store them in a capability and re-apply in PlayerRespawnEvent. wouldn't it then be transferring the capability which stores the attributes 4 minutes ago, diesieben07 said: The clone even is for transferring data from old player to new (like capabilities or in old versions IExtendedEntityProperties). Applying attributes is something else... Edited October 21, 20195 yr by RaphGamingz
October 21, 20195 yr 10 minutes ago, diesieben07 said: I do not understand your question. me? JimiIT92? Animefan8888? Edited October 21, 20195 yr by RaphGamingz
October 21, 20195 yr whats the syntax called edit: its called ternary Edited October 21, 20195 yr by RaphGamingz
October 21, 20195 yr 9 hours ago, Animefan8888 said: What would it be used for then if not making data persist across death, and what event would you use for making data persist across death because there is no way to use PlayerRespawnEvent to do so. i think he is asking what the event you use because you cant use playerrespawnevent (according to him)
October 21, 20195 yr oh 33 minutes ago, RaphGamingz said: wouldn't it then be transferring the capability which stores the attributes because you said to store the attribute in a capability Quote Probably store them in a capability and re-apply in PlayerRespawnEvent. then you say Quote The clone even is for transferring data from old player to new (like capabilities or in old versions IExtendedEntityProperties). and you use the clone event to transfer capabilities
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.