Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. package com.baggot.plugin;
  2.  
  3.  
  4. import org.bukkit.Bukkit;
  5.  
  6. import org.bukkit.Location;
  7. import org.bukkit.Material;
  8. import org.bukkit.event.EventHandler;
  9. import org.bukkit.event.EventPriority;
  10. import org.bukkit.event.Listener;
  11. import org.bukkit.event.player.PlayerInteractEvent;
  12. import org.bukkit.event.player.PlayerJoinEvent;
  13. import org.bukkit.plugin.java.JavaPlugin;
  14.  
  15.  
  16.  
  17. public class Main extends JavaPlugin implements Listener{
  18.  
  19.    
  20.     @Override
  21.     public void onEnable() {
  22.         event.getPlayer().getLocation().getBlock().setType(Material.DIRT);
  23.         Bukkit.getPluginManager().registerEvent(PlayerInteractEvent.class, new Listener(){}, EventPriority.NORMAL, ($, event) -> {
  24.             final Location location = ((PlayerInteractEvent) event).getPlayer().getLocation();
  25.             System.out.println("TRIGGERED");
  26.             location.getBlock().setType(Material.DIRT);
  27.         }, this);
  28.         Bukkit.getPluginManager().registerEvents(this, this);
  29.     }
  30.     @EventHandler
  31.     void onJoin(PlayerJoinEvent event) {
  32.         System.out.println("Test");
  33.     }
  34.    
  35.     /*
  36.     private void spawnStand(Location location) {
  37.         //232f,0f,0f
  38.         ArmorStand stand = (ArmorStand) location.getWorld().spawnEntity(location , EntityType.ARMOR_STAND);
  39.        
  40.         stand.setArms(true);
  41.         stand.setVisible(true);
  42.         stand.setRightArmPose(new EulerAngle(Math.toRadians(232), Math.toRadians(0), Math.toRadians(0)));
  43.         stand.setCustomNameVisible(true);
  44.         stand.setCustomName(ChatColor.AQUA + "friends");
  45.         stand.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
  46.        
  47.        
  48.        
  49.        
  50.    
  51.     }
  52.     */
  53.    
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement