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

I've started to use variables to store information about players.

 

Example:

 

 

if (event.entity instanceof EntityPlayer) {

EntityPlayer player = (EntityPlayer) event.entity;

if(event.entity.isWet()) {

int watersealing = MageniteIngotItem.watersealing;

if(watersealing <= 0) {

event.entity.attackEntityFrom(DamageSource.drown, 1.0F);

} else {

--watersealing;

MageniteIngotItem.watersealing = watersealing;

if(watersealing == 200) {

player.addChatMessage(new ChatComponentText("5 Seconds left of WaterSealing."));

}

if(watersealing == 50) {

player.addChatMessage(new ChatComponentText("1 Second left of WaterSealing!"));

}

}

}

 

 

 

However the problem with this code is that it's obviously a global variable that applies to everyone.

 

And I would like each player to have their own value for this variable.

What would I need to do make this individual to each player?

 

And what is the best way to store info for this kind of thing?

 

Would I use the player file for this or is there a way to write a file of my own?(I plan on eventually storing a fairly good chunk of info.)

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

  • Author

Thank you that's much appreciated. :)

I'm not trying to be rude it just comes out that way sometimes.

I'm here to try and learn as much as I can, won't you join me?

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.