AliShulker Addition
This commit is contained in:
parent
6fc986a547
commit
7452825503
6 changed files with 84 additions and 0 deletions
8
.classpath
Normal file
8
.classpath
Normal 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
1
.gitignore
vendored
|
@ -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
17
.project
Normal 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
7
plugin.yml
Normal 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>
|
39
src/alisolarflare/AliShulker.java
Normal file
39
src/alisolarflare/AliShulker.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
12
src/alisolarflare/MainPlugin.java
Normal file
12
src/alisolarflare/MainPlugin.java
Normal 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());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue