#help-development
1 messages · Page 1643 of 1
pull a Myth II and uninstall your OS when you uninstall a plugin
I wish myth 2 got a remaster
Bukkit.shutdown();
Hi, invisibles ItemFrames were introduced with 1.16, there is a built in method with the API to set an ItemFrame has invisible?
Almost forgot. Here is your example:
https://gist.github.com/Flo0/98db6edc1fc77ed4b8eeeb80f2c91282
declaration: package: org.bukkit.entity, interface: ItemFrame
okay thx
wait what there's a setArrowsInBody?
What is Myth II ?
rts from '98
infamously v1.0 was bugged
where if you uninstalled it it uninstalled the entire directory it was in
Aaah i fondly remember seeing something about that
XD
only rts I've ever played where you'd leave your best units way, way back and out of the combat for as long as possible because most of the time they would kill your own dudes
public static boolean canFit(Inventory inventory, ItemStack itemStack) {
int amountToAdd = itemStack.getAmount();
int spaceForItem = 0;
int maxStackSize = itemStack.getType().getMaxStackSize();
for (ItemStack slotItem : inventory) {
if(itemStack == null || itemStack.getType() == Material.AIR);
}
return false;
That looks like you should take a look at how if statements work in java
actually the fact artillery was best at killing your own units made that game more like a warhammer 40k rts than any warhammer 40k rts that has ever come out
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ok I think I'm giving up on boss bars
anyone happen to know if there is a way to cancel the creation of portals using the spigot api?
when you kill the dragon that is
there's a generate portal but there doesn't seem to be a "don't" generate portal
return itemStack == null || itemStack.getType() == Material.AIR;?
classic, does spigot let devs appeal those reviews?
Nope
fantastic
I once almost gave up on all my public plugins because of such a review
Cant you report them or something if it’s untrue
I think the only negative review I ever got is because I was sleeping when a dude asked for support, he couldn't even wait for a couple of hours before he posted a 1 star review saying I only did support for people who gave me money
just 10/10
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this,PacketType.Play.Server.BOSS) {
@Override
public void onPacketSending(PacketEvent event) {
event.setCancelled(true);
}
});
This may or may not work for removing any boss bar
note that this will prevent any boss bar from being sent so you may need to tinker with this a bit if you have other bossbars
yeah the thing is that I very specifically want to remove the boss bar from a dragon
I think I have a solution though, thanks for the help
If not they should make that possible
better review moderation would go a long way in making devs not ragequit, I keep seeing that happen over bunk reviews
I actually made a PR for that. Block should have the method isPreferredTool(ItemStack)
1.17 or 1.16-?
@lost matrix
1.17 has a few tags for that
Ah then, idk
I myself use large lookup enumsets - but that is not what you want
What spigot version do you use?
did you use it on the block or material?
He uses 1.15.2
@quaint mantle can’t you update version?
In a plugin from the past i just made a config and let the user add all the Materials he wants. Then put them in an EnumSet and check contains on it.
Then you are the user that can have fun adding all the entries to your List 😄
If you want to use 1.15 and dont plan on updating then you can use NMS for that.
I mean you can import all tools automatically but you have to write the code for every case
what is the reason you need 1.15?
wait, does this mean I don't have to check the strength of an item on a block now?
it’s forwards compatible
what version was your pr added for
@lost matrix
public static boolean canFit(Inventory inventory, ItemStack itemStack) {
int amountToAdd = itemStack.getAmount();
int spaceForItem = 0;
int maxStackSize = itemStack.getType().getMaxStackSize();
for (ItemStack slotItem : inventory) {
return itemStack == null || itemStack.getType() == Material.AIR;
}
return false;
}
}
Here again. Step by step explanation:
While iterating over all slots:
Check if the slotItem is null or air. If it is then add the maxStackSize to the spaceForItem variable.
If the slotItem is not null: Check if slotItem is similar to itemStack. If it is similar to itemStack then add the (maxStackSize - slotItem.getAmount()) to spaceForItem.
After you checked all slots:
If the spaceForItem is bigger than amountToAdd you return true. Return false otherwise.
ItemStack has a method called isSimilar(ItemStack) which returns true if two ItemStacks are similar and can be stacked.
You can do it like the JavaDocs are saying it:
Check for the firstEmptySlot. If it returns -1 the inventory is full.
if (inv.firstEmpty == -1) // full inv
Nope. If there is a stack that can fit the item he is trying to add the method fails.
br
You got 5 Apples and want to add 3 more -> no slot is empty but you could still add the apples
int slot = p.getInventory().firstEmpty();
if (slot == -1) return;
Wouldn't that suit him?
he does not need to add a new item
But if you have 5 apples and want to add 3 more, they should add
This inventory has no empty slots.
This inventory can easily fit 20 more Apples.
Ugh. It can fit 252 more apples -.-
but if there is a similar item that I want to give, perform
👍
Hi. I've got a question
You know the "⚙️ preparing" sign that appears as the player count when an aternos server is starting up
Is it possible to add that to an apex-hosted or localhosted server?
Sure. You just need to listen for the right ping packet and return the right String. I have no idea what aternos or apex-hosted is but im suspecting its the server version that is being displayed like that
You can write whatever you want here
aternos and apex are just server hosts
do you know if there's any plugin that can do that?
No idea. Thats a question for #help-server
I have a problem while removing item from chest, it doesn't work.
Chest chest = (Chest) block.getState();
chest.getBlockInventory().remove(SOME_ITEM);
chest.update();
Is it wrong?
when I change the facing of a block the block drops itselfs. So when I change the facing of a powered piston the piston drops. Can I disable that?
Try to unpopwer the piston before updating the block state
What do you expect to happen and what do you observe is happening
ok, thanks
I will try. If it doesn't work I will send my code
Nothing is shown error, but chest doesn't remove that item
I want to reduce item, and it not remove
for this to work, you need at least 1 cell to be free
might need to use snapshot inventory
Opp
Try if removeItem(ItemStack... items) yields the result you want
Why yields the result? It should remove from the chest instead of giving me
.setItem() also doesn't work
Then you might look at the wrong Inventory
So, what?
What do you mean So, what?. If you change Inventory A and then look at Inventory B you wont see the changes you made to Inventory A for obvious reasons.
What to do then? If my above code isn't working, can you give me a working one?
I think this is enough to work
Chest chest = (Chest) block.getState();
chest.getBlockInventory().setItem(0, SOME_ITEM);
chest.update();```
doing this Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {}) will use a different thread, right? and the thread is "random", its not just 1 parallel thread, right?
but, whats the best way of doing something in a different thread, to avoid blocking the main thread, but always use the same thread?
its a worker thread in a ForkJoinPool
specifically sql queries, but sqlite only allows 1 connection at a time, so, using the bukkit scheduler, it throws an sql error sometimes
do your blocking calculations async and send the result back to the main
by "the same thread" i dont mean the main thread, i mean doing all the connections with the same thread, but it doesnt have to be the main thread
i mean using a different thread, but always the same thread, not just any available thread at the time
This is what you need if you want to see if an inventory can hold something you are trying to add.
or
what if the slot was empty
add the max size of the itemstack then
to the space value
I don't think so but you can use Block.isPrefferedTool() if you have a list of tools
oh is that new new
😦
ngl i skipped from 1.8 to 1.16
and my god
my life got 10x easier
the only reason why people should stay on 1.8 is for pvp
and I think its because people are lazy to learn the new type of pvp they stick to 1.8
This is my code:
int x = Integer.parseInt(s[1]),y = Integer.parseInt(s[2]),z = Integer.parseInt(s[3]);
Material mat = Material.valueOf(s[4]);
Block b = world.getBlockAt(x,y,z);
b.setType(mat);
BlockData blockData = b.getBlockData();
try {
if(blockData instanceof Directional) {
BlockFace blockFace = BlockFace.valueOf(s[5]);
((Directional)blockData).setFacing(blockFace);
}
}finally {
b.setBlockData(blockData);
}
And this is what happens: https://cdn.discordapp.com/attachments/757584290748956734/876511726953201714/Piston.gif
The piston drops but I don't want that
@lost matrix
public static boolean canFit(Inventory inventory, ItemStack itemStack) {
int amountToAdd = itemStack.getAmount();
int spaceForItem = 0;
int maxStackSize = itemStack.getType().getMaxStackSize();
for (ItemStack slotItem : inventory) {
if(itemStack == null || itemStack.getType() == Material.AIR) {
spaceForItem = maxStackSize;
if(slotItem == ) {
}
}
}
return false;
}
}
I do not know how to proceed
Are there any ways to apply potion effect on an abstract player
Just try to add the item with Inventory#addItem(), it'll return a map with all items that couldn't fit
HashMap<Integer, ItemStack> map = event.getWhoClicked().getInventory().addItem(new ItemStack(Objects.requireNonNull(event.getCurrentItem()).getType()));
if (map.isEmpty()) {
event.getWhoClicked().sendMessage("You bought a " + event.getCurrentItem().getType() + " for " + buyprice + " coins");
}
else {
event.getWhoClicked().sendMessage("You don't have enough space in your inventory !");
}
For example
@tame coral
Ye ?
you russian?
Nah, why ?
how do I check if there is free space in the inventory?
If it's in order to add a specific item ^
I need to issue an item to the inventory. how to make an item be issued to the inventory, if the same item is in the inventory
what do you mean by issue ?
do you mean player.getInventory().addItem?
if each slot is filled by one apple, it'll return -1, while you can still pickup apples
I need to issue an item to the inventory. how to make an item be issued to the inventory and if the same item is in the inventory issue it. if there is no place in the inventory and there is no similar item, do nothing
I know, but the answer of the guy question is that.
I sent you the code
Where?
.
Oh, thank you, I'll try
Just need to add a else if statement where if the item in the loop is air or null add 64 to space
How
How can I get all the specific data of an entity like name, inventory, color, ...?
There's literally a method in order to add an Item and handle the ones that couldn't be added ??
declaration: package: org.bukkit.entity, interface: Entity
Looks at the methods in there
but how can I get the inventory or the color of the entity
Are you using an IDE ?
Entity needs to implement InventoryHolder
because that's where autocompletion is very useful
getInventory()
I don't get what you mean by color though
how can I make a number format configurable?
like the color of a sheep
Oh
You first need to check if the entity is a sheep
Or if it's an instance of Colorable
in that case you can type cast it and use getColor()
can some1 test my plugin
Can't you just test it yourself
my cumputer is bad so nah
bruh
and i want another persons pov
is this a correct if statement to check if someone is in a world?
if (player.getWorld() == Bukkit.getWorld("survival"))
use equals instead to compare objects
Always check objects with equals()
okay
as in
if (player.getWorld().equals(Bukkit.getWorld("survival")))
That's not what I mean. If a villager is a desert villager I want to get that the villager is a desert villager
Technically should work
Then it depends
Read the docs
For a villager it would be Villager.getVillagerType()
There is no such thing as a method that return all of an entity's data
Every entity has it own class, you can find methods from the javadocs.
^
ok. thanks
is there a tutorial for setting up a debug for intelij and gradle
currently the ones in spigot are different
https://www.spigotmc.org/wiki/intellij-debug-your-plugin/
Doesn't this one work ?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
does this work to remove the provided itemstack from the inv?
private void sell(boolean sell, int amount, Material material) {
if (sell) {
ItemStack item = new ItemStack(material, amount);
if (player.getInventory().containsAtLeast(item, amount)) {
player.getInventory().removeItem(item);
}
}
}
I use gradle as a build system
that tutorial doesnt support build systems I think
it works
But i believe doing like so is better
I did try it before
HashMap<Integer, ItemStack> map = event.getWhoClicked().getInventory().removeItem(new ItemStack(event.getCurrentItem().getType()));
if (map.isEmpty()) {
event.getWhoClicked().sendMessage("You sold a " + event.getCurrentItem().getType() + " for " + sellprice + " coins");
}
else {
event.getWhoClicked().sendMessage("You don't have any of that item in your inventory");
}
but doesn't rlly work, I think I probably did smthing wrong imma try again
Okay
is there a gradle plugin that allows debugging?
That tutorial should work fine
Ye
uhh i kinda expended it
private void sell(boolean sell, int amount, Material material, double price) {
if (sell) {
ItemStack item = new ItemStack(material, amount);
if (player.getInventory().containsAtLeast(item, amount)) {
player.getInventory().removeItem(item);
} else {
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 6, 1);
return;
}
} else if (Main.eco.has(player, amount * price)) {
Main.eco.withdrawPlayer(player, price);
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_CELEBRATE, 6, 1);
Utils.giveOrDropFor(player, new ItemStack(material));
} else {
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 6, 1);
return;
}
Utils.message(player, (sell ? "§a+§b " : "§c-§b ") + price + " §3coins");
}
um isnt remote now like remote jvm debug?
but the itemstack alreasy contains the amount of items so when i do .containsAtLeast(item, amount) doesnt that check if the inventory contains like 4 * 4 items? instead of just 4?
No
oh oke
so debug mode is supposed to update everytime I do changes to the code?
How do I play a sound that is audible from enourmous distances? Like up to 128 blocks away
What's a good way to test the efficiency of a method? Time taken to run it? if so, how?
if i'm modifying an inventory with already custom name with this method, will the custom name stay?
oh cool! thank you
anybody?
🤸 🏌️
Yes
The title will stay
However titles really don’t belong to inventories
They belong to the view
You see Bukkit kinda hides the concept between the interface/menu and the container
Well it used to
Now getTitle is long gone from Inventory
oke
How do I play a sound that is audible from enourmous distances? Like up to 128 blocks away
within the distance
is there an easier method than that? Or just a modification i can do to the syntax of playsound?
Not that its too hard, I just want to know if theres another way
is it possible to have itemstack with more than 64 items?
sounds weirrd but yea
oh np then
but will it throw an error when i try item.setAmount(item.getAmount() + 64) ?
or will it just stay by 64
ah
The inventory has ha check if the itemstack over 64. If is over 64 than its sets to 64 😉
is there a way to process a string as code? I know the security risks behind it...
if you understand what i mean by that
Error while building pom.xml:
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
pom.xml:
but if u just wanna run some code, something like jshell is adequately what you want
needs to be ingame ^^
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
check this then
ok ty
[WARNING] 'dependencies.dependency.systemPath' for org.geysermc:floodgate-bukkit:jar should use a variable instead of a hard-coded path D:/Workspace/Lib/floodgate-bukkit.jar @ line 43, column 25
or use something like javassist
How do I fix it?
make it a string variable or something
and use that variable instead of the path who knows
How can i check how many numbers there are after a . in a string
like 100.23
2 numbers after the .
regex would be one way
whats the easiest way to get the direct line of sight distance between 2 players?
like simpler than using .getLocation and some calculations
LOS distance would be a lot more complicated o.O
Like, blocks obstructing the line of sight etc
Or are you talking about just plain old distance
plain distance
Ähm. How do I create one?
wut
sorry, i just meant direct distance by it
I didn't work with xml before
player.getLocation().distance(otherPlayer.getLocation())
uhh
ty
Tho use distanceSquared
For anything that doesn't have to be displayed
To save yourself a sqrt call
wait why
Because they are the most expensive part of the calculation
And if you perform them a shit load of times, you'll slow down
Hence, if you can, compare to the squared distance
sorry, I don't understand fully
I'm trying to get a list of all players and their distance around another player, which I do like this:
Player player = Bukkit.getPlayer(args[0]);
//String sound = args[1];
//double volume = Double.parseDouble(args[2]);
int range = Integer.parseInt(args[1]);
ArrayList<Player> nearby = new ArrayList<Player>();
for (Player p : player.getLocation().getNearbyPlayers(range, range, range)){
nearby.add(p);
sender.sendMessage(String.valueOf(player.getLocation().distance(p.getLocation())));
Yeah in this case you are displaying the distance so you need the actual value. The Location#distance call is fine
But it is more expensive (CPU wise)
So in places where you can avoid it you should use distanceSquared
ok
str.split("\\.")[1].length()
assuming they're all numbers
and you only have one .
Will there be any performance issues with creating an average of 50 objects per second as long as the server is running?
what objects?
I mean objects are expensive ofc if we see it from a conservative perspective
Custom objects which contain a dozen member variables pulled from a mysql database
doubt
the server code is creating enough variables per tick, unless you are doing IO you should be fine
what if its only like 10 times and its on good hardware
you are fine as well
ok cool thank you
can i prevent this thing from printing to the console somehow while i do something?
[10:53:12 WARN]: Can't keep up! Is the server overloaded? Running 7099ms or 141 ticks behind
how about memory issues?
give the server more ram
I mean just set the max allocate ram to be adequate for your behavior/requirements, then it should be fine as long as you're not creating any memory leaks that is.
memory leaks?
yes
can Player#playSound() play custom sounds from a resource pack?
objects which are no longer considered referenced but cannot be garbage collected
thats a leak
i doubt that will prevent generating hundreds of chunks per second from lowering the tps
Well Idk exactly your design here so cant tell for sure
How do you unload data from object references?
but just using allocated memory doesn't inherently mean you'll encounter a memory leak
The garbage collector is awesome, in fact it finds objects that are no longer referenced and enqueues them for gc.
So most likely you'll be fine
Most of the objects created, 50-100 objects per second, will only be used for a small portion of time.
use a profiler or something, that usually discloses any undiscovered leaks
Wait so when the server's memory dips down like this, that's garbage collection? https://prnt.sc/1q5mlf6
hmm yes
Cool! learned a new thing
I'm gunna try making 10,000 objects, and watch the memory shoot up and go down
Tbh it would be a pain to remove the data from references properly
Idk depends how you're doing it
there are known principles when it comes to data models and that stuff
I am using the objects to create an itemstack for a GUI menu. The object's goal is to return an itemstack which is modified by data found in the SQL database. Every item on every page a player views will need to create 50 new objects. Therefore each new page will create 50 new objects, making the previous 50 objects from the last page unneeded. You say garbage collection will get those though, so I shouldn't worry right?
Not sure what that is
is there any way i can count all chunk tickets added by my plugin?
a soft reference is a reference that points to an object, however if the jvm instance is running low on memory it will gladly stop referencing that object making it available for garbage collection
edit ofc if any other object still reference it strongly then it in principle doesnt matter
so this is a weird question but is the trick to using the EnderDragon.Phase.DYING to apply it before the dragon reaches 0 hp?
I don't know if it's something about my implementation but it looks like just setting the health to = 0 will instantly remove it? might be something else in my system that I am overlooking though
Thanks for your help Conclure
if i do item.setAmount() does that updates the inventory? i'm kinda stuck
yeah anyways SoftReference is what you'd be look at or a cache library like Caffeine, highly recommended
Okay thank you :>
Was interesting to see the server memory usage after 1000 objects were created in a for loop https://prnt.sc/1q5nu7v
went back down to normal during the next garbage collection
yeah lol
garbage collection does hella of a good job
its generally hard to actually achieve a memory leak
challenge accepted
oh shit
Guild guild = Guild.createGuild(this.plugin, RolePlayer.getOnlineRolePlayer(player).getTempGuildName(), player, block.getLocation());
guild.getGuildLocation().subtract(0, 1, 0).getBlock().setType(Material.GOLD_BLOCK);
// Sets the blocks manually, because I'm bad in math
guild.getGuildLocation().subtract(0, 1, 0).add(1, 0, 0).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 1, 0).add(0, 0, 1).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 1, 0).subtract(1, 0, 0).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 0, 1).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 1, 0).add(1, 0, 1).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 1, 0).subtract(1, 0, 1).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 1, 0).subtract(1, 0, 0).add(0, 0, 1).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 1, 0).subtract(0, 0, 1).add(1, 0, 0).getBlock().setType(Material.GOLD_BLOCK);
guild.getGuildLocation().subtract(0, 1, 0).add(0, 1, 0).getBlock().setType(Material.BEACON);
whoa
Location startLocation = startChunk.getCenterChunkLocation().add(0, 1, 0);
public Location getCenterChunkLocation(){
Location center = new Location(this.chunk.getWorld(), this.chunk.getX() << 4, 64, this.chunk.getZ() << 4).add(8, 0, 8);
center.setY(center.getWorld().getHighestBlockYAt(center));
return center;
}
don't do the thing you are doing
Some guy just made a loop creating a thousand random recipes each tick, it worked
beacon?
No. a 3x3 gold field plus a beacon above the center gold bock
3x1x3?
69
Wouldn't that just be an overloaded amount of memory rather than a memory leak?
how to set color for glow?
I think
location goldBlockY = whatever;
for (x = -1; x <2; x++)
for (z = -1; z<2; z++)
Location location = new Location(world, x, goldBlockY.getY() - 1, z);
haha code go brr
man I am just about done
Hi.
How can I get the player as a command argument in the Spigot plugin?
if you mean player from command executor you can just cast it
Loops doesn’t inherently use more memory
If you create new objects in them, sure
I mean I've caused a few mem leaks in the past
just keep adding new entities to a list for forever

🤷 it's not that hard to do by mistake
especially when you're still editing critical code 12 hours after you decided you were going to stop for the day
Well if you’re actually trying to make a solid application it should be trivial in most cases to quickly tweak or avoid
like right now
Oh right lol
there's a fallible human behind pretty much every line of code
Indeed
for some reason player.updateInv does not work
I genuinely can't tell why dragons won't do the death animation
That don't fix my problem.
It still place as before
no it doesn't
that uses a fixed y value so I can't see how it would be placing gold blocks above that y value
But I'm using guild.getLocation
so what?
int * double is int right?
no
Hello i'm asking for how to make /stack command
like if i have potions on my inventory they gets all of poitions and set it on 1 slot
is there anyway to make it
get the current itemstack and increase its amount to 64
eventually create a new max size for that item
When does a PlayerLevelChangeEvent is getting called? Does it triggers on Experience Level Change or what kind of Level is meant by that
where can i hire a developer?
most likely on the spigot forums service section
uhh does item.setamount also updates the item? so the amount is visible
hey, can someone help me with using a player name as an arg in a command e.g. /kill (playername)
Whats the Issue?
check if Bukkit.getOnlinePlayers().contains() your args[0]
then you now its a player
Player target = Bukkit.getPlayerExact(args[0]);
if (target instanceof Player) {
target.setMaxHealth(20);
target.setHealth(20);
target.setGameMode(GameMode.SURVIVAL);
} else {
player.sendMessage("This player does not exist");
}
i hope you check if the player is online
is bukkit.getplayerexact a viable method?
Yes
i dont get how it doesnt work than
i have an alt on the server
and i type /revive (altign) and it gives nothing no erros
errors
Player target = Bukkit.getPlayerExact(args[0]);
if (!Bukkit.getOnlinePlayers().contains(target)) {
// player isnt online, send a message or something
return true;
}
// do something with the player is he's online
this looks better
if (Bukkit.getPlayerExact(args[0]) instanceof Player target) {
}
This should work fine also
wew
hey conclure
hey Jeff
Why?
i dont think you want to heal or revive an offline player if thats even possile
just the instanceof would do the trick also this case
no hes trying with get player so he need to do the @quaint mantle way
like with bukkit.getplayer
?
That
Bruh
:/
Don't need to check if Bukkit.getOnlinePlayers() contains player
getPlayerExact works also
Ya
if you're using getPlayerExact yea dont check if hes online
Check in google, what's difference between getPlayer and getPlayerExact
Bruh
what
^
none of those is needed to check online/offline
Ya, just if it ofline, getting error
getPlayer and getPlayerExact grabs the player from the backing map which only holds players who are online during invocation
No it return null then
Thus an instanceof suffice
any one?
Hi i want to compile a ServerJAR and i need help on that
could someone please help me on compiling 1.8.8 of https://github.com/softpak/HOSE ?
Would be awesome and i would give you a "thank you" gift 🙂
this is what i do
which IDE are you using?
i dont see a src
provide mind-blowing multithreaded impl like this
lol
ah there
forking to then directly joining
but what is this all
mind blown
else if (cmd.getName().equalsIgnoreCase("revive")) {
if (args.length == 0) {
player.setMaxHealth(20);
player.setHealth(20);
player.setGameMode(GameMode.SURVIVAL);
}
} else {
Player target = Bukkit.getPlayer(args[0]);
if (target instanceof Player) {
target.setMaxHealth(20);
target.setHealth(20);
target.setGameMode(GameMode.SURVIVAL);
} else {
player.sendMessage("This player does not exist");
}
}
return true;
when just using /revive it works fine but when putting an arg the command doesnt work anyone has a solution?
your else statement is outside the command check
why are you checking the command name anyways
wait which else?
imagine compiling with javac
@quaint mantle which else is wrong?
int random = new Random().nextInt(Bukkit.getOnlinePlayers().length);
Player player = Bukkit.getOnlinePlayers()[random];
ty
uh
int random = new Random().nextInt(Bukkit.getOnlinePlayers().size());
Player player1 = Bukkit.getOnlinePlayers()[random];```
?
?
why the uh
ugh its a collection so i should add them to a arraylist and call the get method
maybe there's a better way
like do for?
yea
or just like this
ArrayList<Player> p = new ArrayList<>(Bukkit.getOnlinePlayers());
int random = new Random().nextInt(p.size())
Player player = p.get(random);
int random = new Random(getServer().getOnlinePlayers().size()).nextInt();
Player player = (Player) getServer().getOnlinePlayers().toArray()[random];
else if (cmd.getName().equalsIgnoreCase("revive")) {
if (args.length == 0) {
player.setMaxHealth(20);
player.setHealth(20);
player.setGameMode(GameMode.SURVIVAL);
}
} else {
Player target = Bukkit.getPlayer(args[0]);
if (target instanceof Player) {
target.setMaxHealth(20);
target.setHealth(20);
target.setGameMode(GameMode.SURVIVAL);
} else {
player.sendMessage("This player does not exist");
}
}
return true;
when just using /revive it works fine but when putting an arg the command doesnt work anyone has a solution?
?paste
oh true
i already told you
ye but which else do u mean
Hi everyone. I have a problem with my plugin and I don't understand why it appears. My goal is to make a weather module which manages the weather of a specific world. So there are different types of weather : SUNNY, RAIN and STORM.
However, I have a problem with the RAIN weather. Indeed, when the user wants the rain to be enabled for a specific world, I use the WeatherChangeEvent to detect a weather change and I cancel it in case in which the new weather isn't rain. However, when I use the /weather clear command and the event is cancelled, it is called a lot of times. I don't know of to fix that. Can someone helps me, please ?
Version used : 1.8 (I want my plugin to support 1.8 to 1.17).
Code :
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWeatherChange(WeatherChangeEvent event) {
System.out.println("WeatherChangeEvent");
event.setCancelled(true);
}
Note : The sysout is displayed like a loop in the console.
you will have to update the world time till the weather is supposed to change next
else the server will endlessly try to switch into the next weather state
I'm the only one on the server.
System.out.println("WeatherChangeEvent");
event.setCancelled(true);
World world = event.getWorld();
world.setWeatherDuration(12000);
@eternal night like that ?
should hopefully work
You sure you don't just /reload
And your plugin is loaded a bunch of times or something
I restarted the server. The listener is registered only once and the message in the console is spammed as before.
However, I should notice that when I do /weather rain again, the event is no longer spammed.
?paste
this pom looks kinda weird
https://paste.md-5.net/oyoyuhagok.xml
Something also very interesting with my problem is that in the event, world weather duration is set to 0 even if I set it to 12000 at the end of the event.
@eternal night
hey i am trying to make a god command in a gui but how do i get if a player is already god to check to set them godmode to false and if
and if not set them to god
you can use a List or Map to keep track of the player ids and a boolean value
hey i am tying to make a random player system or something
uhhh any way whan i do the command it's showing to me a player and to ather player it's showing b player
how can i fix it?
here is my code
ArrayList<Player> p2 = new ArrayList<>(Bukkit.getOnlinePlayers());
int random = new Random().nextInt(p2.size());
Player player = p2.get(random);
p.sendMessage(random + " " + player.getName());
player.setGlowing(true);
put the player uuids in a set
any one?
what
.
uhhhhhhhhhhhhhhh
help
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
...........
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
but i dont have timeeeeee
So don't be a developer
you'll just have to have time
Very funny

