AliShulker Addition

This commit is contained in:
alisolarflare 2016-08-05 05:05:39 -04:00
parent 6fc986a547
commit 7452825503
6 changed files with 84 additions and 0 deletions

8
.classpath Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Users/Alisolarflare/Personal/Hobbies/The Button Rebirth/Button Plugin/Minecraft Test Server/craftbukkit-1.9.2.jar"/>
<classpathentry kind="lib" path="C:/Users/Alisolarflare/Personal/Hobbies/The Button Rebirth/Button Plugin/Minecraft Test Server/spigot-1.9.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

1
.gitignore vendored
View file

@ -10,3 +10,4 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/bin/

17
.project Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AliPresents</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

7
plugin.yml Normal file
View file

@ -0,0 +1,7 @@
main: alisolarflare.MainPlugin
name: AliPresents
version: 1.0.0
commands:
alishulker:
description: Spawns a shulker at player location. /Alishulker <health> <withereffect> <invisibility=true> <experiencedrops>

View file

@ -0,0 +1,39 @@
package alisolarflare;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Shulker;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class AliShulker implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)){
sender.sendMessage("You must be a player to use this command!");
return false;
}
Player player = (Player) sender;
if(!(player.getName().equals("iie"))){
return false;
}
Location location = player.getLocation();
Entity entity = player.getWorld().spawnEntity(location, EntityType.SHULKER);
Shulker shulker = (Shulker) entity;
shulker.setHealth(10);
shulker.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 1728000, 5, false));
shulker.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1728000, 5, false));
shulker.setAI(false);
shulker.setGlowing(true);
return false;
}
}

View file

@ -0,0 +1,12 @@
package alisolarflare;
import org.bukkit.plugin.java.JavaPlugin;
public class MainPlugin extends JavaPlugin{
public void onEnable(){
registerCommands();
}
public void registerCommands(){
getCommand("alishulker").setExecutor(new AliShulker());
}
}