Advertisement
Guest User

code/plugin

a guest
Jun 9th, 2021
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. package com.koscile.tutorial.commands;
  2.  
  3. import org.bukkit.attribute.Attribute;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.potion.PotionEffect;
  9. import org.bukkit.potion.PotionEffectType;
  10.  
  11. public class tutorialCommands implements CommandExecutor {
  12. private Object PotionEffectType;
  13.  
  14. @Override
  15. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  16. if (!(sender instanceof Player)) {
  17. return true;
  18. }
  19. Player player = (Player) sender;
  20.  
  21. if (cmd.getName().equalsIgnoreCase("potion")) {
  22. player.addPotionEffect(new PotionEffect(org.bukkit.potion.PotionEffectType.JUMP, 60, 0));
  23. }
  24.  
  25. if (cmd.getName().equalsIgnoreCase("feed")) {
  26. player.setFoodLevel(20);
  27. }
  28. return true;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement