JimiIT92 Posted October 19, 2019 Share Posted October 19, 2019 (edited) 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, 2019 by JimiIT92 Solved Quote Don't blame me if i always ask for your help. I just want to learn to be better Link to comment Share on other sites More sharing options...
Differentiation Posted October 20, 2019 Share Posted October 20, 2019 1 hour ago, diesieben07 said: Probably store them in a capability and re-apply in PlayerRespawnEvent. Clone, not PlayerRespawnEvent. 1 Quote Link to comment Share on other sites More sharing options...
MairwunNx Posted October 20, 2019 Share Posted October 20, 2019 (edited) 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, 2019 by MairwunNx Quote Link to comment Share on other sites More sharing options...
JimiIT92 Posted October 20, 2019 Author Share Posted October 20, 2019 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 Quote Don't blame me if i always ask for your help. I just want to learn to be better Link to comment Share on other sites More sharing options...
JimiIT92 Posted October 20, 2019 Author Share Posted October 20, 2019 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 Quote Don't blame me if i always ask for your help. I just want to learn to be better Link to comment Share on other sites More sharing options...
Animefan8888 Posted October 20, 2019 Share Posted October 20, 2019 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. Quote 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. Link to comment Share on other sites More sharing options...
RaphGamingz Posted October 21, 2019 Share Posted October 21, 2019 (edited) 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, 2019 by RaphGamingz Quote Link to comment Share on other sites More sharing options...
RaphGamingz Posted October 21, 2019 Share Posted October 21, 2019 (edited) 10 minutes ago, diesieben07 said: I do not understand your question. me? JimiIT92? Animefan8888? Edited October 21, 2019 by RaphGamingz Quote Link to comment Share on other sites More sharing options...
RaphGamingz Posted October 21, 2019 Share Posted October 21, 2019 (edited) whats the syntax called edit: its called ternary Edited October 21, 2019 by RaphGamingz Quote Link to comment Share on other sites More sharing options...
RaphGamingz Posted October 21, 2019 Share Posted October 21, 2019 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) Quote Link to comment Share on other sites More sharing options...
RaphGamingz Posted October 21, 2019 Share Posted October 21, 2019 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.