Available Methods
- sendMessage ( )
- hasPermission ( )
- getUniqueId ( )
- openInventory ( )
- getName ( )
- getLocation ( )
- teleport ( )
- playSound ( )
- isOnline ( )
- isOp ( )
- getGameMode ( )
- updateInventory ( )
- getWorld ( )
- closeInventory ( )
- addPotionEffect ( )
- setAllowFlight ( )
- getHealth ( )
- setHealth ( )
- hasMetadata ( )
- getInventory ( )
- sendPluginMessage ( )
- getItemInHand ( )
- setExp ( )
- setMetadata ( )
- removeMetadata ( )
- getActivePotionEffects ( )
- setVelocity ( )
- removePotionEffect ( )
- setFoodLevel ( )
- setFlying ( )
- equals ( )
- hidePlayer ( )
- getDisplayName ( )
- setGameMode ( )
- setOp ( )
- setLevel ( )
- performCommand ( )
- isSneaking ( )
- setItemInHand ( )
- getFoodLevel ( )
- setScoreboard ( )
- setMaxHealth ( )
- getScoreboard ( )
- setFireTicks ( )
- canSee ( )
- hasPotionEffect ( )
- setSaturation ( )
- isDead ( )
- kickPlayer ( )
- sendTitle ( )
- sendBlockChange ( )
- getMaxHealth ( )
- getEffectivePermissions ( )
- setExhaustion ( )
- getEyeLocation ( )
- getLevel ( )
- setFlySpeed ( )
- giveExp ( )
- isGliding ( )
- getOpenInventory ( )
- getMetadata ( )
- isInsideVehicle ( )
- getFireTicks ( )
- isValid ( )
- getAllowFlight ( )
- showPlayer ( )
- setPlayerListName ( )
- getExhaustion ( )
- getExp ( )
- chat ( )
- setFallDistance ( )
- setWalkSpeed ( )
- getVehicle ( )
- getFlySpeed ( )
- setKnockbackReduction ( )
- setCollidesWithEntities ( )
- leaveVehicle ( )
- getLocale ( )
- setCompassTarget ( )
- getSaturation ( )
- isPermissionSet ( )
- setFastNaturalRegeneration ( )
- setGliding ( )
- getPassenger ( )
- isOnGround ( )
- getTargetBlock ( )
- setItemOnCursor ( )
- isSleeping ( )
- setDisplayName ( )
Related Classes
- java.util.Arrays
- java.util.Collections
- java.util.UUID
- java.util.stream.Collectors
- java.lang.reflect.InvocationTargetException
- java.util.Optional
- java.util.logging.Level
- javax.annotation.Nullable
- com.google.common.collect.ImmutableMap
- org.jetbrains.annotations.NotNull
- org.bukkit.Bukkit
- org.bukkit.event.EventHandler
- org.bukkit.ChatColor
- org.bukkit.command.CommandSender
- org.bukkit.command.Command
- org.bukkit.Material
- org.bukkit.inventory.ItemStack
- org.bukkit.event.EventPriority
- org.bukkit.Location
- org.bukkit.World
- org.bukkit.event.Event
- org.bukkit.entity.Entity
- org.bukkit.inventory.meta.ItemMeta
- org.bukkit.block.Block
- org.bukkit.inventory.Inventory
Java Code Examples for org.bukkit.entity.Player#setFastNaturalRegeneration()
The following examples show how to use
org.bukkit.entity.Player#setFastNaturalRegeneration() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MatchPlayer.java From ProjectAres with GNU Affero General Public License v3.0 | 5 votes |
public void reset() { final Player bukkit = getBukkit(); bukkit.closeInventory(); clearInventory(); bukkit.setExhaustion(0); bukkit.setFallDistance(0); bukkit.setFireTicks(0); bukkit.setFoodLevel(20); // full bukkit.setMaxHealth(20); bukkit.setHealth(bukkit.getMaxHealth()); bukkit.setAbsorption(0); bukkit.setLevel(0); bukkit.setExp(0); // clear xp bukkit.setSaturation(5); // default bukkit.setFastNaturalRegeneration(false); bukkit.setSlowNaturalRegeneration(true); bukkit.setAllowFlight(false); bukkit.setFlying(false); bukkit.setSneaking(false); bukkit.setSprinting(false); bukkit.setFlySpeed(0.1f); bukkit.setKnockbackReduction(0); bukkit.setWalkSpeed(WalkSpeedKit.BUKKIT_DEFAULT); AttributeUtils.removeAllModifiers(bukkit); resetPotions(); // we only reset bed spawn here so people don't have to see annoying messages when they respawn bukkit.setBedSpawnLocation(null); match.callEvent(new PlayerResetEvent(this)); }
Example 2
Source File: Players.java From CardinalPGM with MIT License | 5 votes |
public static void resetPlayer(Player player, boolean heal) { if (heal) player.setHealth(player.getMaxHealth()); player.setFoodLevel(20); player.setSaturation(20); player.getInventory().clear(); player.getInventory().setArmorContents(new ItemStack[]{new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR)}); for (PotionEffect effect : player.getActivePotionEffects()) { try { player.removePotionEffect(effect.getType()); } catch (NullPointerException ignored) { } } player.setTotalExperience(0); player.setExp(0); player.setLevel(0); player.setPotionParticles(false); player.setWalkSpeed(0.2F); player.setFlySpeed(0.1F); player.setKnockbackReduction(0); player.setArrowsStuck(0); player.hideTitle(); player.setFastNaturalRegeneration(false); for (Attribute attribute : Attribute.values()) { if (player.getAttribute(attribute) == null) continue; for (AttributeModifier modifier : player.getAttribute(attribute).getModifiers()) { player.getAttribute(attribute).removeModifier(modifier); } } player.getAttribute(Attribute.GENERIC_ATTACK_SPEED).addModifier(new AttributeModifier(UUID.randomUUID(), "generic.attackSpeed", 4.001D, AttributeModifier.Operation.ADD_SCALAR)); player.getAttribute(Attribute.ARROW_ACCURACY).addModifier(new AttributeModifier(UUID.randomUUID(), "sportbukkit.arrowAccuracy", -1D, AttributeModifier.Operation.ADD_NUMBER)); player.getAttribute(Attribute.ARROW_VELOCITY_TRANSFER).addModifier(new AttributeModifier(UUID.randomUUID(), "sportbukkit.arrowVelocityTransfer", -1D, AttributeModifier.Operation.ADD_NUMBER)); }