Hot Summer Deals are Here!
Celebrate with up to 99% off on 17,700 resources
01
Days
20
Hours
57
Mins
04
Secs

Anti-Shield

Status
This thread has been locked.

Deep

Full Time Bebosny's Slave/Fan/Son
Supreme
Feedback score
0
Posts
3,531
Reactions
2,040
Resources
0
Hello!​

Requesting:
I would like a anti-shield plugin for 1.9 PVP, since this is a fairly simple plugin, I won't be paying much. PM me if you are
interested.

Thanks​
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Blowns

Premium
Feedback score
1
Posts
1,014
Reactions
526
Resources
0
Code:
    @EventHandler
    public void onPrepareItemCraft(PrepareItemCraftEvent event) {
        Recipe recipe = event.getRecipe();
        ItemStack result = recipe.getResult();
        Material resultType = result.getType();
      
        if (resultType == Material.SHIELD) {
            event.getInventory().setResult(new ItemStack(Material.AIR));
            for (HumanEntity humanEntity : event.getViewers()) {
                if (humanEntity instanceof Player) {
                    Player player = (Player) humanEntity;
                    player.sendMessage(ChatColor.RED + "You can't craft shields.");
                }
            }
        }
    }

You can still spawn it in, so make sure you trust your staff!
 

lAkjtzAZ0

Deactivated
Feedback score
16
Posts
1,071
Reactions
1,013
Resources
0
Code:
    @EventHandler
    public void onPrepareItemCraft(PrepareItemCraftEvent event) {
        Recipe recipe = event.getRecipe();
        ItemStack result = recipe.getResult();
        Material resultType = result.getType();
     
        if (resultType == Material.SHIELD) {
            event.getInventory().setResult(new ItemStack(Material.AIR));
            for (HumanEntity humanEntity : event.getViewers()) {
                if (humanEntity instanceof Player) {
                    Player player = (Player) humanEntity;
                    player.sendMessage(ChatColor.RED + "You can't craft shields.");
                }
            }
        }
    }

You can still spawn it in, so make sure you trust your staff!
Nice guy. I've seen people charge $10+ for plugins with that much code before. Gg on you :)
 

Deep

Full Time Bebosny's Slave/Fan/Son
Supreme
Feedback score
0
Posts
3,531
Reactions
2,040
Resources
0
Code:
    @EventHandler
    public void onPrepareItemCraft(PrepareItemCraftEvent event) {
        Recipe recipe = event.getRecipe();
        ItemStack result = recipe.getResult();
        Material resultType = result.getType();
     
        if (resultType == Material.SHIELD) {
            event.getInventory().setResult(new ItemStack(Material.AIR));
            for (HumanEntity humanEntity : event.getViewers()) {
                if (humanEntity instanceof Player) {
                    Player player = (Player) humanEntity;
                    player.sendMessage(ChatColor.RED + "You can't craft shields.");
                }
            }
        }
    }

You can still spawn it in, so make sure you trust your staff!
I'm an idiot.. Tf do I do with that? Paste it into Eclipse and turn it into a jar?
 

lAkjtzAZ0

Deactivated
Feedback score
16
Posts
1,071
Reactions
1,013
Resources
0
I'm an idiot.. Tf do I do with that? Paste it into Eclipse and turn it into a jar?
That's all the code you'd need for it. Of course if you don't know what to do with it, there are some anti-craft plugins. I'm sure there's some for 1.9 you can get to stop shields.
 

Blowns

Premium
Feedback score
1
Posts
1,014
Reactions
526
Resources
0
I'm an idiot.. Tf do I do with that? Paste it into Eclipse and turn it into a jar?
A bit more to it than that, but I'm just too lazy to compile it into a plugin. I'm sure there's someone nice enough on this forum to do it for you.
 

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
Code:
    @EventHandler
    public void onPrepareItemCraft(PrepareItemCraftEvent event) {
        Recipe recipe = event.getRecipe();
        ItemStack result = recipe.getResult();
        Material resultType = result.getType();
     
        if (resultType == Material.SHIELD) {
            event.getInventory().setResult(new ItemStack(Material.AIR));
            for (HumanEntity humanEntity : event.getViewers()) {
                if (humanEntity instanceof Player) {
                    Player player = (Player) humanEntity;
                    player.sendMessage(ChatColor.RED + "You can't craft shields.");
                }
            }
        }
    }

You can still spawn it in, so make sure you trust your staff!
What Jeff wants is something to block shields completely, when you right click with a sword a shield will automatically raise, he wants to stop that. I tried doing this for him the other day, and haven't messed much with 1.9 so was at a loss :/
 

Blowns

Premium
Feedback score
1
Posts
1,014
Reactions
526
Resources
0
What Jeff wants is something to block shields completely, when you right click with a sword a shield will automatically raise, he wants to stop that. I tried doing this for him the other day, and haven't messed much with 1.9 so was at a loss :/
I have no idea how 1.9 let alone shields work, I just thought if you were given a shield that's all there is to it
 
Status
This thread has been locked.
Top