#help-archived
1 messages · Page 28 of 1
It's soooo stupid
yeah
no obfuscating
like com.masterwolfx.main
i want to see matrix code 😔
Use your domain or email address @tropic swallow
all other classes can be obfuscated?
Don't use a domain you don't own in your package
it was just an example, im not using it
wdym what happened
I've always been told an email address works. Am i wrong?
i should not obfuscate?
its not enforced at all lmao
so?
Yeah an email is fine
low effort doenst necessarily mean good plugin
Or com.github.username
dont obfuscate
obfuscation really doesn't stop anybody who really what's to release a copy of your plugin
someone messed up a /fly command 😔
honestly, you're just inducing more stuff for yourself to deal with, nor are you really preventing much
i just wanted to prevent some people from modify the code
You can't stop ppl from modifying your code
why would you want to prevent someone modifying code
Minecraft is obfuscated and we still all here
which would make it better for them
i can stop a small part of who wants to modify it
But why?
modifying code isnt a bad thing
redistributing it is, and that isnt solved via obfuscation
what is your plugin
the thrilling conclusion
out of curiosity
its about item upgrades
high tech stuff, better register a patent
i made a remake of an old plugin i found on the internet, HeavenStones
how about seacrching on google
try bing
if your faction plugin doesnt have an f top command
use a different faction plugin lmao
bs theres 100s
spigot should just force all plugins in the resource section to be open source
better for everyone
no
@wanton delta true LOL
guys can i use essentials Eco in the jobs plugin? like when i use essentials money i can buy in jobs shop
there are many jobs plugins, what jobs plugin is this?
Jobs4.15.7.jar
im surprised that massive doesnt have f top
Here's my advice on a factions server - Don't make one
YEA LMAO
there are too many
was about to say
players wont have any reason to join yours
@frail charm It probably involves using Vault.
anything "unique" has been done before.
Check the description of the Jobs plugin and see if it requires Vault.
it does require vault and i have vault plugin installed
There's probably some config options to setup economy stuff for the jobs plugin.
@pale plaza Please stop...
@pale plaza check out what I said before
guys im getting a NoClassDefFOundError for kotlin stuff
ive included the kotlin-plugin
but its still being thrown
When are you getting the error? @lofty otter
when I run a command
java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: Could not initialize class jetbrains.exodus.env.EnvironmentConfig
and i get the same error on sponge if i dont include the kotlin lib
works fine if its there
but somehow its not getting the kotlin dep from the other jar
on spigot
I could be completely wrong on this, but don't you need the kotlin stuff shaded? It's not gonna be on the server unless it is, right?
Hmmm.
not in my jar though
you need to load after that plugin
Yeah just make sure it's a depend.
ive added a softdepend on it
is softdepend enough?
how safe is to pass string as key in a hashmap? 🤔
i dont always need kotlin
only when they want to use a specific database type
so thats why its soft
I would change it to a depend for now and see if the plugin still loads correctly.
try with depend just in case 🤷♂️
@pale plaza I said that making a factions server is a waste of time
If your plugin doesn't work after you change it to depend, then it's an issue with the kotlin plugin.
Hmmm. Maybe the kotlin version your plugin is using is newer than this one?
nope
on sponge I use spotlin to shade kotlin
and it shades 1.3.40
and the spigot one shades 1.3.41
Honestly it goes the same for KitPVP, Skyblock and all that
im pretty sure this kotlin plugin is busted
It could be. Maybe just shade it yourself and see if it works after that?
are you relocating?
no
just shading
now im getting
No signature of method: build_45avc9trbo033d6wg4ng987m4.shadowJar() is applicable for argument types: (build_45avc9trbo033d6wg4ng987m4$_run_closure3) values: [build_45avc9trbo033d6wg4ng987m4$_run_closure3@9a89917]
👀
You should be able to just make it a compile dependency.
error was because of a typo
i shaded it now
but jar only went up by 10 kb
which is sketch af
minimizeJar?
well it was 15 kb
but how are you going to fit all of kotlin in 15 kb
ah i know why
im looking in the jar
while all the kotlin packages are there, the classes are not
im shading just the jdk8 kotlin stdlib
do i need to shade the normal one too...
yes that seems to have done it
so, i've been storing data in a block's persistent data
and
java.io.UTFDataFormatException: encoded string too long: 83646 bytes i've encountered this problem
😅
for those that cared (probably no one 🙁 ) i figured out LibsDisguises is what was cancelling my entity euipment events
i guess it was updated to handle equipment on its own :p
Is there a crate plugin that let me set any block as a crate instead of a chest?
Bungeecord textcomponents, why does the text go white if the text overflows onto another line?
I remember having this issue as well, don't remember how I solved it though
dont use colour codes
are you using legacy text?
Trying to do it config based :/
if so, make sure to properly convert using TextComponent.fromLegacyText
is there an event for when players switch an item from mainhand to offhand?
wait @silk gate where do i know you from
OH
wait
nvm i realise now, you're ryan xD
nvm found it
lmao
hmm
tickets
haha
DOes anyone know a scoreboard plugin that shows your kills deaths money KDR and killstreak and your name doesnt matter if premium or whatever and I want it to be able to enable it in certain worlds if u do know dm me or @ me
Question: Is it possible to get a resource's (plugin's) data, such as version etc. in the form of JSON? What I want to do is display the current plugin version on my website.
Yeah you can easily do that
Do you want it to be all plugins on your server or just a specific plugin?
@velvet halo I want to get information of my own plugin from Spigot's website
Oh I thought you meant getting information from an online server. I don't have website experience but I am sure you can.
I think I saw something on your question a while ago
Also I cannot get the system to verify me 😂 where am I supposed to receive that message
For #verification
It'll be in your spigotforum pms.
The verification message gets sent to your spigotmc forums account
It wasn't working like a week ago lol, just worked tho
@frigid ember I found this btw https://spiget.org/ 🙂
wow what did you search i have been searching for hours xD
Thanks you are awesome 👌
I remember coming across it a while ago and the name just suddenly came into my mind xD
no problem
cool lol
will World#getEntitiesByClass(LivingEntity.class) get all living entities, or do i need to pass in a specific entity interface?
uuuhm
just
World#getLivingEntities?
😄
but yes, it would call LivingEntitiy.class.isAssignableFrom(Zombie.class)
ok so my priorities for bungeecord are
priorities:
- Server1
- Server2
however if server1 is down, I can't connect at all, even if server2 is up
i doubt any world based getentities is worth it
also i assume it only gets loaded entities
ok another question
does the server reuse entity ids?
it only gets "valid" entities
so not dead and loaded and stuff
public boolean isValid() {
return entity.isAlive() && entity.valid && entity.isChunkLoaded();
}
cool
and no, I dont find ids are reused
iirc the server just counts up
this.id = Entity.entityCount.incrementAndGet();
yep
its never getting reset either if IJ doesnt fool me
cool
why is com.google.common.collect.EvictingQueue beta tho
what could possibly go wrong
onEnable "this.getCommand("pricamc reload").setExecutor(this);" is it correct? When I have onCommand in main class
No need to. It defaults to your plugin
You should only have to set the executor if it's in another class
However, you can't just get a command with its arguments. You have to check the arguments in the onCommand() method (as is the reason String[] args exists)
so it registers automatically when i have onCommand in main class?
All commands created by your plugin are executed through your main class unless otherwise specified, yes
ok thanks
But this, this.getCommand("pricamc reload"), is invalid
yeah, you told already, i'll use args

i have a problem with an ArrayStoreException. i have 2 classes called Tracker and TrackerDisabled that are both subclasses of TrackerBase, but a TrackerBase array is only letting me add Tracker. can anyone explain why this is?
Arrays are fixed, they cannot add or remove objects
@wanton delta that's not what he's asking
oh my bad
@minor spruce Can you show your class definitions?
What's the compiler error?
i mustve misunderstood :L
if i use the scheduler to schedule a synchronous task, is there a difference between specifying a 1 tick delay and not specifying a delay?
https://pastebin.com/raw/hGWj3JjT why in console it says unknown command?
@silk bane AFAIK, no delay is on the next tick and 1 tick delay is one tick after the next tick.
cool
this is gonna sound like a stupid question but whats the class definition
@minor spruce public abstract class TrackerBase etc etc.
oh right, yea thats what the TrackerBase one looks like
then Tracker and TrackerDisabled both extend TrackerBase
What is the compiler error?
theres no compiler error it only happens when the plugin is running on the server
Can you give the stacktrace?
@idle tulip Did you add the command to the plugin.yml?
hm, i don't have plugin.yml, i have to lookup how to add that to intellij with maven
@idle tulip If you don't have a plugin.yml, then your plugin isn't loading.
oh wait, i do have... let me look up what i need to add there
@idle tulip https://www.spigotmc.org/wiki/plugin-yml/
@minor spruce show the lines of code leading up to the error
@minor spruce Can you show us the code that it throws the error on?
The method at PlayerLoader line 57
anyone know how to fix this? Plugin has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I have
Evidently not
Output of java -version?
from where
A terminal
@pure belfry the server's java version is outdated. do you have a host or are you running it on your computer?
running it on my computer
Open up a terminal and do java -version
I guess you're right it says java 1.8
yea im stupid, accidentally made a Tracker array instead of a TrackerBase array, thanks for the help
What reason to use arrays over a list
hello all, im looking for a partner to make a management and marketing firm together. if you want to do it then dm me.
😂 😂
Hm weird, I added command to plugin.yml and in console it knows command, but it won't execute that reloadConfig() etc
Management and marketing firm
@dusty topaz If you know the size at compile time, and you fill all of it, you should use an array.
I'm lazy
@frigid ember wrong chat
yes, @dusty topaz
Arrays are faster than lists
Say I have a list of materials that I want I do Sets.newHashSet(stuff)
this is the right chat @radiant pollen
Well, a set is very different to an array
is java 8 not the latest version of java?
It's not ordered for starters
it is the help one
Iteration is also slower
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
The latest version of java is 14, lol
do I get it from the java site or oracle
15 comes out in October
But #contains is O(1) right?
am I allowed to post links?
For sets
anyone knows if intobjecthashmap is better than an hashmap in terms of time complexity 🤔
It really depends on what you want to do, choosing the right data types ismone of the most important thing
Yeah so I just use sets if I need to check contents
I never find myself using arrays tbh
Probably bad
Fastutil stuff saves you from auto boxing
Time complexity is the same
Actual runtime can be much faster
Fastutil?
It's a collection lib that offers primitive collection types
https://pastebin.com/raw/hGWj3JjT is this correct? i have command added in plugin.yml and it recognizes command (doesn't say unknown command), but it won't execute that onCommand in main class
So IntObjectHashMap<String> over hashmap<Integer, String>
Huh
Since java doesn't have primitive generics
Yet anyways
Long life project Valhalla
Possible to have int value?
i read somewhere that intobjecthashmap goes into O(n) at remove 🤔
also any difference between intobjecthashmap and trove's one?
how significant is the performance difference?
there's like a million different implementations of it as well
I wouldnt imagine crazily
it's so hard lol
Unless you're storing thousands
Well, all hashmaps can degrade
degrade?
If you get to much collisions, operations on hash maps can all go to 0n
make the hash table bigger
ohhh right
but it's probabily safe for most 🤔
does the jdk kit not come with java?
What is meant by collisions
2 objects with same hash
Hashcode?
their equals differs yet the hashcode is the same
Ah
but for strings tho
they are their hash
Ppl should learn more about datatypes
i'm scared to touch strings
just practice
(university)
University 😂
Practice doesn't help you hear
Here
You need to know the details of the major collections and datatypes
There is ton of literature out there for that I guess
Any youd recommend?
Just implementing the simple data types by hand gives you great insight
Not really, I learned this stuff at uni
I had a whole semester just about data types
And another semester a course just about algos
Uni is a couple years off for me unfortunately
so can you rough categorize them? 🤔
guess it depends on exactly what's on your course
a level comp sci isn't the most comprehensive
jeeeez
fun life i know
sounds great, best of luck
haha cheers
I actually learned a ton of algo and datatypes stuff at school
Say I have a foreach of list x and in the foreach i add to list x, will the item i added be iterated over?
Sorting algos and different list and stack etc
yes @fleet burrow
i think
@fleet burrow you'll actually get a concurrentmod exception
It will throw a concurrent modification exception most likely, lol
oof
damnit xd
adding throws concurrent?
yep
i did not know that one
what's Stack used for really? 🤔
Unless its a concurrent list impl
"modification" causes concurrent
Stack is used whenever you process stuff last in first out
isn't queue faster tho?
queue is FIFO
A calculator is the example stacks are getting taught with
ArrayDeque implements all of them
Where you just add all operations on a stack
there's really no speed difference
and he should have used ArrayDeque ^^
i use deque, so usefull for rollback
Whenever a color tag opens, I push the color on the stack, whenever it's closed, it gets removed again
And then for every component I just peek and add the color
People still use Stacks?
nothing to see here
is optional over returning null that big of a deal? 🤔
It's a garbage object
optional is possibly one of the most useless things in the java api at the moment
ok that's not true
but like, it's not that useful
You want to solve nullabilty at compile time via method contracts
And then just do null checks when your ide yells at you
Untill we have value types
i guess optional is nice when you want your chain of 28 lambda expressions to look cool
I'm really tired and I think I'm doing something stupid
pseudocode
private void gameTimer() {
new BukkitRunnable() {
@Override
public void run() {
Debug.message("players: " + getPlayers().size());
if (getPlayers().size() < 2)
isActive = false;
if (!isActive) {
cancel();
endMatch();
return;
}
gameTimer++;
matchScoreboard();
}
}.runTaskTimer(KeyValues.plugin, 0, 1);
}
I feel like Optional has its very niche use-cases
getPlayers never updates
is it because I put it in a runnable
and how do I fix it
I feel like I'm missing something due to sleep deprivation
Though for the most part, yea... screw Optional lol
I am also checking on other classes that the value is different when not in the runnable
@slim hemlock you haven't shown us the code that updates getplayers
like I'm using the same getter
if it doesn't exist it might not be surprising that it doesn't update
https://discordapp.com/channels/690411863766466590/690470011382267904/701548808936488980
literally took 2 seconds lmao
it does exist
private HashSet<MatchPlayer> getPlayers() {
return players;
}
private void addPlayer(MatchPlayer matchPlayer) {
players.add(matchPlayer);
}
private void removePlayer(MatchPlayer matchPlayer) {
players.remove(matchPlayer);
}
private HashSet<MatchPlayer> scoreboardPlayers = new HashSet<>();
private HashSet<MatchPlayer> players = new HashSet<>();
and i guess nothing ever calls addPlayer or removePlayer?
should probably be Collections.unmodifiableSet(players)
unify those somehow
konsolas I'm using the same getter elsewhere at the same time and it's returning a different value
the value is updated
is it in a different thread
@slim hemlock why do you set the boolean and then right after check said boolean? Does it get updated outside of the runnable at all ? o.O
if not, just remove that check and put your cancel method there instead
I was going to say the same. Sounds a lot like a data race
not a race, it's the same value before and after
it's a runnable so even if it were a race at some ppoint it'd be updated
@keen compass because multiple conditions may end a match that are not all incorporated in that snippet
i would recommand you to have in your game instance an unified playerset because it's easier to handle
@slim hemlock is addPlayer and removePlayer the only thing that modifies players?
no, they get initialized differently
just the thing that initializes the values I think
what initialises the values
change your HashSet<MatchPlayer> to final Set<MatchPlayer> and your getPlayers to private Set<MatchPlayer> getPlayers() { return Collections.unmodifiableSet(players); }
just minimise the number of things that bits of code can screw up
use the correct methods to add and remove
and with any luck a compile error or an unsupportedoperationexception at runtime will tell you what's happening
i'm leaving
wait getPlayers is private???
what's going on
why do you need a private getter
i'm definitely leaving now
How can I slove this problem: [Netty Server IO #1/ERROR]: Could not serialize ... - will not be sent to client!?
look
I'm retarded
see I knew I was too tired
it's old but golden
@EventHandler
public void AoQuebrar(BlockBreakEvent e) {
Player p = (Player) e.getPlayer();
if(p.getWorld().getName().equalsIgnoreCase("mina")) {
Iterator<ItemStack> var3 = e.getBlock().getDrops().iterator();
while(var3.hasNext()) {
ItemStack item = (ItemStack)var3.next();
if (item.getType().equals(Material.STONE)) {
item.setType(Material.AIR);
}
}
}
}
Why is not working?
that's why you should have a unified player set
ImmutableSet.copyof() is nice too
@old barn you probably want COBBLESTONE unless everyone is running around with silk touch
public class Manager<T> {
protected Collection<T> collection;
public void add(T t) {
this.collection.add(t);
}
public void remove(T t) {
this.collection.remove(t);
}
public void toSet(Collection<T> collection) {
this.collection = collection;
}
public Collection<T> asSet() {
return ImmutableSet.copyOf(collection);
}
}
easy peasy
Oh would ya look at that. A collection wrapper!
i don't buy that because i don't think you necessarily need a copy
since most spigot stuff happens sync
unmodifiableSet is better for that
Yeah well I need to make sure a lot of things are thread safe for when I code
but either way works
That whole class is really, really useless though. You're wrapping a HashSet in another class
It's not even iterable, or cloneable. It's a middleman class
Hell, it's not even thread safe lol
Actually, I put this block just for testing, I broke stone with silk touch and it keeps dropping
@silk bane
Block#getDrops() is immutable
Why am I still getting this error ;-; 'java' is not recognized as an internal or external command,
operable program or batch file.
Or, rather, it returns a new collection every time it's called
Modifying it does not modify the drops
To give players permissions do you use .addAttachment?
or do I need a permissions plugin
So how could you be canceling the drop?
BlockBreakEvent has setDropitems(boolean)
If the event.getBlock()'s type is stone, setDropItems() to false
I am not saying ImmutableSet.copyof() is thread safe, the person using it would have to make sure that the collection they pass in is thread safe
Doesn't make your class any more useful. I mentioned thread safety because the class you sent above has no benefit whatsoever
You'd be better off defining a collection instead
I have used it for many things and it has helped me tons
That's great, but it still doesn't make it any more useful lol
Not for you but for me it does
Again, it's a middleman class
Thanks
Why do you have to argue everything?
I have my opinions
Accept criticism, please. Whether or not you use it, the class is useless
^
You cannot grow as a developer until you learn to accept criticism
You'll be stuck doing the same stupid shit you did when you started
How do you give players permissions? Do you use .addAttachment or do I need an external plugin?
whenever I download the jdk shouldn't I be able to use java commands in cmd?
Just define the collection you want to use directly. If you have to expose that collection publicly, wrap it in a Collections.unmodifiable<WhateverType>()
What are good moderation plugins? Litebans is doodoo
You'd accomplish the same thing you're doing with that class only you're actually able to perform collection operations on it
And it's Iterable, Cloneable, etc.
That is true
@subtle blade setDropItems() is not exist
In BlockBreakEvent?
yes
Ehhhhhh imma have to disagree lol https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/BlockBreakEvent.html#setDropItems-boolean-
that takes a boolean
setDropItems(false) if block type is stone
https://i.imgur.com/lk9BvUk.png don't you love it when your debug messages are purring like a cat
if only the watchdog would stop interrupting remote debugging
Was added in 1.12 if that's of significance though we assume latest version
If you're on 1.8.8, I don't know... BlockDropItemEvent?
actually that was added even later lol
there's no way ItemSpawnEvent will work is there
It probably would but you wouldn't be able to get the block from which it was dropped
I'll see if there's any event like that on 1.8.8, gimme a bit
there does not appear to be a suitable event on 1.8.8
@EventHandler
public void AoQuebrar(BlockBreakEvent e) {
Player p = (Player) e.getPlayer();
if(p.getWorld().getName().equalsIgnoreCase("mina")) {
if(e.getBlock().getType() == Material.STONE) {
}
}
}
setdropitem is not exist ;-;
e.setCancelled(true); e.getBlock().setType(Material.AIR);
What version are you using?
1.8.8
Yea that's why
Newer versions have newer features \o/
Even then, setDropItems() is 3 years old, dude
If you add version 1.12, it won't run on a 1.8 server, right?
Well... no
So, how do I cancel the drop in version 1.8.8?
How do you give permissions to players? Is it the addAttachment() method?
100% no event like that for 1.8.8, I don't even see any sort of Drop event either
Should I use an external plugin for permissions?
yes
@inland heron yes
Yes, you do, imgamg. See the Permissible interface https://hub.spigotmc.org/javadocs/spigot/org/bukkit/permissions/Permissible.html
Add an attachment from your plugin, set permissions in the PermissionAttachment
how do I cancel the drop in version 1.8.8? Do you have any method?
Cool, thank you
In 1.8, as mentioned above by konsolas, you had to set the block to air
It was a very hacky way to do it, but again, you're running a very, very old version of the game. 5 years old, in fact
In here? I'd imagine most would agree
I know about the method of setting the block as Air, but there is a bug in this method that when breaking the block, the pickaxe does not lose durability, but I will try, thanks
I asked for feedback in rate my server about my custom pvp game and the first reply was “I haven’t even gotten on the server but PVP IS BETTER ON 1.8 REEEE”
eye roll
lol
1.8 can suk me dik tbh
you'll never get anybody that plays that version to actually try and like it. They already go in with the idea that it's inferior and are anal about it being true
i like 1.15 pvp more lul
performance is a lot better on 1.8 tho but thats about the only thing it got going for it
¯_(ツ)_/¯
Would this also be the correct channel to ask about Spigot APIs (plugin dev), or is it just for "users"?
it's for everyone since md_5 only had the budget for one help channel
Most questions we get here are from people making plugins. @mossy turtle
:/
Ah, thats nice to know. I just recently joined, didn't want to abuse the channel 🙂
Hmm, anyone familiar with the JavaPluginLoader code?
?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.
thx 😉 good point
@EventHandler
public void scChat(AsyncPlayerChatEvent e){
Player p = e.getPlayer();
if(StaffChat.scList.contains(p.getUniqueId())){
e.setCancelled(true);
for(Player player : Bukkit.getOnlinePlayers()){
player.sendMessage(Utils.chat("&b&l[SC]&c " + p.getName() + " " + e.getMessage()));
}
}
}
why is msg sent twice
@finite pine does execution run twice? ie. if you logged in the first line in the method, would you see that twice also?
no
you using /reload to iterate on your plugin by chance?
no
Hmm dunno, seems legit. haven't done much with chat events tho. does priority matter for cancellation?
is it only being sent twice to the one person executing the chat event?
all persons who are in the list
What does Utils.chat do? Is that a part of the Bukkit api?
Okay gotcha
I can't see why that would send twice
Yeah that is odd.
Is it the only plugin on the server
what's the best way to register events outside main class?
^
i've got that
instance.getServer().getPluginManager().registerEvents(event, instance);
Bukkit#getServer also works
yh i have that
I have it again in the main class
now staff chat doesn't work
Console error or just not working
not working
then it likely isn't registered properly
public Main plugin;
public SCListener(Main plugin){
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
every other listener worked
Check the event is being called with a debug message, but that looks fine
As long as you're actually creating an instance of the class
where should i place the debug messages?
in your constructor
One to check the event is being called, then one for your if statement
would be a good one
Nah, he wants to check if the event is calling correctly
As ever, no
public Main plugin;
public SCListener(Main plugin){
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void scChat(AsyncPlayerChatEvent e){
Player p = e.getPlayer();
Bukkit.broadcastMessage("ada");
if(StaffChat.scList.contains(p.getUniqueId())){
Bukkit.broadcastMessage("ada");
e.setCancelled(true);
Bukkit.broadcastMessage("ada");
for(Player player : Bukkit.getOnlinePlayers()){
player.sendMessage(Utils.chat("&b&l[SC]&c " + p.getName() + " " + e.getMessage()));
}
}
}
none
Then that tells you the event isn't being registered
Meaning you likely don't donew SCListener(Main);
wouldn't i do new SCListener(this) in Main?
Yeah
You can just do
@Override
public void onEnable() {
new SCListener(this);
}
unless you need to use the class later
still doesn't seem to work
Show your main
np
ouuu never a good idea to hide logic like that inside of a constructor
Bukkit#getServer also works
@dusty topaz Fun fact. Bukkit statically mirrors all methods from Server. Calls to getServer() are redundant unless you need the Server.
Also,
ouuu never a good idea to hide logic like that inside of a constructor
this ^ ;P
So it does, Bukkit#getPluginManager then
Is it possible to get the Arrow item causing a EntityDamageEvent/EntityDeathEvent if the arrow is a Tipped arrow of Harming? Because in my tests, the resulting effect from the arrow killed the entity, not the arrow itself
and as such, I cannot get the causing item
Hi.. Im creting a bedwars server wth aternos
can somebody help me
i dont understands how the plugings work
please
Anyone know an efficient and easy way to replace all contents in an existing file?
nvm
new FileWriter(file, false)
// true appends to contents, false overwrite contents
Hey
I keep getting "If you wish to use ip forwarding enable it in your bungee config aswell"
I have enabled and Im not sure what else to do
@fleet crane
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getInventory().getHolder() instanceof MenuBuilder) {
Bukkit.broadcastMessage("t");
MenuBuilder menuBuilder = (MenuBuilder) event.getInventory().getHolder();
menuBuilder.onInventoryClick(event);
event.setCancelled(true);
}
}
```how come that works with paperspigot and not normal spigot?
Should I be creating a new class for each listener I create?
why would you ping md5
Hi, I've just bought FactionsUUID
If someone tries to /f fly
it enables, but after a few seconds he just falls down
and needs to retype the command... Anyone who can help me?
@potent blade Could there be another plugin removing the ability?
Not sure how I can help to be honest
Do i need massivecore when using factionsuuid?
I think it probably says in the documentation wether you need massivecore or not
What dependencies it needs
I want to create a mc server running the newest 1.16 snapshot on my raspberry pi 4 (4g ram), is there anywhere I can get help for this?
Is the reason I'm getting an EventException because helmet, chestplate, leggings, and boots could all be set to null?
EventException just wraps other exception
oh
send stack trace
Ye
you're 5 years out of date
I also get illegal reflective access
Or somethign like that
lol
Still lets me run tho 😄
This the right place to ask some bungeecord questions?
Here's the end
Could you show us the line numbers of your code also? 😛
event.getItem() can return null if no item is in hand
Ok, thanks
Also...
You saw that first picture I sent? With the InventoryInteractEvent
For some reason it doesn't set "sorcerer" to true when I have full gold equipped
I also assume the p.getInventory().getHelmet() can return null too
Lol, using eclipse and default dark mode
Well it's not default. White is actually default. But this was called "Default dark mode" under view
is there an easy way to check for if a block is a tile entity?
Yeah, it's very nice having color
like a chest
yeah just tried it, doesn't seem to work
but you could try BlockState instanceof TileState
Represents a block state that also hosts a tile entity at the given location. This interface alone is merely a marker that does not provide any data. Data about the tile entities is provided by the respective interface for each tile entity type. After modifying the data provided by a TileState, BlockState.update() needs to be called to store the data.
i think it could work
All Known Subinterfaces:
Banner, Barrel, Beacon, Bed, Beehive, Bell, BlastFurnace, BrewingStand, Campfire, Chest, CommandBlock, Comparator, Conduit, Container, CreatureSpawner, DaylightDetector, Dispenser, Dropper, EnchantingTable, EnderChest, EndGateway, EntityBlockStorage<T>, Furnace, Hopper, Jigsaw, Jukebox, Lectern, ShulkerBox, Sign, Skull, Smoker, Structure ```
That is how you would do it, yes
woo
TileState check the BlockState
i know how to readd docs lol
as i read them more i understand things more, crazy how that works out. lol
yo is there like a list or something with all the like spigot lines of code or something (im new and trying to like learn and stuff so sorry if you got no clue what im talking about)
javadocs?
idk
I’d say come up with something you want to create first
thats the thing I want to learn how to, but like I don't learn anything from video tutorials
Ok
I just like copy them but I dont learn
idk how to actually learn it so that I can do it myself
Pick something on a server. Like a mini game. Get as far as you can. When you can’t get any further look for what you need in bukkit java docs or google a piece of your problem and slowly build that mini game. At the end you’ll have learned about many things and feel more comfortable about building unique plugins.
I mean I guess thing is like the only thing I know atm is like the beginning things that enables and disables the plugin
Ok
I can possibly try looking at the doc and see if I can learn from there
but like I dont wanna copy someone and then believe I learned something
when all I did was copy
I’d suggest looking at a video on how to make your own command. Then after that make your own command but make it more complex than they did.
mk ill try that
thank you so much man
I really want to learn how to make my own plugins just for the hell of it so again thanks xd
Cool, I just started last week and know how tough it is to learn stuff.
So like should I make 1.8.8 plugins or is that like super irrelevant?
since from what I see in the docs
its for 1.15.2
I’m not sure, if you’re trying to mess around I would use the latest
Yes
Hey can someone help update a plugin for me? its a super small one. Owner has quit the community years ago and we need this plugin to redesign a remake of the server
"paper" spigot server
Is there a deadline, what version do you want it updated to?
1.15.2
there is no dedicated deadline as we are still configing other plugins
but would be heavily appreciated 🙂
to be noted* It was originally written in a code called "rainbow"
Never heard of it
yeah it was a very small used plugin custom made for 1 server and that was his own coding pretty much
his other plugin https://dev.bukkit.org/projects/joemarriage
I can pay if someone can update and get these two working
joemarriage works on 1.15.2 but has 1 error message when the other player does /marry
guessing sorce code isnt up to date?
is this a good vps for a small survival server?
7 players max
not very many plugins
@frigid ember is that vultr?
OVH
I use galaxygate
Hello! I hope everyone is doing well in this crazy time.
I own a SMP minecraft server with about 50 players (at most 27 at one time playing)
We just reset and changed our server hosting platform (henzner cloud using pterodactyl) and have been experiencing a LOT of lag,
When we have 20ish or more people online we can easily get down to 7 or 8 tps and we might get up to 12 at max.
We have now spent multiple days trying to optimize the server and seem to not be making much progress, its getting super annoying
We have some top spec hardware (16gb ram, quad core AMD cpu) and it seems to be plenty when we have 10 ish players on its a steady 20 rarely dropping below 19.
I am running out of ideas, and it seems like i have got plenty competent server hardware, so i dont really know what to do.
Some other info:
we are using a few plugins, a discord SRV, Tps pluin, coreprotect, a custom coded grave plugin, and pingplayer
as for datapacks we have a lot, most from vanilla tweaks.
Please Help me, it would be much appreciated!
@dark jay https://www.spigotmc.org/threads/guide-server-optimization⚡.283181/ There is a guide for server optimization.
Please contact your host, they are the ones who can help you the quickest.
- There is nothing the spigot community can do about it...
Question to all the java wizards out there, First off hi! I am new to the Spigot Discord. Secondly I am also starting to slowly learn and develop a custom plugin for my server. Currently I am stuck with adding one line...
I currently have my plugin set to deny the drop of the "Compass" which is the menu item. However when the player dies they drop everything like normal. Is it possible to prevent players from dropping the compass on death, and still allow them to drop all other items?
sorry to bother everyone im in need of some help. i recently added bungeecord to my servers and i am now running into a ploblem i cant seem to fix. The connection works fine but when players get into my economy server through the bungeecord lobby they cant seem to use any permissions i set up for them in the economy server. {i use ultra perms to set up the permissions}. for some reason they can only use the bungeecord perms. i probably explained this all weird and im really sorry. its hard to explain.
@untold notch Yeah the PlayerDeathEvent has a method to getDrops() https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDeathEvent.html#getDrops-- Iterate through the list and check if the drops contain a compass (check for more NBT if needed). Correct me if I am wrong but you can potentially remove the compass material from the drops list.
@velvet halo Thank you !! Much apprecaited I will test this out and let you know the results. I am hoping to just make it to where it either gives them a compass after death or it prevents it from being dropped on death.
@jolly surge Did you install the luckperms plugin on your economy server?
i use ultraperms
sorry ultra
ohh no i didnt
yeah its already installed onto my server
with everything setup
its just weird. players cant use any commands for some reason without me giving op and thats dangerous
they can only use the bungeecord commands
i can try to install the ultraperms onto the bungeecord server too
No you only have to install your permissions plugins on spigot/bukkit servers
Bungeecord is a bridge between your servers.
ok thats already done then
Are you wanting your permissions to be global or have permissions specific to a server?
permissions specific servers
so basically each server will have its own
but i want players to be able to use bungeecord perms as well
[ex. /server skyblock or /server lobby]
permissions:
default:
- bungeecord.command.server
- bungeecord.command.list
admin:
- bungeecord.command.alert
- bungeecord.command.end
- bungeecord.command.ip
- bungeecord.command.reload
``` Bungeecord config has a permissions section in the `config.yml` this is where you can add the permissions.
Everything labeled under default will be allowed by all users on your servers.
ok so why cant anyone use the perms i already have setup on the economy server?
anyone can use those i set them up already 🙂
Could you send me over the files you have setup for the groups so I can take a closer look? 😮
?paste
i can give you file acces if that will be easier. sorry im new to a;; this stuff and still learning
all"
@frigid ember i would NOT recommend that VPS
vCores are not good for minecraft servers, youll need at least 2 or 3... and my experience with OVH vps are not that great when it comes to minecraft
2 GHz not great
4 GB ram also..... youll be running out quick
I would look into purchasing a Kimsufi dedi, kimsufi is child company of OVH and ive heard good things about them
Yeah sure I can help you if you want @jolly surge let me add you as friend.
yo, is there any sort of packet which allows biome change?
I am thinking of making some sort of "event" system in my plugin, and part of this involves changing the color of the sky
so if I change the biome to the end biome, the sky will appear grey
just can't change the actual biome though, looking to make it clientside
biome info, and the rendering of the sky depending on the biome, is all client side based on loaded world information.
You can change the biome of an area, but the player has to reload the world to see the change
is there any plugin that i can enchant everything to 1000 for 1.15?
@frigid ember You can fuck with the sky using rain manipulation
But you can't exactly replace a biome easily
Since it's binded to the chunk
A 256 length array in the chunk class contains each block's biome in the chunk
Is there anyone who knows a good tutorial series to like start coding my own plugins?
Without like me just copying and getting no where
Honestly just read the Plugin Development tutorial
and learn Java @ the Oracle website
You aren't going to learn it in a day by any means.
But you could easily get a basic plugin started on your first day for sure.
I don't think the point of tutorials is to copy code tbh
If you actually want to learn take what's in that tutorial and expand on it, change stuff.
Also, once you have the basics down, don't follow an entire tutorial series. Find tutorials for specific things you want to do. It's more motivating to accomplish things you want to rather than trudging through an entire series just to learn how to do the one thing you really want to do.
is there any plugin that can change gamemode on join?
@limpid fulcrum You can donate >=$10
https://www.spigotmc.org/wiki/donations/
?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.
every time I disconnect my mobs disappear, it happens to me in the iron farm
it doesn't matter if they have a nametag, they still disappear
hey , can someone help me ?
when i command /is top , the head is not load the skin but i already use skinrestorer. how can i fix /is top so the head has skin
i use skinrestorer and bskyblock
online-mode=true, stop pirating the game
every time I disconnect my mobs disappear, it happens to me in the iron farm
it doesn't matter if they have a nametag, they still disappear🙄
@twin nexus You aren't providing enough information. What plugins do you have installed that could be messing with mobs?
It's probably that then
Anyone free to assist with something?
Sure
So I am working on this still, I want to give an item to the player after death being the compass...
I am unsure how to "cast" or add this to my class
So basically keep a compass on death?
Yeah I want to give the compass on respawn I should say
Send current code
paste bin or plain text
get it on respawn again
Mhm okay
Oh... so it wasn't getItemDrops... I am still learning this haha and I am clearly bad
Its ok (:
Equals should only be used with Strings
ew
er*
wut
you use what makes sense, .equals is perfectly valid, but given that enums are garaunteed singletons, == works there and is preferred
gotcha! That is just how I have been learning..
@untold notch I could give you some advanced code otherwise just loop through the drops
you should have the javadocs for cross-reffing methods on events, etc
@naive goblet advanced code would work haha been on this for about an hour
for (ItemStack item : event.getDrops()) {
if (item.getType() == Material.COMPASS) {
event.getPlayer().getInventory().addItem(item.clone());
}
}```
This is simplified lets skip lambdas and consumers this time
I might have done something wrong, on mobile
no worries I will try this
Equals should only be used with Strings
@velvet halo bruh no, anything that isn’t a primitive
for what ever reason it is still wanting me to cast the getDrops event 0.o
event.getDrops().stream().filter(item->item.getType() == Material.COMPASS).findFirst(item -> event.getPlayer().getInventory().addItem(item.clone()).orElse(null);```
Cast it to what?
Just recommends adding a cast? Eclipse shows me an error there o.0
Try do as they want
eclipse
What would it add then?
getDrops() should return a list of itemstacks.
Yes?
You shouldn't need to cast it to anything
with eclipse, you basically need to save often, otherwise it goes janky
Gotcha let me truy
So for example I have this @EventHandler
public void onDeath(PlayerRespawnEvent event) {
for (ItemStack item : ((Object) event).getDrops()) {
if (item.getType() == Material.COMPASS) {
event.getPlayer().getInventory().addItem(item.clone(Material.COMPASS));
The object is placed when I do the recommended "Cast" for eclipse
yeah ikr maybe it is messing up or i am lmao
idk how to use it but I will switch and give it a shot
seems to be easier when coding plugins for minecraft i guess
Its the same but better in my opinion
there is a plugin for creating ez maven/gradle projects for plugins
minecraft development
thanks guys ! I will attempt in the morning, its late here have a good one ya all
(:
rm rf eclipse && wget intelij
:v
😳
I've tried multiple times to use eclipse for a day to try to understand how people work with it and believe that it's not all that bad
I erm...
I think my record was 5 minutes
I’d say it saves memory other than that it’s quite not my style
well, IJ uses a lot of memory for the PSI, so heavily depends on what you're working on
Mhm
Well, eclipse has a project view where you can see all your projects at once which I like
Intellij can have as much memory it needs ❤️
I dislike that heavily
xD
For instance say that you work on a framework and another project it wouldn’t be dumb to just being able with 2 clicks or so to switch
And not having to wait for a project to reload
Pretty sure that there is literally only eclipse and glorified text editors which really preach having a workspace, any other programming software works akin to IJ
I can already do that with IJ
There is no really overall projects view in IJ?
you can have multiple windows open
Lol nah that’s just messed up
I mean, I also have tabs disabled
Interesting
So, having two windows makes it a muuuuch easier flow for me
Uh I like the eclipse thingy 🤨
Does anyone know how to stop a BungeeCord runnable? I got this code but I can't seem to find a way to stop it without stopping all runnables in my plugin
plugin.getProxy().getScheduler().schedule(plugin, new Runnable() {
public void run() {
if(p.getServer() != null) {
String serverName = p.getServer().getInfo().getName();
BaseComponent message;
if(p.hasPermission("arcadia.staffchat")) {
message = new TextComponent(Utils.chat("&4&l[STAFF] &c" + p.getName() + " &4joined the network on &c" + serverName + "&4!"));
for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
if(player.hasPermission("arcadia.staffchat")) {
player.sendMessage(message);
}
}
} else {
message = new TextComponent(Utils.chat("&e" + p.getName() + " joined the network on " + serverName));
for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
player.sendMessage(message);
}
}
//STOP THE RUNNABLE HERE
//STOP THE RUNNABLE HERE
}
}
}, 0, 10, TimeUnit.MILLISECONDS);
Use lambdas
Do you even need task ids?
if you wanna cancel it, yea
Isn’t there a cancel method for all tasks like spigot?
Yeah i think there’s no method inside a runnable to cancel it from inside
Nope
Ouch
Well, there is one for a plugin
oh, actually
schedule returns a ScheduledTask
So, you can cancel it on that, but, that's not actually passed in, so you'd need to ref it
how can I run a code after all plugins are done initializing? Ive got this right now but I dont like the idea of running this code on the first tick
there is an event now in the server for that
So, if you only need to support latest, can do that, otherwise, scheduler is all you got
are you guys talking to me?
Yes
So, you can cancel it on that, but, that's not actually passed in, so you'd need to ref it
@chrome lark
I understood everything except this sentence. I made a variable of the returned ScheduledTask but when I do task.cancel() it gives me an error that the variable might not have been initialized yet :/
Cable I there is 1 way but its not something you should use
i need something like this
Basically, there is no super clean way to do what you wanna do
You could load your plugin on start up and then manipulate stuff to make it disable and enables last
Using a 0 sized array is generally the goto for that type of stuff, you'd basically need to find some way to throw a reference to the returned task
@zenith siren split of the runnable from the task
0 index array could work, gross, but, yea...
this completeinitialization needs to happen after all plugin constructors have run
and after all commands are loaded from the plugin.yml
Yeah read what I sent
thats what im doing right now
Bukkit literally has an event for when the servers about to start ticking
^ thats what i need
Well plugins can be enabled and disabled here and there, just so you are aware of that.
ServerLoadEvent
@zenith siren split of the runnable from the task
@bronze marten
Thanks, but how....
This doesn't work because the variable task hasn't even been declared yet
Runnable runnable = new Runnable() {
public void run() {
if(p.getServer() != null) {
String serverName = p.getServer().getInfo().getName();
BaseComponent message;
if(p.hasPermission("arcadia.staffchat")) {
message = new TextComponent(Utils.chat("&4&l[STAFF] &c" + p.getName() + " &4joined the network on &c" + serverName + "&4!"));
for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
if(player.hasPermission("arcadia.staffchat")) {
player.sendMessage(message);
}
}
} else {
message = new TextComponent(Utils.chat("&e" + p.getName() + " joined the network on " + serverName));
for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
player.sendMessage(message);
}
}
task.cancel();
}
}
};
ScheduledTask task = plugin.getProxy().getScheduler().schedule(plugin, runnable, 0, 10, TimeUnit.MILLISECONDS);

