Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8168563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:34:11+00:00 2026-06-06T20:34:11+00:00

Hello im coding a plugin for the game minecraft using Bukkit. Basically when a

  • 0

Hello im coding a plugin for the game minecraft using Bukkit. Basically when a player right clicks with a egg that egg has a specific durability. The durability does not change at all because the event is called every time someone does this and its individual. The code i currently have is not done but this is basically it:

if (e.getItem().getTypeId() == 383) {
        if (!worldguardPlugin.canBuild(e.getPlayer(), loc)) {
            e.setCancelled(true);
            e.getPlayer().sendMessage(
                    ChatColor.YELLOW
                            + "You cant use spawner eggs in this region!");
            return;
        }
        switch (e.getItem().getDurability()) {
        case 2:
            expOrb(e);
            break;
        case 9:
            painting(e);
            break;
        case 20:
            primedTnt(e);
            break;
        case 40:
            minecart(e);
            break;
        case 41:
            boat(e);
            break;
        case 50:
            creeper(e);
            break;
        case 51:
            skeleton(e);
            break;
        case 52:
            spider(e);
            break;
        case 53:
            giant(e);
            break;
        case 54:
            zombie(e);
            break;
        case 55:
            slime(e);
            break;
        case 56:
            ghast(e);
            break;
        case 57:
            pigman(e);
            break;
        case 58:
            enderman(e);
            break;
        case 59:
            cavespider(e);
            break;
        case 60:
            silverfish(e);
            break;
        case 61:
            blaze(e);
            break;
        case 62:
            cube(e);
            break;
        case 63:
            dragon(e);
            break;
        case 90:
            pig(e);
            break;
        case 91:
            sheep(e);
            break;
        case 92:
            cow(e);
            break;
        case 93:
            chicken(e);
            break;
        case 94:
            squid(e);
            break;
        case 95:
            wolf(e);
            break;
        case 96:
            moosh(e);
            break;
        case 97:
            snowGolem(e);
            break;
        case 98:
            ocelot(e);
            break;
        case 99:
            ironGolem(e);
            break;
        case 120:
            villager(e);
            break;
        case 200:
            crystal(e);
            break;
        default:
            break;
        }
    }
}

Since I’m using break, all of the methods i made won’t be called correct? That would cause lots of pointless code being executed and wasted performance, and the entire point of this design was for better work flow.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:34:13+00:00Added an answer on June 6, 2026 at 8:34 pm

    Your assumption is correct. Only the code that meets the specific switch case will be executed. After all, a switch statement is a substitute for a giant if-else if-else block.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Android programmers, I was trying to make a screen that has an EditText
I once read that the following coding technique is considered bad: <a HREF="page.htm" onClick="alert('Hello
For my game I'm coding a console that sends messages via AJAX and then
Hello I am coding in MVC 3, using C#. I am populating an Associating
new to Laravel (coming from Java spring), while using Route::get('/', function() { return Hello
Possible Duplicate: Useful Regular Expression Tutorial Hello, I recently started coding in javascript. I
Hello guys Im currently itearing over a list and im hard-coding fieldsets based on
Has any one tried the Spring Json View tutorial ? I followed that tutorial,
Hello and good day to all. I have an issue on coding, i have
I using cloud9 ide coding new project. When I deploy on cloudfoundry from cloud9ide.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.