Hello, so I'm trying to code a GUI plugin. How can I make a different GUI pop up when a player right clicks a item in the first GUI? Currently, it performs what I want to become only the left click function, whether the item in the GUI is left clicked or right clicked.
I've gotten that part down. 😅 Only thing is, I want something different to happen when a player right clicks a item in the GUI, if thats even possible
idk my english i so bad
ah, thank you!
when using player.teleport can i just teleport the player to a specific coordinate?
what do i put between the () then
like player.teleport(xxx)
Does someone has an idea for that ? #help-development message
yes
Im trying to create config system but my config keeps turning into this mess: https://pastebin.com/SVWQXdpY
this is my class: https://pastebin.com/yQBAw7BX
Can anybody tell me why its going like this, I cant figure it out?
location
so
Player location = (the cords)
player.teleport(location)
What information do you want ? I have a weather set to rain. When I use the /weather clear command, the WeatherChangeEvent is spammed infinitly.
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
oh
player.teleport(a location you're getting from somewhere)
I think you're right but how to fix it ?
Location location = new Location(Bukkit.getWorld("world"), x, y, z);
yea
and then player.teleport(location);
na just world, x, y, z
pmm how can i fix this
The POM for org.spigotmc:minecraft-server:jar:1.11.2 is missing, no dependency information available
int random = new Random(Bukkit.getOnlinePlayers().size()).nextInt();
Player player = (Player) Bukkit.getOnlinePlayers().toArray()[random];
?paste
🥺
where did you even got it from?
to array or something
something like that
that good
does it work?
try
not rly
Randoms are kinda expensive to create but apart from that yeah
How does nextInt work without an argument
yea
the size should be in nextInt not the Random ctor, no?
Yes
And randoms get a heck of a lot better in JDK 17
The ctor is the seed
I hope mc makes use of it
17.08 12:21:33 [Server] INFO java.lang.ArrayIndexOutOfBoundsException: Index -1154715079 out of bounds for length 2
17.08 12:21:33 [Server] INFO at net.inbar.main.hideandsik.command_maneger$1.run(command_maneger.java:50) ~[?:?]
17.08 12:21:33 [Server] INFO at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-786]
17.08 12:21:33 [Server] INFO at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-786]
17.08 12:21:33 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1427) ~[patched_1.16.5.jar:git-Paper-786]
17.08 12:21:33 [Server] INFO at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-786]
17.08 12:21:33 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1342) ~[patched_1.16.5.jar:git-Paper-786]
17.08 12:21:33 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1130) ~[patched_1.16.5.jar:git-Paper-786]
17.08 12:21:33 [Server] INFO at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-786]
17.08 12:21:33 [Server] INFO at java.lang.Thread.run(Thread.java:831) [?:?]```
idk not even looking at it
Like we said
Move the size to nextInt
:/
uh?
well learn java then
lol
not lol
you have to move the size from the ctor to the nextInt function parameter
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ThreadlLocalRandom.current().nextInt(upperBound)
So wait, is my method correct?
no
bruh
the random ctor takes a seed
you gave the size as the seed
works, but makes 0 sense
lng
smh
thats a very long line
L
Player p = Bukkit.getOnlinePlayers().stream().skip(new Random().nextInt(Bukkit.getOnlinePlayers().size())).findFirst().get();
thats good
does that not work
lol
why are we still on this
lmao
mmmmm yesss
streams go brrrr
I would advise using thread local random
Or you could go with something like a SplittableRandom
Player p = Bukkit.getOnlinePlayers().toArray()[ThreadLocalRandom.current.nextInt(Bukkit.getOnlinePlayers().size())];
Something like that
I mean you don't have to create a new Random instance then which stonks
So even in a single threaded application ThreadLocalRandom is fine
yeah bingie I agree
some explanatory variables wouldn't be too bad
tho its really a nitpicky criticism
ik but i had random defined in that class 🙁
so small problem
Location location = new Location(Bukkit.getWorld("world"), 200, 85, 200, 0, 0);
player.teleport(location);
this code does not work :(
Explain how it does not work
is the world not present?
so i have an event onplaydeath and it does set the to gamemodfe adventurer like it chould but it doesnt tp them :p
idc if you can read it its still better to write it in multiple lines
wdym by that?
hey, how can I translate world coords (ex, x: 100) to chunk coords (0 - 15)?
Hello !
Does anyone know why this is deprecated ?
I'm wondering why this method is deprecated but the same method with a Runnable instead of a BukkitRennable is not deprecated man_shrugging
🥲
?scheduling
public static void onPlayerDeath(PlayerDeathEvent event){
Player player = event.getEntity();
why can i not put Player player = event.getPlayer(); ?
read the bottom section
It says right there.
Ty
Because PlayerDeathEvent doesn't have a getPlayer
So why this is deprecated ?
Conclure's answer was easier
How do i compile this:
https://github.com/softpak/HOSE
Because it extends EntityEvent, not PlayerEvent
I mean spnda's redirection isn't less right
well it both says effectively the same
Is that one of the methods that was deprecated because people were getting confused by the name?
😩
not that easy
it's basically just because of API changes that this is for some reason the preferred way of scheduling now
i need it in a diffrent version
Ew 1.11
Okay ty
Its better than you think
if ( enabled && Thread.currentThread() != MinecraftServer.getServer().primaryThread )
{
- throw new IllegalStateException( "Asynchronous " + reason + "!" );
+ //throw new IllegalStateException( "Asynchronous " + reason + "!" );
}
Patches like this give me shivers
tf
Oh, last question, does anyone use dependency injection on spigot ?
How ?
but now they dont support it so i want to geo back
Yes
the design pattern, I use it all the time
Ik
Ty 👍
Someone told me to use dependency injection and another one told me that it's not useful on spigot so I was a bit confused 😕
hmm
Static abuse
int y = world.getChunkAt(x,z).getChunkSnapshot(true,true, true).getHighestBlockYAt(floor(x) >> 4, floor(z) >> 4);
public static int floor(double num) {
int floor = (int) num;
return floor == num ? floor : floor - (int) (Double.doubleToRawLongBits(num) >>> 63);
}
trying to get the highest block in pos
you know how floating point numbers are represented in binary? (Idk what the math is that you're doing there, just looks weird)
does it work now?
int numbers like 100 and 1000 doesnt work as well
without flooring
Doesnt java alread have floor methods?
Pretty sure there is Math.floor
wrong chunk coordinates
I need to convert real coords to chunk coords
current code
int x = RandomUtils.nextInt(44000) - 22000;
int z = RandomUtils.nextInt(44000) - 22000;
int y = world.getChunkAt(x,z).getChunkSnapshot(true,true, true).getHighestBlockYAt(x >> 4, z >> 4);
block = chunk.getBlock(Integer.parseInt(data[0]) & 0b1111,
Integer.parseInt(data[1]), Integer.parseInt(data[2]) & 0b1111);
int realX = ...;
int chunkX = realX % 16;
2.0D is 100000000000000000000000000000000000000000000000000000000000000 for example.
IEEE 754
Caused by: java.lang.IllegalArgumentException: x out of range (expected 0-15, got -11)
What are you trying to do? What is the reason for the chunk snapshot? Makes no sense here.
besides, you can just do Math.floor(num) to floor your double
which will probably be a better implementation
mine has never failed
I need to get the highest block, and the chunk is not loaded so the server doesnt know the real highest block
Im not flooring at this point
world.getChunkAt(x,z) will load the chunk
doesn't change the fact that you probably should use Math.floor instead
getChunkSnapshot does literally nothing
Use the World#getHighestBlockSomething because you load the chunk already anyways.
no i just got back from eating i havnt changed anything uet
so why I dont get the actuall heights?
what did u tell me again
Because you are trying to get a coordinate thats not within the chunks bounds
instead of Bukkit.getWorld bla bla bla try player.getWorld()
and what I do form here? world.getChunkAt(x,z)
So you just want to get the highest location at a certain random x, z location?
yep
public Location getRandomHighestLocation(final Location center, final int radius) {
final World world = center.getWorld();
final ThreadLocalRandom random = ThreadLocalRandom.current();
final int x = random.nextInt(-radius, radius);
final int z = random.nextInt(-radius, radius);
final int chunkX = x >> 4;
final int chunkZ = z >> 4;
final Chunk chunk = world.getChunkAt(chunkX, chunkZ);
return world.getHighestBlockAt(x, z).getLocation();
}
@tardy delta so Location location = new Location(player.getWorld(), 200, 85, 200, 0, 0);?
try it out
it doesnt work
What are you trying to do?
grr what are you even doing
wait ill send full event code
public static void onPlayerDeath(PlayerDeathEvent event){
Player player = event.getEntity();
Player killer = player.getKiller();
if (player.getMaxHealth() == 2){
player.setGameMode(GameMode.ADVENTURE);
Location location = new Location(player.getWorld(), 200, 85, 200, 0, 0);
player.teleport(location);
killer.setMaxHealth(killer.getMaxHealth()+2);
} else {
player.setMaxHealth(player.getMaxHealth()-2);
killer.setMaxHealth(killer.getMaxHealth()+2);
}
}
it does set the player to adventurer but doesnt teleport
- Dont make it static
ki
above it
ok
i think it s something else
Do you manually set the players max health to 2 somewhere?
no when someone isnt at 2 health and he dies 2 health gets removed
so u keep doing that
Ah i see what you are doing.
until hes at 2 health
What version are you on?
1.17
Then dont use those methods. They are deprecated for a reason.
Never use deprecated methods.
^
which method should i use then to teleport
seems to work, thank you 😄
what is deprecated?
Example:
@EventHandler
public static void onPlayerDeath(final PlayerDeathEvent event) {
final Player player = event.getEntity();
final Player killer = player.getKiller();
final AttributeInstance playerMaxHealthAttr = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
if (killer != null) {
final AttributeInstance killerMaxHealthAttr = killer.getAttribute(Attribute.GENERIC_MAX_HEALTH);
killerMaxHealthAttr.setBaseValue(killerMaxHealthAttr.getBaseValue() + 2.0D);
}
if (playerMaxHealthAttr.getBaseValue() == 2.0D) {
player.setGameMode(GameMode.ADVENTURE);
final Location location = new Location(player.getWorld(), 200, 85, 200, 0, 0);
player.teleport(location);
} else {
playerMaxHealthAttr.setBaseValue(playerMaxHealthAttr.getBaseValue() - 2.0D);
}
}
why final event?
Its just a setting of my IDE. Everything is final by default
oh lol
how can i hide play nik name?
\c
\char
put another
any one?
google is a good one
What do you mean by that? A player doesnt have a nick name by default.
I think he wants to completely hide the nametag. I think there is some scoreboard magic for that iirc
I think he wants to completely hide the nametag
YES this
when using .addBan you need to give an expiring date how can i make the ban infinite?
i made an inventory with an itemstack as icon, when i use itemstack.setAmount(itemstack.getAmount() + 1) for some reason it does not display the number
you have to set the item back
so i would have to do this every time 🐼
Setting the amount of an ItemStack within an Inventory should work fine as long as its the same instance of ItemStack.
what do you use to record gifs?
ScreenToGif 😄
thanks
UUID playerId = player.getUniqueId();
Bukkit.getBanList(Type.NAME).addBan(String.valueOf(playerId),"You have died", new Date(null), "You have Died");
is this a good code to ban someone
well
add them to the banlist
wait
I need some help. the comand line didnt make my jars for sigot. it made folders not jars
yes i have to change my § symbols 😔
and you also have to kick him
just banning wont kick
Do you use maven?
to put in source? you mean which parameters?
wait is the spigot api on 1.13 or 1.14? or does it not madder?
no like is source the person that bans the other person?
its on 1.17
ah ok thanks!
it is the player name who banned him but it's not important
I am not a programer so I do not know what that is. I followed the instructions on the spigotmc site and did the whole prequisits with the batch file and the buildtools.jar to compile the jars but it gave me folders insted of jars
oh ok tysm
what is the max dameg?
You can configure it as you like.
?paste
I think default is 2048 and absolute max is around 1.8 with 308 zeros
I think i can write some of these things more effiient
https://paste.md-5.net/imucagocet.java
So max damage is around
1800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Hi everyone. I have a problem with my plugin and I don't understand why it appears. My goal is to make a weather module which manages the weather of a specific world. So there are different types of weather : SUNNY, RAIN and STORM.
However, I have a problem with the RAIN weather. Indeed, when the user wants the rain to be enabled for a specific world, I use the WeatherChangeEvent to detect a weather change and I cancel it in case in which the new weather isn't rain. However, when I use the /weather clear command and the event is cancelled, it is called a lot of times. I don't know of to fix that. Can someone helps me, please ?
Version used : 1.8 (I want my plugin to support 1.8 to 1.17).
Code :
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWeatherChange(WeatherChangeEvent event) {
System.out.println("WeatherChangeEvent");
event.setCancelled(true);
}
Note : The sysout is displayed like a loop in the console.
i'm earning - 100 coins yea hmmm smh
Discord4j vs JDA
Pros/Cons?
Hmm JDA is favorable in terms of getting things done faster since it’s a lot more exposed to developers due to its overall popularity. I haven’t done much discord4j myself so can’t make a fair comparison.
I've only used JDA 🤷♂️
I wrote a light wrapper for Discord4J.
It's a bit of a sluggish library to use, if you want honesty.
It uses the Reactor library for all values since that provides reactive programming, but it also means you need to do a lot of null-checking when block()ing a Mono in case you don't want to use the reactive model.
Well isnt JDA reactively designed also
Maybe.
I think I'd recommend JDA personally though.
Just because of how nice it looks :)
What would the code look like?
((Player) sender)
Depends if he's setting a variable or using it as the object
Never seen this before, anyone have any idea lol
[14:36:21 WARN]: Entity threw exception at world:246.10000610351562,42.25,1408.949951171875
[14:36:21 WARN]: java.lang.NullPointerException
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.AdvancementDataPlayer.b(AdvancementDataPlayer.java:435)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.EntityPlayer.tick(EntityPlayer.java:652)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.Entity.passengerTick(Entity.java:2382)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.EntityLiving.passengerTick(EntityLiving.java:3089)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.EntityHuman.passengerTick(EntityHuman.java:483)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.WorldServer.a(WorldServer.java:1552)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.WorldServer.entityJoinedWorld(WorldServer.java:1516)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.WorldServer.doTick(WorldServer.java:1132)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1552)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:439)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1402)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1134)
[14:36:21 WARN]: at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:292)
send the complete error
that is the complete error
the entity at the location is an NPC created using https://www.spigotmc.org/threads/how-to-create-and-modify-npcs.400753/
bot deleteing
bot deletes the name
have you ever wondered why it does that
Because you're not allowed to tell people to download the jar from mirror sites. Only to use build tools.
yeah but if he says it dont works for him he can download it there
you're not allowed to download it in the first place
cos its illegal
So is build tools if mojang actually wanted to do something about it lol
Just be a sigma male and use buildtools
why does my npc throw an npe as soon as i mount it on something :wtf:
You are creating a fake player/NPC that does not exist on the server. Your NPE happens when the server attempts to check the achievements for riding but the NPC is fake.
ive been following this tuturial ||s pigotmc.org/wiki/creating-a-blank-spigot-plugin-in-eclipse/?cf_chl_jschl_tk=pmd_1573ee2e8bb854b8072e9b1fbedd8f095ae91e1d-1629225386-0-gqNtZGzNAg2jcnBszQj6|| and i get a bunch of errors is it out of date or somthing
Description Resource Path Location Type
JavaPlugin cannot be resolved to a type Blank.java /SpigotBlankPlugin/src/com/atnipcontruction/com line 4 Java Problem
The method onDisable() of type Blank must override or implement a supertype method Blank.java /SpigotBlankPlugin/src/com/atnipcontruction/com line 12 Java Problem
The method onEnable() of type Blank must override or implement a supertype method Blank.java /SpigotBlankPlugin/src/com/atnipcontruction/com line 8 Java Problem
The package org is not accessible Blank.java /SpigotBlankPlugin/src/com/atnipcontruction/com line 2 Java Problem
package com.atnipcontruction.com;
import org.bukkit.plugin.java.JavaPlugin;
public class Blank extends JavaPlugin {
// Fired when plugin is first enabled
@Override
public void onEnable() {
}
// Fired when plugin is disabled
@Override
public void onDisable() {
}
}
``` code
You need to use the spigot api
i did i think
the class JavaPlugin cannot be found
i did but maybe it didnt work is there a way to add after the project is made
I'm not too familiar with eclipse, but if you right-click on your project, select "build path", click "configure build path", click "Libraries" and select "Add External JARs", then select your desired jar and click apply/ok
try something like that
Use maven
no you should be using a build tool like maven or gradle
Just use bukkit's Tutorial instead
It is more Feature complete than spigot's ones despite being almost a decade old
they should be but you can't just throw everyone into the deep end and go "here learn all these tools and know them inside out before you actually start doing anything with our library"
some people learn how to code alongside writing mc plugins (despite it being fundamentally wrong)
Sure, but using maven/gradle make switching to another IDE much more easier
(or PC)
JAR export finished with warnings. See details for additional information.
Exported with compile errors: SpigotBlankPlugin/src/com/atnipcontruction/com/Blank.java
Which will inevitably happen if he's using Eclipse now 
Gradle 😌
#FuckGradle
I hate Gradle so much lmao
everyone on forums and such says use eclipse so i decided to
Nerds
Maven 😌
dont

