Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.baggot.plugin;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.EventPriority;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.event.player.PlayerJoinEvent;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin implements Listener{
- @Override
- public void onEnable() {
- event.getPlayer().getLocation().getBlock().setType(Material.DIRT);
- Bukkit.getPluginManager().registerEvent(PlayerInteractEvent.class, new Listener(){}, EventPriority.NORMAL, ($, event) -> {
- final Location location = ((PlayerInteractEvent) event).getPlayer().getLocation();
- System.out.println("TRIGGERED");
- location.getBlock().setType(Material.DIRT);
- }, this);
- Bukkit.getPluginManager().registerEvents(this, this);
- }
- @EventHandler
- void onJoin(PlayerJoinEvent event) {
- System.out.println("Test");
- }
- /*
- private void spawnStand(Location location) {
- //232f,0f,0f
- ArmorStand stand = (ArmorStand) location.getWorld().spawnEntity(location , EntityType.ARMOR_STAND);
- stand.setArms(true);
- stand.setVisible(true);
- stand.setRightArmPose(new EulerAngle(Math.toRadians(232), Math.toRadians(0), Math.toRadians(0)));
- stand.setCustomNameVisible(true);
- stand.setCustomName(ChatColor.AQUA + "friends");
- stand.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement