Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by JimiIT92
Solved

Don't blame me if i always ask for your help. I just want to learn to be better :)

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 by MairwunNx

  • 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 :)

  • 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 :)

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.

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 by RaphGamingz

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)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.