why cant we post pics here it would help so much
yes its very sinple
"hello Gradle I would like to depend on this project and you build it into the Jar for me so it's there at compile and runtime "
Gradle: "ok install this plugin and we can do that for you"
#fuckGradleTilILearnIt
lol inaccurate as hell but Ig dessie
still got 3 errors
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Idk... From my experience that's what Gradle is LOL
ant is easiest
conclure is something of a gradle fanboy
I mean I've not spent much time trying to learn Gradle, how would you go about doing what I explained then?
well first of all you probably don’t need any plugin
So if I want to use, for example, zip4j in my plugin, and build it with the jar. How would you do that without using shadow
is it supposed to be in mudule path or class path
oh well that’s a bit complicated but why would you not use shadowJar
public void test(void v, String s) {
}```Why doesn't it work?
It’s pretty much a standard at this point of time
<project name="MyApplication" default="dist" basedir=".">
<description>
simplest example build file
</description>
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="version" value="1.0" />
<target name="init">
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" />
</target>
</project>
what doesn’t
You are not correctly following teh tutorial
But that's what I mean, it makes you use an external plugin to do such a basic function of a BuildTool, or atleast what seems like would be a basic function.
It's kinda dumb LOL
i tried
Hmm not really
illegal type "void"
please tell me you didnt just put a fucking void as a paramter
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
