int x = r.nextInt(10) if(x == 3 || x == 5 || x == 10){ //Do stuff } That should work, I'd prefer to explain it, but I must be off
You need to create an integer variable to store the integer returned by r.nextInt(10). Then, using that integer, you can check to see if it's...
Hello, as the title suggests, I am looking for a way to efficiently get a mobs NBT, modifying it, then setting it back to the mob. I haven't had...
Wingzzz alright, thanks a bunch! Its really not that important, its just misleading as when they consume the "potion" in my plugin, they are not...
Hello, I've recently come across a slight annoyance in a plugin I created. I would access the PotionMeta of a potion (by casting its ItemMeta to...
Could I see the whole Commands class please?
Using "instanceof" will compare the classes that make up that entity directly. When you use getEntity(), an instance of the class of the entity in...
Yep, you can. It just prints the text without a plugin tag.
Rather than checking for the Entity type, check for the instance of the entity. For example: public void onDamage(EntityDamageByEntityEvent e)...
molenzwiebel I'll have you know that I've spent the last 2 hours searching. I appreciate the attempted help, however having already tried that, I...
I was wondering whether there was a way to put a player to sleep (probably using packets) without them having to right click a bed? Any help is...
I'm pretty sure most of the plugins that say "you have an update" or something have that feature built in. However, if I'm mistaken, they must...
Have an array of locations, and get the array of online players, as jtjj222 said. Using a for loop, loop through both arrays, teleporting each...
What would you like explained more? The whole thing in general or the fast arrow shooting?
You could create a new ItemStack that would represent the minigun, create a custom crafting recipe to craft this new itemstack, then using an...
I had though of doing that, my only hesitation was that I'd be sending the instance of class through many parameters before actually being used xD...
I am currently developing a plugin that requires me to register an instance of a listener class outside of the main class. Naturally, you can't...
Is there a way to get a list of items placed into a crafting table? I could see some more complex ways to do this, but before I attempt those...
It's been a while since I've coded a Bukkit plugin, so I'm a bit rusty, but I think this is feasible. I'll message you when I'm finished. Anything...
Wow, like a charm, thanks a bunch. Not quite sure how the getter works since I didn't test for it, but the setter is solid. Once again, thanks for...
Separate names with a comma.