This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onEnable() { | |
// WHAT YOU WANT TO GIVE TO THE PLAYER | |
ItemStack aStand = new ItemStack(Material.ARMOR_STAND); | |
ShapedRecipe arStand = new ShapedRecipe(aStand); | |
// ITS JUST LIKE A CRAFTING BENCH!!! | |
arStand.shape | |
("*H*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onEnable() { | |
Bukkit.getServer().getPluginManager().registerEvents(this, this); | |
} | |
@EventHandler | |
public void onPlayerBreakBlockEvent(BlockBreakEvent e) { | |
Player p = e.getPlayer(); | |
p.sendMessage("You broke a " + ChatColor.GREEN + e.getBlock().getType()); | |
// TODO: THEN TEST!!!!!!!!!!!!!!!!!!! | |
if(e.getBlock().getType().equals(Material.STONE)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onEnable() { | |
getServer().getPluginManager().registerEvents(this, this); | |
} | |
@EventHandler | |
public void onPlayerPlaceBlockEvent(BlockPlaceEvent e) { | |
Player p = e.getPlayer(); | |
if(e.getBlock().getType().equals(Material.DIAMOND_BLOCK)) { | |
p.sendMessage(ChatColor.AQUA + "Nope, this will always be..."+ChatColor.RED+" IMPERFECT!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADD THIS TO YOUR ONENABLE() | |
getServer().getPluginManager().registerEvents(new <trigger>(), this); | |
// IN YOUR EVENT CLASS: | |
public class <event-name> implements Listener { | |
@EventHandler | |
public void <trigger>(<event> e) { | |
// EVENT STUFFS! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just remember to use this in your main class / where your calling the method from | |
<class-name> <class-name-abbr> = new <class-name>(); | |
// To call a method, Ill use sendConsoleMsg() as a example: | |
<class-name-abbr>.sendConsoleMsg("Hello!"); | |
// Or | |
<class-name-abbr>.<method>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IN YOUR ON ENABLE: | |
getCommand("<cmd>").setExecutor(new <cmd-path>()); | |
// IN YOUR <cmd-path> FILE: | |
// MAKE SURE TO IMPLEMENT CommandExecutor! | |
@Override | |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { | |
Player p = (Player) sender; | |
if(cmd.getName().equalsIgnoreCase("<cmd>") && sender.hasPermission("<perm-node>")) { | |
if(args.length == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler | |
public void blockExEvent(PlayerBedEnterEvent e) { | |
Player p = e.getPlayer(); | |
Block b = e.getBed(); | |
b.breakNaturally(); | |
e.setCancelled(true); | |
p.sendMessage("No no no!"); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler | |
public void onLeashEvent(PlayerLeashEntityEvent e) { | |
Player p = e.getPlayer(); | |
if(e.getEntity().getType().toString().equals("SHEEP")) { | |
p.sendMessage("You have captured a sheep!"); | |
} | |
if(e.getEntity().getType().toString().equals("PIG")) { | |
p.sendMessage(ChatColor.LIGHT_PURPLE + "You have captured a pig!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>this is bad formatting</title> | |
</head> | |
<body> | |
<p>Hello World :D</p> | |
<p>How are you today?</p> | |
<div> | |
<h1>Hello</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#deb cdrom:[Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64 (20140417)]/ trusty main restricted | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted | |
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted |
OlderNewer