Commits

coll1234567 authored and md_5 committed 08f86d1ce25
#971: Add Player methods for client-side potion effects
No tags

src/main/java/org/bukkit/entity/Player.java

Modified
36 36 import org.bukkit.conversations.Conversable;
37 37 import org.bukkit.event.block.BlockBreakEvent;
38 38 import org.bukkit.event.block.BlockDropItemEvent;
39 39 import org.bukkit.event.player.PlayerExpCooldownChangeEvent;
40 40 import org.bukkit.event.player.PlayerResourcePackStatusEvent;
41 41 import org.bukkit.inventory.EquipmentSlot;
42 42 import org.bukkit.inventory.ItemStack;
43 43 import org.bukkit.map.MapView;
44 44 import org.bukkit.plugin.Plugin;
45 45 import org.bukkit.plugin.messaging.PluginMessageRecipient;
46 +import org.bukkit.potion.PotionEffect;
47 +import org.bukkit.potion.PotionEffectType;
46 48 import org.bukkit.profile.PlayerProfile;
47 49 import org.bukkit.scoreboard.Scoreboard;
48 50 import org.jetbrains.annotations.ApiStatus;
49 51 import org.jetbrains.annotations.NotNull;
50 52 import org.jetbrains.annotations.Nullable;
51 53
52 54 /**
53 55 * Represents a player, connected or not
54 56 */
55 57 public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient {
918 920 * {@link BlockData#createBlockState()} can be used to create a {@link BlockState}.
919 921 *
920 922 * @param loc the location of the sign
921 923 * @param tileState the tile state
922 924 * @throws IllegalArgumentException if location is null
923 925 * @throws IllegalArgumentException if tileState is null
924 926 */
925 927 @ApiStatus.Experimental
926 928 public void sendBlockUpdate(@NotNull Location loc, @NotNull TileState tileState) throws IllegalArgumentException;
927 929
930 + /**
931 + * Change a potion effect for the target entity. This will not actually
932 + * change the entity's potion effects in any way.
933 + * <p>
934 + * <b>Note:</b> Sending an effect change to a player for themselves may
935 + * cause unexpected behavior on the client. Effects sent this way will also
936 + * not be removed when their timer reaches 0, they can be removed with
937 + * {@link #sendPotionEffectChangeRemove(LivingEntity, PotionEffectType)}
938 + *
939 + * @param entity the entity whose potion effects to change
940 + * @param effect the effect to change
941 + */
942 + public void sendPotionEffectChange(@NotNull LivingEntity entity, @NotNull PotionEffect effect);
943 +
944 + /**
945 + * Remove a potion effect for the target entity. This will not actually
946 + * change the entity's potion effects in any way.
947 + * <p>
948 + * <b>Note:</b> Sending an effect change to a player for themselves may
949 + * cause unexpected behavior on the client.
950 + *
951 + * @param entity the entity whose potion effects to change
952 + * @param type the effect type to remove
953 + */
954 + public void sendPotionEffectChangeRemove(@NotNull LivingEntity entity, @NotNull PotionEffectType type);
955 +
928 956 /**
929 957 * Render a map and send it to the player in its entirety. This may be
930 958 * used when streaming the map in the normal manner is not desirable.
931 959 *
932 960 * @param map The map to be sent
933 961 */
934 962 public void sendMap(@NotNull MapView map);
935 963
936 964 /**
937 965 * Send a hurt animation. This fakes incoming damage towards the player from

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut