#help-development
1 messages · Page 1421 of 1
Will using CompletableFuture block the thread?
You could do that but its not easy. You would basically have to allow the server to start and disable your plugin til the response comes back,. Then start it
oh
Hello !
I'm wondering how I could do this without a deprecated method ...
I only have a player name (as a string), and this player can be online OR offline ! :/
well eh
anybody knows 😭
I really dont need to stop the plugin
Bukkit.getOfflinePlayers() then search through
so... can I atleast make it so it can check before the server starts
cuz rn it checks after the server starts
You can start your check as the server is starting, then finish it after
You can not halt the server to wait for your update check
how can I finish it before the server starts
you can;t
mhm
well, you can kind of
use teh pre login event to delay anyone connecting https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/AsyncPlayerPreLoginEvent.html
the server will start but no one can join till you allow them
I have no idea what ig is
I guess
does anyone know how i can solve this problem?
You can NOT stop the server to wait
Wait, this is going to be super poorly optimized, right?
I didn't understand what to do ...
Something like this ? :
Thats correct. It will only check known players to teh server. No lookups
Yeah and that's the problem I think ...
If the server is small it will be fine, but if it is a server with 100k different connections, it will check 100 000 players each time! :/
Im not trying to. Im trying to send a message that the plugin is setup after everything is complete
I'm going to give up my head idea, it's a shame ...
Wait, maybe I can use a header API?
🏆
what are you trying to do? if i get it right, just use the PluginLoadEvent
me?
yeah
Im trying to do check for updates and after everything is done
im trying to send a message that shows how long it took
but after everything is done
update-check-process
my bad
after everything in the ploogin
just start a runnable when starting the update-check
inside, do your update-stuff, and increment an int.
if it's done, you have the int in seconds, how long it took
nvm, don't do the update-check every second. only the increment
I already have the thing ready
it just does not wait for update stuff to be done
package whyhax.particlemanager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import java.text.DecimalFormat;
import java.util.logging.Logger;
public final class ParticleManager extends JavaPlugin {
DecimalFormat df = new DecimalFormat("0.00");
@Override
public void onEnable() {
Logger logger = this.getLogger();
long start = System.currentTimeMillis();
long fin = System.currentTimeMillis() - start;
new UpdateChecker(this, 91846).getVersion(version -> {
if (!this.getDescription().getVersion().equalsIgnoreCase(version)) {
logger.warning("There is a new update available. Please install it as soon as possible from the spigot page!");
}
});
}
}
ah you mean this
oh wait
i guess this is choco's checker?
by chocos checker you mean the first thing that comes on google when I search spigot update checker
Yes.
xd
long fin = System.currentTimeMillis() - start;```
and by used I mean heavily inspired
uh
well nvm
this is the one, i used for my plugin in past
wdym? the update check should take like a second if i'm right
well
well?
so you could at the end, output your message
that's what you want i think
why waiting... for what? good weather?
i mean
you only want to output a message after the update-check
WHAT IS EVERYTHING
EVERYTHING IN ONLOAD
then just put it at the end of onload
it should
it doesnt
except the update-checker takes like minutes
The one you linked uses a future
[20:54:48 INFO]: [ParticleManager] ParticleManager v1.1-TESTBUILD has been successfully enabled in 0.00 seconds (0ms)
[20:54:48 INFO]: CONSOLE: Reload complete.
[20:54:48 INFO]: Timings Reset
[20:54:48 INFO]: [ParticleManager] There is a new update available. Please install it as soon as possible from the spigot page!```
So it won't wait
more like a nano second
You can not guarantee the update check will be finished when your onLoad finishes. Its impossible to send any message at that specific time
isn't that enough for you? wtf.
just send that message in the onEnable, and you're good
what is the matter of a nanosecond
tf
what will happen in that second?
nvm
I DIDNT WANT TO ANSWER
:d
Ok so
from what I think.
It actually waits for it to finish but the message gets send too early
so imma just make it wait like a tick
or implement the message in the update-checker, so it sends it automatically
I'm going to write a plugin that looks for yours and makes sure its outputs a message between your server start and your update message.
haha
it's genius
no it's more 5head than genius
imagine then making a third plugin, to show when the second one loaded
5head = 1.25x brain height
very genius
no
SHUTUP
no
Sure go ahead
i wonder if that can be built into spigot
getLogger.warn
but it still sends a info
.warning will not send an INFO
logger.warning("There is a new update available. Please install it as soon as possible from the spigot page!");
send [20:54:48 INFO]: [ParticleManager] There is a new update available. Please install it as soon as possible from the spigot page!
impossible
Yeah prob I just changed it and forgot to updatre it in game
🙂
does a barrel's open/closed state persist upon restart?
hmm guess I'll have to try
ok and what's a signature (i think it has to do with the skins but i don’t really know)
idk
anyone else?
okay, so barrel's open state persists but after a restart it can be closed by opening and closing its inventory (before restarting, this does not change the open state)
so blocking the interaction should make it effectively persist forever
is https://api.spigotmc.org/legacy/ deprecated?
yeah theres no endpoint for that link, but you can do https://api.spigotmc.org/legacy/update.php?resource=<resourceID>
I just can't find any docs about the spigot web api...
the link I mentioned is easier than https://api.spigotmc.org/simple/0.1/index.php?action because I don't have to parse the json
https://prnt.sc/12l8ljn
What is causing this error?
I know where the error is, but what is causing it?
Read the stacktrace
clearly not
well its not
Java 15+ NPEs help
Before you say "but I'm on minecraft 1.8, modern versions of Java don't work on it" I have to say that you might want to use a proper minecraft version that at least does not prevent you from choosing more modern versions of java
This did not even cross my mind
what's on line 25, that might be a start
can you make a block invisible, while still retaining its properties (e.g. still can walk on it, interact with it, break it, etc.)?
Or some jank with barriers
sendBlockChange would be useful for that but it'd limit you to full blocks
anyone can help me to paste block by block in Fawe API
i already tried setBlock , rawSetBlock and smartSetBlock
none works
worldedit has their own discord but the api is a nightmare
Hello !
Does anyone can help me a bit please ? :x
I have a problem with the FileConfiguration#getIntegerList method :/
It returns a null list.
If i use the FileConfiguration#getList, it returns a list (non null) so ... 🤷♂️
Here is my yml file:
config.getIntegerList("decoration.whiteGlassPane.slots");https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/ConfigurationSection.html#getIntegerList(java.lang.String)
you showed getLIst not getIntegerList so I was wondering
line 37 slot should be slots
no, slot is right
in this loop, i try to check if there is a configurationsection "slots". if there's not, so i check for "slot"
Also you shoudl be checking for .isEmpty() not == null
ah, didn't know that sorry
if you are looking for a List you can check config.isList("path")
Mh, okay thank you 🤔
But that's not my real problem tbh ^^'
you can also check if a section exists by config.isSet("path")
Your issue is a few factors. line 36 you are checking for null on a method return that can not be null
use isList(path) instead. It returns a boolean
line 37 you can;t get an int from that list directly from the config. you have to pull the IntegerList first
oh thats is there is no list, ok
yes, as before use config.isList(path) to see if the list exists.
line 42, you are missing a period before slots
same in line 44
I just found it ...
I f*** hate me
And here is my problem
Thank you for your time @eternal oxide, you're such a good guy
np
I'm doing a pathfinder goal to go to a specific location, the white block represents the location in this example but the problem I'm having is that zombies comming from the diagonals are stopping on the block, but zombies comming from strait lines stop 1 block before. Any pathfinding goal experts know why? https://media.discordapp.net/attachments/581863115843567616/839984001271595008/unknown.png
Hey, how do I come back to main thread? I do some stuff async and I wanna do 1 thing not async. Is there an easy way?
just schedule a new bukkit runnable inside the async runnable
I am aware there is the scheduler stuff but I've stuck with BukkitRunnables and haven't run into any issues or limitations
Alright.
And is it possible to load a world in 1.8.8 async?
To not cause lag (WorldCreator#createWorld())
no
Hey! how do I get the tracker of a minecraft world
tracker?
yes i would like to change the players display name but in the code i found online they used a tracker
There is nothing called a tracker in Spigot
But to set a players display name https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setDisplayName(java.lang.String)
How does pitch and yaw work? Like does anyone have a useful way of knowing what values are where?
Note that this name will not be displayed in game, only in chat and places defined by plugins.
I want to change the name above the player 😄
Well you did ask how to set teh display name.
name Tags are a whole different kettle of fish
I found this tutorial. Might helphttps://www.spigotmc.org/threads/how-to-change-players-name-spigot-1-10-2.186778/
What version of Spiot?
1.10.2
Ill look into it Thanks!
Microsoft™️ Teams
so im trying to disable the usage of spawn eggs
any clever way to loop through all of them?
also is there any anti lag machine that works by limiting the number of entities in a chunk?
lag machines can be made with massive amounts of redstone and excesssive entity count
right?
like armor stands and boats
WELL
You'd probably want to look into dependency injection
When I first tried to throw the stuff I had from a previous tutorial into it's own class, I ran into an issue I just could not fix featuring this lovely statement:
NamespacedKey key = new NamespacedKey(this, "emerald_sword");
if (material.toString().endsWith("SPAWN_EGG"))
I assume "this" requires a JavaPlugin instance?
the this part specifically. I tried everything I could think of to link it to the JavaPlugin instance, but kept getting multiple instance error
could you send the error?
You can't have two JavaPlugin instances in one plugin
Right I figured that one out, but couldn't figure out how to refer to the JavaPlugin without getting the multiple instance error
thanks
Use DI, static singleton, or the method getPlugin
or smthing
like that where you pass the main class
i forgot the method name
Use dependency injection to inject your JavaPlugin instance into your secondary class:
Main class:
new SpecialClass(this);
Secondary class:
public void SecondaryClass(Main plugin) {
NamespacedKey key = new NamespacedKey(plugin, "emerald_sword");
}```
🥲
😭
best constructor euw xD
u imposter
"Why you shouldn't name your main plugin class Main"
I thought they said their main class's name was Main 
nah was just talking about the "main" class
:sadge:
but yes that is a basic implementation of dependency injection, I suggest reading into it more 
i come from a heavy javascript background so all of this multiple classes kinda stuff is new to me
they're both OOP languages so you've got yourself a good head start
Javascript and java are the same /s
god i hate javascript sometimes
most of the time*
And I'll tell you something else, I'm COMPLETELY at a loss with trying to implement this (for example) https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/Damageable.html
ik
I spent at least 2 hours on it
could not figure out interfaces
everything I did failed, or if it did work, it would only work OUTSIDE of the @override onEnable() event
but when placed inside of that event, it just errored. Gave me the biggest headache ever
why would you implement that interface o.O
i was just trying to mess around, learn stuff, that's all really
package index
Implementing interfaces. The Bukkit API is designed to only be implemented by server software. Unless a class/interface is obviously designed for extension (eg BukkitRunnable), or explicitly marked as such, it should not be implemented by plugins. Although this can sometimes work, it is not guaranteed to do so and resulting bugs will be disregarded.
InventoryHolder :>
lol
i always hated guis
with a burning passion
bro stop asking
and start learning
lmao
you are nowhere close
and yes you need to learn part 2
yep
i hate guis too, they're clunky but I do like them for selling items, like just dropping them into the gui and selling them 
if i have to configure my shit through a gui im dropping that plugin
no questions asked
also, I wish there was a way to define an Entity but be able to set the EntityType after it was made
In other words, for example
I like the custom texture GUIs on origin and mineclub and etca
Let's say you spawn an Entity an its an AreaEffectCloud (but the spawn method returns Entity). Maybe if you could set the type of the Entity to be something different and have Entity attributes carry over but idk
but it wouldn't be safe anyways
Well yes that. I remember that I had an issue or smthing
you can already kinda do that if you want to deep dive into reflection
I know it's possible via reflection, but in my case
not with a single entitiy but transferring over the attributes etc isn't too hard
that isn't ideal
there are two things that are evil in this world
one of them is reflection
the other is NMS
??
How is reflection evil
lol
I mean sure, avoid it when you can just use basic code
but like how is it evil?
you like seeing yourself in the mirror?
I mean, project jigsaw definitly agreed that reflection ain't it
Ah, yea the dang URLClassLoader#addURL
I feel your pain
spigot could just overwrite that method in the PluginClassLoader
and make it public
so you can "safely" access it using reflection
do you think we could persuade choco or md to do that?
i need to convert a block to an itemstack, how do i do this?
Like I really dont want to do jarinjar or use a classloader
@worldly ingot I'm sorry for the ping, but regarding about the URLClassLoader#addURL method that is being blocked in Java 16, do you think that Spigot plans on any changes about this so plugin developers can load dependencies dynamically? Some other strategies include like jarinjar or making a separate ClassLoader but it seems tedious.
"The thing is PluginClassLoader is not API, in fact the class itself is package private and can't be accessed without reflection...."
that was md_5's take on it last time
I mean, it has been like 1 and a half years, maybe we can notch a little
Yeah
Especially with like, current bstat values regarding used java version
this was back in the mainly java 8 days
Yeah
I managed to get it to work for 9-15 using module hacks
but they blocked that in 16
lmao
So yeah, concerning paper is forcing java 11 with the 1.17 release, this is gonna be an issue for anyone trying to achieve it
on the other hand tho, plugin class loader is its own entire mess
Yeah
use getType() on the Block
then create a new ItemStack based from the material
hm
@EventHandler
public void onBreak(BlockBreakEvent e) {
if (e.getBlock().getType().toString().endsWith("_PICAXE") && e.getBlock().getType() == Material.SPAWNER) {
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), e.getBlock());
}
}```
i cant put e.getBlock when i want to drop the item naturally
it needs an itemstack
new ItemStack(Block#getType());
He's talking about the metadata of the block
and that isnt always just Material I think?
this is block break event, meta data is thrown out the window I thought?
the interface implements the metadata interface thingy
and you're checking to see if the block type ends with PICAXE? 👀
no
oh wait
thats a byte of like the id
that's deprecated
i meant to check if the material the players uses to mine
so?
Would you guys be willing to take a look at both my classes and help me just figure out a template that I can follow? I tried doing the constructor injection but I got more initialization errors.
Maybe just show me how you would do it? I'm finding it hard to get examples on this specific topic and i would appreciate it
Would you guys be willing to take a look at both my classes and help me just figure out a template that I can follow? I tried doing the constructor injection but I got more initialization errors.
Maybe just show me how you would do it? I'm finding it hard to get examples on this specific topic and i would appreciate it
send codez
This is of course the first class. Trying to refer to this one from the second without getting the initialization error.
import org.bukkit.plugin.java.JavaPlugin;
public class TutorialPlugin extends JavaPlugin {
@Override
public void onEnable() {
etLogger().info("onEnable is called!");
}
@Override
public void onDisable() {
getLogger().info("onDisable is called!");
}
}
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
public class EmeraldSword {
public void EmeraldSword() {
// Our custom variable which we will be changing around.
ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
// The meta of the diamond sword where we can change the name, and properties of the item.
ItemMeta meta = item.getItemMeta();
// We will initialise the next variable after changing the properties of the sword
// This sets the name of the item.
// Instead of the § symbol, you can use ChatColor.<color>
assert meta != null;
meta.setDisplayName("§aEmerald Sword");
// Set the meta of the sword to the edited meta.
item.setItemMeta(meta);
// Add the custom enchantment to make the emerald sword special
// In this case, we're adding the permission that modifies the damage value on level 5
// Level 5 is represented by the second parameter. You can change this to anything compatible with a sword
item.addEnchantment(Enchantment.DAMAGE_ALL, 5);
// create a Namespaced Key for your recipe
NamespacedKey key = new NamespacedKey(this, "emerald_sword");
// Create our custom recipe variable
ShapedRecipe recipe = new ShapedRecipe(key, item);
recipe.shape(" E ", " E ", " S ");
// Set what the letters represent.
// E = Emerald, S = Stick
recipe.setIngredient('E', Material.EMERALD);
recipe.setIngredient('S', Material.STICK);
> // Finally, add the recipe to the bukkit recipes
Bukkit.addRecipe(recipe);
}
}
and the second one.
and the only error in this file is the "this" which I cannot figure out how to do the "DI" to link to the first file without getting init errors
You're still not doing it correctly, you need to pass the JavaPlugin instance through the Dependency Injection
yeah i removed that part because it wasn't working
just removed it so i could get ur guys example on how you do it
I'm getting this now, but at least im not getting the init anymore:
[19:03:50 INFO]: [TutorialPlugin] onEnable is called!
[19:03:50 ERROR]: Error occurred while enabling TutorialPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: null
at io.github.desura72.TutorialPlugin.onEnable(TutorialPlugin.java:10) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:493) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:407) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:555) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:257) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
simple NPE
How to set starter item when player successfully registered?
registered what
I think they mean authme
how can I set the generateStructures property of a world to false?
for existing worlds (not necessarily loaded)
I think I should do something like listening to an event or setting my own world creator, but I don't find it
Alright, so I've got this so far. Did I at least get this part of the DI down?
public class EmeraldSword {
private TutorialPlugin tutorialPlugin;
public void EmeraldSwordFunc() {
NamespacedKey key = new NamespacedKey(this.tutorialPlugin = new TutorialPlugin(), "emerald_sword");
}
(omitted everything here that doesn't have to do with me attempting to reference the main class without initializing it a second time lol)
I was actually told to do this instead:
NamespacedKey key = new NamespacedKey( new TutorialPlugin(), "emerald_sword");
With commands, I can do
/give @s cookie{Godlike:1b}
Later, I can detect for this specific cookie using
/gamemode creative @a[nbt={SelectedItem:{tag:{Godlike:1b}}}]
How can I do the same in spigot? How can I set the item to have a specific tag, then later detect if they have said item in a specific slot?
nope
Oh?
you will get a error about instantiating the plugin if you run it
Okay, so stick to ```java
NamespacedKey key = new NamespacedKey(this.tutorialPlugin = new TutorialPlugin(), "emerald_sword");
both are not good,as you call the new
Maaaan. How do I go about this then?
let me look up a good guide
so you can understand faster
well seems there arent any
not at all
that is incorrect
lol
yes that's the issue i'm running into lol
aaaaaaaaa
For one thing though, you should probably cache your namespaced keys
At the moment i just want it to work 🥲
public class EmeraldSword {
private final TutorialPlugin tutorialPlugin;
public EmeraldSword(TutorialPlugin plugin) {
this.tutorialPlugin = plugin;
}
}
``` this is di
now the IDE will say,you need a instance of tutorialplugin
so if you call new EmeraldSword() in the main,you give the class itself(this) new EmeraldSword(this);
For caching, I mean storing it in some static form
if you are using it many times
you shouldn't redefine it a lot
meh i would just throw them in the main
as for some reason every god damn class i make has a reference to main
wich i guess its predictable as i tend to go the managers route
and pass managers around
aaa i can't post pics in here
well,
public class EmeraldSword {
private final TutorialPlugin tutorialPlugin; //This gives me error: Variable 'tutorialPlugin' might not have been initialized
public void EmeraldSwordFunc(TutorialPlugin plugin) {
this.tutorialPlugin = plugin; //This gives me error: Cannot assign a value to final variable 'tutorialPlugin'
peep the comments
You place that in the constructor not a function
Didnt see that its a function when i copy pasted the code
remove the void
Should be gokd now
and it will turn into a constructor
constructors dont have any return types and you just dont specify at all
How can I add a specific piece of data to an item that a player is holding so I can detect if they hold the same item again?
What version?
1.16.5
Then PDC should be the go to
Pretty self explanatory, don't make the tutorialPlugin variable final
he's trying to use dependency injection
using a constructor
Yeah nvm I just noticed that
It's hard to read
Honestly I'd rather work with NBT and temporarily add a tag to said item, I do this pretty often with commands so I feel more comfortable.
Is it more complex?
Mutating the items NBT tag is a lot more complex than using the PDC in my opinion
PDC was kinda made to be able to store custom values in the NBT of items/entities/tile entities without having to use reflection and calling the internal server code
dang
PDC isn't that hard. Especially since you already know how to throw NamespacedKeys around
i just finished creating my first quest using my quest system, it's pretty neat and im using the method of making a separate class (with another new class per quest stage inside) for each quest so i can customize it with code to make every quest as unique as possible
😦
the code might look a little messy like this but it isn't yet 100% optimized, this way i can create stages with custom code, different paths in the quest and much more (where quest stage 100 would automatically trigger the quest to finish, and with 0 being the first stage)
sorry i'll put it in a paste
public class TutorialPlugin extends JavaPlugin {
EmeraldSword emeraldSword = new EmeraldSword(this);
@Override
public void onEnable() {
getLogger().info("onEnable is called!");
}```
Why does this work? I thought it wouldn't load in unless it was in the onEnable() or some sort of event to trigger it's load-in
im pretty happy with the result, even though i'll have to create a new class for every quest, it's the most customizeable option i can think of
You can't call a class outside of the onEnable method, the plugin would be null
or at least should be null
https://paste.md-5.net/qecujoledu.java paste instead of discord formatting
disco formatting is great 
but im being told to put it in a paste D:
yes im just saying it's nice
that's true, very easy and quick to use
but no don't use that, use this:
https://paste.lucyy.me/ecasikewos
Lucy's Pretty Pastebin

i'll try to next time ;)
alright so stuff outside of onEnable still gets ran on load? just clarifying
but for now i'll be expanding on the quest system, really loving the results. do you think my approach would result in too much code/classes eventually? i just dont think there is another reasonable way of doing it because quest files with settings wouldn't give me the ability to have every quest unique
Any instance level stuff in the main class will be run before onEnable
ItemStack[] list_of_equipment = {someentity.getEquipment().getItem(EquipmentSlot.HEAD),
someentity.getEquipment().getItem(EquipmentSlot.CHEST),
someentitiy.getEquipment().getItem(EquipmentSlot.LEGS),
someentity.getEquipment().getItem(EquipmentSlot.FEET)};
for (int x = 0; x <=4; ++x){
if (list_of_equipment[x] == null)//intellj says this will always be false, is that true?(sorry for the pun)
@eternal night Thanks, I'm starting to understand its usage.
It’s possible those methods are annotated nonnull
Which means they would probably return air
ok
hello people :)
but getItem returns an itemstack
itemstack can be air
so an itemstack of one air?
yep
but it shouldn't always be false
correct me if im wrong but you can just get armour contents
Yes
but I need to change the armor after I get if it is empty or not
does
list_of_equipment[x] = new Itemstack(armor)
just change the list pointer, or the actuall armor
check item type is air or not
@eternal night JUst to let you know, I perfected it, and I can even read the values in game, ur right this was pretty easy 🙂
I'm pretty happy that it lets me read the specified data by using /data get entity @s SelectedItem in game
should be just JavaPlugin#getDataFolder() and get its parent
plugin.getDataFolder().getParent()
does
list_of_equipment[x] = new Itemstack(armor)
just change the list pointer, or the actuall armor
if you're talking about the getArmorContents() or whatever it is, just the value in the array
it returns a copy. it's not reflected on the player
you have to setArmorContents() again
in a PlayerInteractEvent, is it possible to check if the block has a right-click function or if it's a standard block?
i.e. if it has an inventory, is a trapdoor/lever, etc
Material#isInteractable() or something like that. was added recently
oooo nice
yeah. 1.16.1 i think
works like a charm ty 🙂
That reminds me, ability to damage entity with specific cause when?
At least I don’t think there is a way to currently
why does BlockPistonEvent not have an abstract getBlocks method
this happens whenever i try to install buildtools```
$ java -jar -Xmx1024 BuildTools.jar --rev 1.8.8
Error occurred during initialization of VM
Too small initial heap
take off the xmx
BuildTools requires at least 512M of memory to run (1024M recommended), but has only detected 247M.
you should not need any additional switches unless you have some wierd ass java setup
$ java -Xmx1024M -jar BuildTools.jar --rev 1.8.8 -Xmx1024
Loading BuildTools version: git-BuildTools-36c11e9-126 (#126)
Java Version: Java 8
Current Path: C:\Users\Ahmed Waleed\Downloads\.
Exception in thread "main" joptsimple.UnrecognizedOptionException: X is not a recognized option
at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
at joptsimple.OptionParser.validateOptionCharacters(OptionParser.java:633)
at joptsimple.OptionParser.handleShortOptionCluster(OptionParser.java:528)
at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:523)
at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59)
at joptsimple.OptionParser.parse(OptionParser.java:396)
at org.spigotmc.builder.Builder.main(Builder.java:161)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
my brain cells
windows 10?
This can often occur if you are running a 32-bit system, or one with low RAM.
Please re-run BuildTools with manually specified memory, e.g: java -Xmx1024M -jar BuildTools.jar --rev 1.8.8 -Xmx1024
thats why i put 2
try using Xms instead of Xmx
$ java -Xms1024M -jar BuildTools.jar --rev 1.8.8 -Xms1024
Loading BuildTools version: git-BuildTools-36c11e9-126 (#126)
Java Version: Java 8
Current Path: C:\Users\Ahmed Waleed\Downloads\.
Exception in thread "main" joptsimple.UnrecognizedOptionException: X is not a recognized option
at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
at joptsimple.OptionParser.validateOptionCharacters(OptionParser.java:633)
at joptsimple.OptionParser.handleShortOptionCluster(OptionParser.java:528)
at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:523)
at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59)
at joptsimple.OptionParser.parse(OptionParser.java:396)
at org.spigotmc.builder.Builder.main(Builder.java:161)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27```
bruh
take off the extra switch and run in cmd prompt not bash
Don't put any JVM arguments after -jar
Also, the spigot wiki says to not use heap arguments if youre on windows
On Linux run git config --global --unset core.autocrlf, then run java -jar BuildTools.jar in bash or another appropriate shell.
On Windows run the below command inside the git bash window that opened:
java -jar BuildTools.jar
Please be aware that it is required that you have BuildTools #35 or later, older versions will not work.
On Mac run the below commands,
export MAVEN_OPTS="-Xmx2G"
java -Xmx2G -jar BuildTools.jar
Options (all OS's) :
The --rev option can be used to get specific 1.8/1.9 versions of CraftBukkit / Spigot
See Versions below for available options
C:\Users\Ahmed Waleed\Downloads>java -jar BuildTools.jar
BuildTools requires at least 512M of memory to run (1024M recommended), but has only detected 247M.
This can often occur if you are running a 32-bit system, or one with low RAM.
Please re-run BuildTools with manually specified memory, e.g: java -Xmx1024M -jar BuildTools.jar```
WAIT
try the command exactly was it says, in cmd prompt. Bash can be iffy.
"java -Xmx1024M -jar BuildTools.jar" worked
LETS GOO
Thanks @eternal oxide & @wicked remnant
np
Hey, I made a shovel and gave it this enchantment:
item.addEnchantment(Enchantment.DIG_SPEED, 3);
the enchantment is on the item, it works for the most part -- except for on GRASS blocks?
The shovel digs super fast with dirt, sand, etc...but with grass blocks it just digs at the normal speed that a shovel with no enchantment would dig at. is this normal?
thats a minecraft related thing not spigot
just means that's regular miencraft behaviour
Hello! Any way to run own java program or lib the same time of running server software?
Can we add some lib to spigot.jar?
I just want to add my own lib run the same time with server
So, plugins can access to it any time as it access to spigot lib.
what about just wrapping the lib in a plugin?
then you can make your plugins that require it depend on it
Because it a little bit un-reliable. If another plugin run before lib, then it doesn't work
Can I combine that into spigot.jar? Like spigot combine some of google lib to.
I mean
Technically, if you modify the jar itself with buildtools
But that doesn’t seem worth the effort
Would probably be better to modify spigot to let you force your lib plugin to load first...
If do like this, then I do not need to force anything, just run the server, lib is loaded at the same time as the server run
So, can I do that? Please check the picture in link
hey this is my first time using java, what am i doing wrong here?
oh i cant send images
ill just send the code
public void onEnable() {
getServer().getPluginManager().registerEvents(new EventListener(this), this);
}
the error eclipse shows is The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (EventListener, Main)
https://hatebin.com/cnisfpgygm works for me
Ahh
main has to extend javaplugin
it does
package core;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public static Main instance;
public void onEnable() {
getServer().getPluginManager().registerEvents(new EventListener(this), this);
}
public static Main getInstance() {
return instance;
}
}
Any respond mine?
and EventListener must implements Listener
it does too
You cannot edit the jar in an ide
package core;
import org.bukkit.event.Listener;
public class EventListener implements Listener {
Main main;
public EventListener(Main main) {
this.main = main;
}
}
I do not edit
You have to download and modify the source, then compile it into a jar
are your args in the right order?
Or
You could just add depend: [YouLibPlugin] to any plugin that requires it
Or you can shade the lib with maven/gradle
There is no reason to modify the spigot jar to add a library
But, can still I modify it(and as legally)? I have tried, it makes much cool.
the legality of the minecraft ecosystem is F'd
i forgot to save my listener file lmao
Ohh thanks, but other person I have asked to, they say it's bad practice, it's dumb, and they warn me don't do that. Idk why so, even I do not edit any thing in original jar, but just add some lib to. The way it goes is look like While compiling my lib, it extract server.jar, then complier in result together.
It looks the same as spigot compile some of google lib in its jar
any difference between doing function() and this.function()?
Generally, no
ty
Because it’s excessive, slow, and unneeded
And obviously won’t work for a public plugin
Orr yes🤔
I mean sure you can offer a custom jar for your plugin
But no one will want to download it
Yes! It's just for my server.
And you’ll need to provide it in an uncompiled state to comply with minecraft copyright
Ohh, what's that mean?
It means you can’t share any of the minecraft source directly
There is a reason spigot uses buildtools
Ohh🤔
Just run your lib as a plugin or shade it into the plugins that use it, there is no reason to overcomplicate this
So, what happen different when spigot uses buildtools and not?
But why paper fork top of spigot and can not-necessary to use buildtool?
is it possible to assign a class to a static property as a default value?
ik its not possible in php
Paper has their own version called paperclip
It just compiles the jar at runtime
Ahh...
And why doesn't spigot have its own version and run bukkit at runtime too?
Because Spigot came first
Hmm..., it looks complicated vs just see from out side.
spigot makes you run buildtools to get the patched jar
paper downloads the vanilla jar, makes the patches and then launches the patched jar
is there a way of fetching a Player object from someones username?
How did you get the players name in the first place?
through an argument
Bukkit.getPlayer()
ok thanks
how does hypixel handle fireballs and the smooth overall experience they provide? i mean they do enough damage, they destroy specific blocks and cause them to ignite, and finally the provide somehow the ability to fireball jump. I’ve tried adding fireballs to my server with the player launching the by right clicking and listened on projectilehit to create the explosion but the result wasn’t EVEN CLOSE
any ideas?
I'm planning to add multi language support into my plugin, What would be the best option to do this ? I would use the YamlConfiguration
maybe an online dictionary api would be better
setting the velocity depending on the range
so a fireball would go faster if it were to attack a player 50 blocks away compared to another 10 blocks away right?
No
maven is nice, you are lying
?ask
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.
I get a java.lang.ClassNotFoundException: com.mongodb.client.MongoClients
When running my plugin
Did you shade?
Not sure what that is, this is my first Maven plugin
@patent ice Unnecessary, but thanks!
Don't ask to ask. Just ask
What about asking to ask about asking
Then you might want to copy something like https://github.com/Geolykt/EnchantmentsPlus/blob/3xx/pom.xml#L180-L200
Why do you keep saying that, I didn't ask to ask. I asked if anyone uses Maven
can I ask to ask somethning about how to ask something properly
Can I ask how to ask about asking to ask
@quiet ice Just putting the plugin in should compile my project correctly?
And you could how just told us the problem instead of asking that
Ok?
Yes!
Thanks geol for the help. Appreciate it, unlike the other 2 comedians here
Cool.
@quiet ice You're a life saver. I've been stuck on this for hours!!
while what they did was unnecessary, it's better to leave questions in the chat so people don't have to wait for your question
and yes, it was unnecessary to keep putting that ?ask bs
will do next time :)
Oof
...
just
shut
leave him alone
lol
not everyone is know it all like you
some people are still learning
some people are new to the community
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.
legit my first message ever in this server was me asking a question without asking to ask lol
ignore people like them 🤷🏾♂️
and i literally just got a bunch of "comedians" like these 2 giving me meaningless shit
Why are we discussing about the rights of asking to ask, this is meant for development
I really cant care but just read it for once
no
Very educational
i obv did lol
y'all are just acting like dicks at this point
what you guys are doing isn't rude?
Anyways peace
✌️
✌️
Well I'm not saying that, just using the d word isn't very nice.
deez nuts
Hello, spigot how can I deal mob not true damage
((Damageable)entity).damage(int); deals true dmg 😦
well LivingEntity has attack
what's that
(ignores armor)
try LivingEntity#attack
okay 🙂
still true dmg 😦
look for nms methods then i guess
its not nms btw, I used LivingEntity#damage . cuz LivingEntity#attack doesn't exists
Its my code((LivingEntity) entity).damage(5);
LivingEntity#attack definitely does exist
declaration: package: org.bukkit.entity, interface: LivingEntity
waittt
1.15.2 has attack in javadoc
But i can't find in my intelliJ
((LivingEntity) entity).attack(1); it says "not exists"
because it doesnt take an integer
nop
attack is from one entity to another
yaa
again, it needs an entity to attack
you would do something like player.attack(entity)
without a living entity as the source i don't know if you'll be able to deal armor-affected damage without nms.
let me see
wdym?
look at EntityLiving
((EntityLiving) entity).attack() it says
cannot resolve symbal "attack"
It means, attack method deosn't exists
that's because nms is obfuscated
again, you need to look for the method to damage an entity in the minecraft code
yaaaaaaaaaaaaa
I think you understood wrong
wait
It says the method itself doesn't exist.
yeah not in EntityLiving
try EntityLiving#damageEntity
ya idk
damagesource is a class
yapppp
public static final DamageSource FIRE = (new DamageSource("inFire")).setIgnoreArmor().setFire();
public static final DamageSource LIGHTNING = new DamageSource("lightningBolt");
public static final DamageSource BURN = (new DamageSource("onFire")).setIgnoreArmor().setFire();
public static final DamageSource LAVA = (new DamageSource("lava")).setFire();
public static final DamageSource HOT_FLOOR = (new DamageSource("hotFloor")).setFire();
public static final DamageSource STUCK = (new DamageSource("inWall")).setIgnoreArmor();
public static final DamageSource CRAMMING = (new DamageSource("cramming")).setIgnoreArmor();
public static final DamageSource DROWN = (new DamageSource("drown")).setIgnoreArmor();
public static final DamageSource STARVE = (new DamageSource("starve")).setIgnoreArmor().setStarvation();
public static final DamageSource CACTUS = new DamageSource("cactus");
public static final DamageSource FALL = (new DamageSource("fall")).setIgnoreArmor();
public static final DamageSource FLY_INTO_WALL = (new DamageSource("flyIntoWall")).setIgnoreArmor();
public static final DamageSource OUT_OF_WORLD = (new DamageSource("outOfWorld")).setIgnoreArmor().setIgnoresInvulnerability();
public static final DamageSource GENERIC = (new DamageSource("generic")).setIgnoreArmor();
public static final DamageSource MAGIC = (new DamageSource("magic")).setIgnoreArmor().setMagic();
public static final DamageSource WITHER = (new DamageSource("wither")).setIgnoreArmor();
public static final DamageSource ANVIL = new DamageSource("anvil");
public static final DamageSource FALLING_BLOCK = new DamageSource("fallingBlock");
public static final DamageSource DRAGON_BREATH = (new DamageSource("dragonBreath")).setIgnoreArmor();
public static final DamageSource DRYOUT = new DamageSource("dryout");
public static final DamageSource SWEET_BERRY_BUSH = new DamageSource("sweetBerryBush");```
public static DamageSource a() {
return new DamageSourceNetherBed();
}```
ahhh lol, only damageSourceNetherBad ofused
you do realise that you can decompile yourself
yaa and I already known
no i cant decompile myself, im not a program!
Thanks i'm trying
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer cannot be cast to class net.minecraft.server.v1_15_R1.EntityLiving (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer and net.minecraft.server.v1_15_R1.EntityLiving are in unnamed module of loader 'app')
uh It says
CraftPlayer cannot cast to EntityLiving
Full Error:
[17:05:59 WARN]: [Plugin] Task #597174 for Plugin v1.0 generated an exception
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer cannot be cast to class net.minecraft.server.v1_15_R1.EntityLiving (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer and net.minecraft.server.v1_15_R1.EntityLiving are in unnamed module of loader 'app')
at me.toto.rpgCore.mob.hardCore.SmarletListener$4.run(SmarletListener.java:174) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.15.2.jar:git-Paper-391]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.15.2.jar:git-Paper-391]
at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1265) ~[patched_1.15.2.jar:git-Paper-391]
at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:431) ~[patched_1.15.2.jar:git-Paper-391]
at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1182) ~[patched_1.15.2.jar:git-Paper-391]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:971) ~[patched_1.15.2.jar:git-Paper-391]
at java.lang.Thread.run(Thread.java:834) [?:?]```
okay 😉
Im trying to make a plugin which has ProtoclLib as a soft-dependancy I dont want the features that come with ProtocolLib to be enabled if ProtocolLib doesnt eixst I added a check for that but when I try to run my plugin on a server withyout protocollib it sends this error https://paste.md-5.net/cepozunuvu.sql
any clues?
I call this method on load so
well... how is protocolManager already initialized?
protocollib classes are not found
you do stuff with the protocolManager outside of this check
oh
so I would need to move this to the check?
private ProtocolManager protocolManager;
and fthis
protocolManager = ProtocolLibrary.getProtocolManager();
don't really need to define it as private but yeah and it may make accessing it elsewhere difficult
I dont need protocollib its jsut for 1 feature
it still not work 😦
thats why I dont want it to be a dependancy
((EntityLiving) ((CraftPlayer) entity).getHandle()).damageEntity(DamageSource.GENERIC, 5F);
if you're making it a soft depend I'd give it its own class that you either instantiate or don't based on whether it's enabled
that damages the player, toto
Its 5F
don't need to cast it to entityliving either
hmm
what doesn't work
so, I want damage to Player (Entity -> Player)
any errors?
nop
so do I do this
((EntityLiving) ((CraftPlayer) entity).getHandle()).damageEntity(DamageSource.GENERIC, 5F); It deals true dmg
2.5<3
not for one feature, whyhax
maybe its cuz of the imports?
- I want damage to Player (Entity -> Player)
- It deals true dmg (I want armor affact dmg)
see how in the list up there GENERIC is set to ignore armor
what list? 😄
for one feature, you can do everything inside of the check
you meant javadoc?
the imports?
No the imports don't matter
Just where you use them
so yeah, toto choose a damage source that doesn't ignore armor
so maybe I should try to register the variables on the method
you don't need any variable really
fields*
so
uh
private void protocolLibCheck() {
Plugin pl = Bukkit.getPluginManager().getPlugin("ProtocolLib");
if (pl == null || !pl.isEnabled()) return;
ProtocolManager protocolManager;
protocolManager = ProtocolLibrary.getProtocolManager();
protocolManager.addPacketListener(new PacketAdapter(this, ListenerPriority.HIGHEST, PacketType.Play.Server.WORLD_PARTICLES) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) return;
if (getCustomConfig().getBoolean("status") && getCustomConfig().getBoolean("disable-damage-indicator")) event.setCancelled(true);
}
});
logger.info("ProtocolLib was found and its features are enabled!");
}```
I removed the ProtocolManager protocolManager;
protocolManager = ProtocolLibrary.getProtocolManager(); from on load
and added it in the check
just do ProtocolLibrary.getManager().addPacketListener(...
no need for the variable initialization and declaration
anywhere else on the code are you using PL
it doesnt give errors
also, it doesn't give dmg 😦
also its not spigot
Is there a way to get true speed? Not the half velocity half acceleration .getVelocity?
What can cause this? [INFO] ------------------------------------------------------------- [ERROR] /C:/Users/Dennis Gyftakis/iCloudDrive/JavaProjects/SkinChanger/src/main/java/net/unpluggedmc/skinchanger/Listeners/JoinListener.java:[7,61] cannot access net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.PlayerInfoData bad class file: C:\Users\Dennis Gyftakis\.m2\repository\org\spigotmc\spigot\1.16.5-R0.1-SNAPSHOT\spigot-1.16.5-R0.1-SNAPSHOT.jar(net/minecraft/server/v1_16_R3/PacketPlayOutPlayerInfo$PlayerInfoData.class) bad RuntimeInvisibleParameterAnnotations attribute: PlayerInfoData(com.mojang.authlib.GameProfile,int,net.minecraft.server.v1_16_R3.EnumGamemode,net.minecraft.server.v1_16_R3.IChatBaseComponent) Please remove or make sure it appears in the correct subdirectory of the classpath. [INFO] 1 error [INFO] -------------------------------------------------------------
https://paste.md-5.net/fuxatuceqo.cs this method gives https://paste.md-5.net/qapudezami.sql this error eventho the whole point of the method is to register the packetlistener if protocollib exists. I probably did smth stupid
Hallo here! How can I deal no true dmg(Armor affact) to player? (Entity -> Player) I've tried a few ways, but I've failed.
what do you mean by no true damage? do you want the player to get attacked without dealing damage?
yes
but armor affact
default dmg (armor affacted), true damage(no armor affected)
I want default dmg
oh ok so you want them to wear armor but not have their damage getting decreased right?
nop, that's true dmg
I want -> for example, if i wear diamond set, I miss 1 heart. but if i not wear armors, i miss 5 heart -> Default damage ( I want)
and I dont want -> for example, if i wear diamond set, I miss 5 heart. but if i not wear armors, i miss 5 heart -> True damage ( I dont want)
then you want to customize this numbers...
listen to the PlayerDamageEvent and customize the damaged the player deals depending on his armor contents that you can access using Player#getArmorContents()
wait let me check some docs..
.
alright so to sum up what you can do is make a listener for the EntityDamageByEntityEvent and then check the damager using event.getDamager() and if the damager is a mob you can cancel the event if it's not you can do event.setDamage(DAMAGE_AMOUNT) and also listen to EntityDamageEvent for things like fall damage and stuff and again depending on their armor contents (event.getEntity.getArmorContents) set the damage using event.setDamage(DAMAGE_AMOUNT)
idk i haven't used protocolLib for a while
you're smart enough to figure it out : D
1 is good enough i have 0
Can we use ExactChoice to shapelessRecipe ? because it don't work for me all custom item are the same for the shapelessRecipe. But all my ShapedRecipe Works fine with exact choice
i'm not sure check the docs
i already check the doc but it don't work
for some reason it has no info about that method and the doc of RecipeChoice says no more so maybe someone else who has experienced something like that
Thanks you, and sorry. but i think you didn't understood well. I want to damage the player without an event. For example, I want to do damage just by doing [/test] command.And the general damage I'm talking about, it's just the general damage. It is influenced by armor. But True Damage receives the same damage without the impact of armor.
same thing just check his armor contents and deal different damage levels
This will be a very cumbersome task. Is there any other way? 😉
even then, I have many custom armors
.
then i don't know maybe spawn an invis mob that damaging them
...
good idea
Is it possible to generate a file at compile? I want to auto generate plugin.yml
automatically?
Yes
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/plugin-annotations/browse/src/main/java/org/bukkit/plugin/java/annotation/PluginAnnotationProcessor.java I don't understand the AbstractProcessor
when you compile the jar it gets auto generated isn't it?
Yes exactly
then what's ur problem?
I mean, generate it without creating the file
If you click on compile it will add a new file
Ok thanks
Does anyone know how EntityDismountEvent works?
There is no method description in the java doc
I'm talking about getEntity() and getDismounted()
getEntity is the player and getDismounted is the boat if i'm not mistaken
Hmm there should be a description, but that’s self explanatory
so is the getDismounted() the entity?
As the name suggests it is the entity being dismounted
Okay thanks
Someone sort out an argument i'm having with someone
is it necessary to make plugins configurable for a network that has multiple devs
always available
I work on a network with over a lot of people and I never make my plugins configurable.
Keep yourself in work
lmao
My argument is that configuration is only necessary when the plugin is first installed and is basically not necessary once it is correctly set up
Some things like database info should always be configurable
and thus is a waste of time to implement
yes db stuff, but they want inventories, messages etc etc
Gameplay params etc would ideally be configured but often they aren’t
I just don't see the necessity when I can change it in 5 mins
I usually just have database info in my config nothing else.
yeah, that's currently how i have it setup. Db info and that's it
You might not be around forever or always available or maybe they want to experiment
Or maybe they want to pay you now not later
That's true, but for a network with 3 other devs pretty much on around the clock
Ultimately it’s what they want
How can I activate smth if another plugin is enabled but not prevent the plugin from starting
Im trying to make it so packetlisteners only get activated if protocolib is enabledf
???
no like just dont try to use that packetlistener if the plugin isnt enabled
so it does noit give a erorr
If getPlugin(protocollib) != null new PacketListener
I tried this
.
tried that
it gives a error
and doesnt start the plugin if protocolib isnt there