Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.wwsean08.RespawnHealth;
- import org.bukkit.entity.Player;
- public class RespawnHealthRunnable implements Runnable{
- @SuppressWarnings("unused")
- //the variables, the plugin may not have been necessary, but I was going off of someone elses example, so i suppressed that it was unused.
- private RespawnHealthPlayerListener plugin;
- private Player player;
- private int newHealth;
- RespawnHealthRunnable(Player newPlayer, int Health, RespawnHealthPlayerListener instance){
- player = newPlayer;
- plugin = instance;
- newHealth = Health;
- }
- @Override
- //this is a special method that is required whenever you schedule a task, the run method is what is required when you implement runnable.
- //It is what does all the work of the thread. Like I've said before i'm not good with threads so any questions I will leave for those that are better
- public void run() {
- player.setHealth(newHealth);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement