#help-development
1 messages · Page 1851 of 1
and just vanilla mc ?
Paper
client
Vanilla
like this msg there ?
It does appear in the death screen
Yes
Then it disappears after a few secs
Like the text. Gone
But the You Died, Score, and the buttons still there
hmm probably because it is not a translateable msg ^^
I have sout it and Im sure it only runs once
Wdym
if your client has spanish as language it will show another death msg in death screen then default to everyone else on the server .... because it is a translateable msg (e.g. something like minecraft.player.dead.out.of.world)
I'm running on English...
yeah but you send a custom msg like "you died with the force of bad coding"
and this msg overwrites the vanilla behaviour of a translateable msg which is probably causing this bug
and why is it getting overwriten
because he uses event.setDeathMessage
then why does it change
how can i get the player's skull
it is a generel vanilla behaviour in spigot O.o
or mabye not vanilla
but its not working even without the playerdeathevent involved
@ivory sleet
guess your job to create a issue in the web now :p
tested on clean installed server without any plugins and the msg rly disappears after some seconds
How can i manage to have an individual scoreboard and teams everyone can see? Teams are only visible to ones with the same scoreboard, but indivisual ones require different ones for very player?
? Oh I am merely a moderator here
If i am using a forge-spigot hybrid, is it possible to get my item texture from there?
thats reason enought for me to give you the responsibility for creating issues đ
dont know about forge-spigot thinks... but the texture of items is still client-thing .... if the client does not have the resource pack he will not see it
public static void storeParkourAttempt(Player p){
UUID uuid = p.getUniqueId();
String name = p.getName();
String parkourAttempt = String.valueOf(ParkourAttempt.getAttempt(p));
if (parkourAttempt != null) {
DBObject obj = new BasicDBObject("uuid", uuid);
obj.put("name", name);
obj.put("ParkourAttempt", parkourAttempt);
players.insertOne(obj);
plugin.getServer().getLogger().warning(Parkour.prefix + "Successfully saved ParkourAttempt for player [" + name + "]! ");
} else {
plugin.getServer().getLogger().warning(Parkour.prefix + "Tried to store a ParkourAttempt for player [" + name + "] but player was not attempting? wtf??");
}
}
[ERROR] .... Could not pass event PlayerInteractEvent to MGZ-PARKOUR v1.0
java.lang.ClassCastException: class com.mongodb.BasicDBObject cannot be cast to class org.bson.Document (com.mongodb.BasicDBObject and org.bson.Document are in unnamed module of loader 'MGZ-PARKOUR-1.0.jar' @32b846c)
@ivory sleet https://hub.spigotmc.org/jira/browse/SPIGOT-6876
How did you do it in vanilla minecraft? Isnt plugins only able to run on servers?
that was just the first draft of the error ^^
i didnt want to write that plugins cause this
in vanilla mc the msg does not disappear - it disappears on spigot servers without any plugin
Spigot papers
xD
What
I know nothing about your issue
Why not
Oh yes youâre right
Youâre supposed to be a mod smh
yes exactly i am way to diverted
I have no idea why it cant cast and im uncertain of the way i am storing the data to the db here whether its the right way or am i doing something wrong?
I got it off of forums of 2020
spigot forums or something
Anyways no, seriously, if you found an issue, you should report it yourself, donât ping me stupid things like this
Hi I am trying to make a plugin that makes passive mobs aggressive this is the code I have rn ```java
Entity Pig;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender instanceof Player) {
Player player = (Player) sender;
LivingEntity e = (Pig) Pig;
e.attack(player);
}
return false;
}``` This seems like a really stupid way to do it so any suggestions to make this better? I dont even know if this will work
Oink you
I'll need to make a custom mob in the future so it seems like a good time to ask lol.
To make custom mobs do I need to make a class that inherits from Entity.** or is there a simpler way to do so?
Thatâs probably the easiest way
Thanks, just last time I touched spigot was in 1.8 library (around 2 years ago) so a lot changed and I forgot so much about Java XD
how to access mojang mappings?
Check the release post for your version
In 1.12.2, the field amount in org.bukkit.inventory.ItemStack's constructor refers to the maximum amount of items a player can hold with one stack?
Like how snowball is limiting to 16 of each?
Is there a way to slow down Baby to Adult growth? Like legit IRL hours?
they say i should try to avoid it but i cant at my point
Keep reading
Do it manually@
I was thinking of AgeLock + PersistentData of born Timestamp then a entity runnable and checking if "should" grow after the hours and then manually grow to adult?
Can it be 1 or less than 1?
Yeah
It can be 1
It can be one, yes. Meaning there would be one item in that stack. If it's zero, the stack disappears because there is none of that item
And negative 1 causes the universe to implode
Something like that
Multiply minecraft ticks per second and seconds in an hour and set the setAge to the negative of that amount?
Wait, what is the required age for a mob to be adult?
Problem is age is only a short iirc
0 becomes a adult. Youngest baby mob is -24000. I think you were thinking to hard. So you can make it so that it drops a XP Orb when the tick is -24000 ~ -1
if method above not work you can handle it by yourself with PDC and checking randomly
if it is short then its -32767 or am i wrong ?
Probably, Just multiply -72000 by the hours and you should be good.
Where did you get that
out of my brain
Hello ! I would like to know if there is a guide on single-thread Minecraft, with informations on what is actually single-threaded, what can be multi-threaded, etc.
I was looking around the forum but I don't find any complete post about it.
If you have one, I would love to see it.
Thanks
If for some reason it doesn't work, set the age to like -24000 and make a loop every 5 minutes to reset it, then maybe after a few hours, stop the loop and set the age to 0
I need about 10-15 real hours
I dont know at all
Try to set a mob's age to -108000 and wait for 15 hours to see if itll work
Multithreaded rendering is possible...
Assume everything is single-threaded and you'll be fine. Not much can be safely multi-threaded
you can also speed up tick speed and then just check if it work properly
I think at least that random tick speed has the same effect in servers (not sure tho)
Random tick speed is for crops and such not mobs
How would i have a foreach inside a filter?
instead of forEach, convert actiontypes to stream, filter, and check if there is any item in it
You could make a bracket.
Why would you want to do that though? What are you trying to do?
Im trying to filter every action in a faction and check if that action's type equals a set list of actiontypes
like this?
yea
Streams are still quite slow tho
how else would i do it?
Not really
They're ~20% slower than a regular loop
Not "quite slow"
Enough that maybe you won't use it for something really performance critical
But generally not a big deal at all
Hmm thought they could be almost as fast as a normal loop
also does that measure take parallel streams into account?
Hey đ I have some troubles creating a plugin...
Im creating my Eclipse Java Project (I tried JRE 17 + JRE 1.8), and importing spigot server, but the JavaPlugin won't import
Oo interesting
Actually I will have to ask what score is
Do you have any particular reasons to not use IntelliJ?
Yea
thank you so much, it works
well everything over 1k is a noticable lagg ^^
I always used Eclipse, but if it's similar I can look it up
I think you're reading the graph wrong my guy
Kotlin sequences
They're a different library from streams
Ohh the Java sequences
Matt, who ran this benchmark, translated kotlin sequences to java
For the stream im using should i run it async?
or would it not impact performance much?
ok thanks
IntelliJ is the best IDE you can use for programming Minecraft Plugins or Java in general (this is not a stereotip or something). For Minecraft plugins you just install a plugin in IntelliJ's marketplace called Minecraft Development and then you create your project using "Minecraft" option. It's easy to use and efficient for team programming
ahhh okay
Unless it starts actually causing issues then you have no reason to worry
At the start it might be confusing but a simple Google search on how to use it will be fine
Problem is that parallel streams are not inherently thread safe
em... whats wrong if someone use eclipse??? do you have any particular reason to hate eclipse?
So if your stream mutates some object which does not support concurrency updates and other stuff like volatility then itâs yeahâŠ. meh
notepad
just write code on paper, it's simple
Incorrect. Its personal choice. Both have their pros and cons.
It's nothing wrong
but it's like if you see someone riding a horse, you'd suggest them getting a bike. something like that
What are the pros of eclipse?
At this point: VIM is the better choice
yall using computer?
I code in sand smh
Very small memory footprint. Very clear and easy license (free). Corrupts WAY less than IJ.
we're not in pokémon.
no no no, not vim, vi
Did I say I hate Eclipse? I just find IntelliJ more easy to use and efficient
Hmm havenât experienced any corruption, but that sounds like a benefit if you run small on memory
Someone pin this
been using IntelliJ for 8 years, have not seem anything corrupted yet
some autocomplete cache mismatch? rarely, it's easily fix anyway
How many times have you had to invalidate cache and restart?
Yeah
Once
But thatâs due to maven and IntelliJ
Not solely IntelliJ
And one reason I stopped using maven (:
If its 1-2 devs I prefer Eclipse. Larger teams InteliJ
The only thing I dislike about Eclipse is it handling of nested modules.
Look I am not joking xddd
I'd say IJ is more widely used. Eclipse is old school.
Yeah
Personally I believe IntelliJ is better but yeah who cares what ide you use as long as doesnât hinder you
just switched to intellij some weeks ago because of the "extract Method" function .... and some autocomplete stuff
still notepad
Notepad
u a bad dev if you need completion
You a psycopath
No a good dev comes with laziness
Thats not true
anyone really remember the packages from where you import stuff?
my professor has a different opinion
well there was a book that teaches how to code plugins using notepadd ^^
Laziness leads you towards easier solutions
Wtv
My teachers told me that being lazy helps a lot
or leads you to use the one that works but is very inperformant
yeah, instead of using autocomplete for 3 seconds, why not look up javadoc for a minute
efficiency am i right?
what are javadocs
Yes like doing a bubble sort instead of a quick sort. I mean there are limits too
You still gotta think trough your laziness
Is it possible to save a material to a HashMap? If so, how?
When I say lazy its like, preparing methods in advance (algos class) to not have to rewrite code each time. Look for already made methods in the libraries before making your own
just like if you would store any other object, change the type
eclipse sufficed for my beginner needs but i grown out of it
Pulse java tutorials :gimme:
im actually teaching a java introduction course at my school
And i'm forcing them to use Intellij
đ
gotta influence my students
hwo do you do that thing?
could i have a copy?
So is it: HashMap<Material, String> materials = new HashMap<Material, String>(); ?
Vim
Just copy paste lucas
hoe can i load a custom created world?
does it work when it has at the begin world_build?
itâs open source
basically
Isn't there a view raw for readmes
load or create ?
I accidently made my java intro repo thing private
load
and then for example> materials.put(DIRT_BLOCK, âCOMMONâ); ?
it is just text thats crazy
should work
Lol ill try
I want to learn :3
Pulse knows what he's doing he's not allowed to make Spigot tutorials
So one of my students saw one of my spigot plugins
and hes like
"You code mc plugins? đ "
shots fired
but its true
there rarely is a good tutorial for anything in minecraft dev
Roflmao fr?
roflmao
Yep lol
roflcopter
Then he called him a nerd and dabbed on em
đ„Č
I was like đ”âđ«
How do teacher code looks like

Because spigot plugin people code are always messy
The trick is to use all static
looking rn
its not what i want it to be
it looks kinda good
amogus
You should use guice (:
i wanna rewrite it, but if i rewrite it, i get more bugs
Hmm
Test your code 
You code plugins in Kotlin?
kotlin kinda sloe hehe
not plugins, i feel like kotlin is just smthing i do for fun once in a while
dont actually use it for any practical use even tho i should
learning golang right now
Coppers-Odds-Shoe-Raffle-Service
LMFAO dont look at that
that was like my first project
Brb
I abandoned kotlin because of the nullables, it pissed me off
i tried to fix it, then i wa slike
what
ugh
i give up
XD
Kotlin null safety is the best thing the language offers
Most other features of kotlin are quite meaningless imo
sounds like smth I'd do
Cant I just do if(banana == null) return;
as an official JSON developer i can kindly disagree with @ivory sleet
Pulse that is enterprisy /s
Opposite end of spectrum
đ
Lol
As an official potato dev, I can agree your disagree
wanna know what annoys me
engrish
Lil cute bakkas?
"Still being worked on very hard"
Last commit 14 months ago
Lol
I dont wanna update it
cause if i do
people are gonna think its some big project
Interesting things you hide inside of it
i maintain
LMFAO
lemme go find my first plugin
My first plugin is a playerloginevent
đ
And says hello to the player
Pulse LOL
Wtf is that
XD
đł
Pulse
Pulse
wanna see my first plugin I uploaded on github, very high quality tbh
you will love this
Yaaa
https://github.com/Adelemphii/LightningTools @paper viper look at this quality
Player - sender 
My first plugin kicked players for repeated naughty words
Except Iâm pretty sure it was broken and just started kicking everyone
i still do that but for other languages
"Doesn't work, fix later" common comment of all my code to this day
thats why you learn atleast a but of java
srp would like to know your location
forst
dont you love all the try/catches
But it handles the starting window!!! /s
Do you have a vendetta against your future self?
quite surprisingly, it actually looks very well designed if u were a user
probably
had a super nice login menu and starting menu
Donât we all
New year snack
halfway through trying to fix stuff I get annoyed so I make a large TODO block and never touch the code again
sus đł
Can someone ban him

Yo

Learning a library before the language, only minecraft players do that
hmm wonder what atheists say
Yes
to this day I still have never actually read the code in this class https://github.com/Adelemphii/LightningTools/blob/main/LightningTools/src/me/Adelemphii/LightningTools/Vector3D.java
I legit just copied it from stack overflow
Someone using my library just tried printing a class
like
System.out.println(PacketEvents);
and asked me what was wrong

or did this
barack ninjama
its immutable
It's Comphenix anyways no one gonna understand the complicated stuff he writes
you copied from the right place
then they got kinda hurt when me and my team directed him to learn java
we linked very specific links
cyberbullies u for ur package name starting with an uppercase letter
:c
just means that it creates a new copy everytime you modify it (like after you define what it is, it can't change)
?learnjava @everyone
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
raging rn cause i cant find a way to crosscompile golang (with c-shared lib)
lol
hehe wen u realize java new keyword mutates 
i could cross compile for mac and windows when i used linux
lol
Golang can actually crosscompile to any os if you use pure golang
but its for c/c++

course not
đ„Č
Does 1.18.1 work
No
Ok
Sticking on 1.16.5 cause i heard 1.17 doesnt work
1.16.5 doesnât work either
Hello, could anyone tell me a way how to hide players on certain server? like auth...
No
Can i get info of a permission name? like Color.Red and get string Red?
?
How could I make a plugin that teleports players randomly into a base each, like for example in build battle they all get teleported to their own base
You need an algorithm which determines the locations
i want to store 2 string names in permission, like example.Color1.Red and example.Color2.Blue, then find per name "example.Color1" and get the full string permission, is that possible?
then just pair each player with a location and teleport them
Alright thank you
Does anyone know a way to make this code look cleaner? Basically multiple very simple events doing just slightly different things in a row
@EventHandler
public void onDeath(PlayerDeathEvent event) {
//some code
}
@EventHandler
public void onJoin(PlayerJoinEvent event) {
//some different code but still very simple one liner
}
// and like 3 more doing just that
dont u think if he was owner of mc he would get rid of NMS and make better one?
I wish someone would do this
its hard
Basically rewrite the implementation of minecraft
no proper docs
oh yeah
nms isnt an api
YES
wel i supuse is not possible xD
hmm interesting
NMS is just mojangs code mainly
it defined how the server works
like entities
and everything
and on spigot implements bukkitâs interfaces for example
(api)
sponge afaik rewrote the server
NMS is just what we call spigotâs implementation
sponge has no mojang code
and minestom doesnt either
NMS isnât an api, and actually shouldnât be interacted with
thats why an API exists
Iâm not saying Bukkit is the greatest, but NMS isnât supposed to be one
Well sponge has its api
mixins my beloved
Then SpongeVanilla just proxies and bridges it with nms
Then thereâs also sponge forge if itâs for a modded server I believe
And just sponge

Use pdc
Yeah
Yeah olivo forge veteran
spigotmc plugin jam when
im actually working on my own server rewrite, no api yet but its a fun project
you guys should try it if you like tinkering around with packets
Is it in python
whoever mentioned nms being hard, could help you understand the protocol at a deeper level
i remember when I wanted to rewrite an alpha server jar
Yo you could host one in your smp discord
theres decent docs on rewriting a server
not the best but it gets you started for sure
encryption, authentication, packet processing and the packet sequence nicely documented
and on your journey you end up contributing to them
so its rlly great
?pdc
a godsend
o thanks
sounds like a lot of effort that I could never pull off
So this is probs more math then development but it still has to do with dev so lets see lol.
I need to craft a certain amount of bread, lets say 5. So bread takes 3 wheat to craft, so I would do 3*5=15 to give me the amount of wheat I need. How ever, I also want to be able to calculate the amount of bread I can make based on the number of wheat I have... I can get the number of wheat I have but the equation IDK.
Would it just be 15(number I need to craft) divided by amount (amount of wheat I have)? Ex; 15/8
I also want to be able to calculate the amount of bread I can make based on the number of wheat I have
just get the amount of wheat you have and divide by 3? kek? round down ofc?
8/3 and then truncate the decimal value and thatâd be 2 bread
Or if that was what you needed
đ€Š I knew it was easy lol
I want to display a text line under the players name, how can I do that?
Like the [DRAGON] here
Technically an objective which is set to be displayed below name could work
if thatâs a thing
So, how can I do that? I didnt used spigot for like 6 months, so im sorry if I ask some stupid questions
Packets are generally the go to
But you could do it with real entities and setPassenger
Could I maybe do it with a armor stand? Idk how to use packets lol
Yeah but it might be a bit laggy
but can you modify the y-pos of a passanger ?
it is possible with the normal scoreboard for sure ....
So, how can I do it without packets?
Spawn an area effect cloud an stick it on their head
its 1.8
the title on that server should be clientside

armorstand with marker
but that will stick into the head
i would suggest place them on the head of others via packets
but then the entities on their head will block them so you cant reach them. you will have to redirect any interactions
Is there smth like a setup guide for packets? I never used it
probably many
could you send one to me
https://www.youtube.com/watch?v=42kCLeYjfjE
I wanna attempt something like this as a plugin, and i know protocollib is used for floating blocks because furniture plugins use it as a dependency
but where can I find more info on how to create floating blocks and rotating/positioning them using protocollib?
not sure if its laggy though considering its probably a ton of armour stands
why when I break a block and try to drop terracota this message getts spammed: ```java.lang.IllegalArgumentException: Cannot drop air
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:git-Paper-103]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.level.ServerPlayerGameMode.destroyBlock(ServerPlayerGameMode.java:400) ~[?:?]
at net.minecraft.server.level.ServerPlayerGameMode.destroyAndAck(ServerPlayerGameMode.java:354) ~[?:?]
at net.minecraft.server.level.ServerPlayerGameMode.handleBlockBreakAction(ServerPlayerGameMode.java:238) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handlePlayerAction(ServerGamePacketListenerImpl.java:1745) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.handle(ServerboundPlayerActionPacket.java:34) ~[?:?]...............
code:
"Cannot drop air"
did you even try to create a scoreboard-objectile as dummy and set it to BELOW_NAME ?
for(int i = 0; i < allValuesArray.length; i++) {
if(block.getType() == allValuesArray[i]) {
System.out.println(random.get(i));
block.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(random.get(i)));
}
}```
in block placed
nope, I did not started with the plugin yet
this will force the health at the end
not as dummy
wow
well you probably drop every item miencraft has ?
random is a hashmap with Materials and random integers, and I specificly check if the block is air:
you check the block, not the random item dropped
if(Material.values()[i] != Material.AIR) {
int asd = rad.nextInt(Material.values().length-1);
while(takenValues.contains(asd)) {
asd = rad.nextInt(Material.values().length-1);
}
random.put(asd, Material.values()[i]);
takenValues.add(asd);
}else {
System.out.println("hi!");
}
}```
with getType().isAir() ?
there are 3 different "Airs"
Any java developers which would be ready to help me with learning java?
?java
?api
hmm
?learn
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
close
help lol
just add "" between the int and the chatcolor
toString the ChatColor
thank you
No need to add random empty strings
Okay, could someone explain me how I can register the scoreboard for everyone? I didnt used spigot for a while lol
thought you want custom titles
in that case just register a new objective with health criteria
but is this for items?
yep
block entities?
Mhm
then its not useful in my case, i want to save color chat config
not offical
Whatâs not official
the PDC for blocks
tile entities ^
ah
Mojang calls them block entities
i know i can use json or db, but
Arenât you saving to a player
i think might be an easier way
but pdc is for items but can it be used in players?
Items, entities, tile entities, and chunks
hm ok
huh I must say that I made a random item drop plugin, and I must say that the code can confuse you very quickly
wasnt there smth that let you implement the persistentdata - methods in your class and deserialize it with it and so on ?
What?
oookey srry i didnt understand u
i love u now
xD
something that allows you to directly convert your class into persident-data and back (serializer and deserialize)
what is the proper thing to cast a sweet berry bush to so i can access its growth stage methods?
awesome, ty
Does anyone know if permission groups are a part of Bukkit or just the permission plugins?
permissions plugins normally do all that
Spigot does have the permissions.yml
Ugh that's annoying. I wanna link in permission groups in my plugin. Is there any handy way of doing that or just write code for any potential perms plugin they may use?
I do recommend a permissions plugin like LuckPerms though
You know how in the essentials chat plugin, you can do a chat format based on a perm group name? Kinda trying to do that
Vault
^
Oooohh thanks
heyy, how would i add custom player heads, like using uuids to get any possibly any head out there
Yes
just use skullcreator
thats what ive been using. It's only 1 class too https://github.com/deanveloper/SkullCreator/blob/master/src/main/java/dev/dbassett/skullcreator/SkullCreator.java works for 1.18.1
and for legacy
hmm cool stuff
fix 'aaaaaa'
ah yes
sound1.equals(sound2)
Caused by: java.lang.StackOverflowError
at java.lang.invoke.BoundMethodHandle$Species_LL.<init>(java/lang/invoke/BoundMethodHandle$Species_LL) ~[?:?]
at java.lang.invoke.BoundMethodHandle$Species_LL.make(java/lang/invoke/BoundMethodHandle$Species_LL) ~[?:?]
at java.lang.invoke.BoundMethodHandle$Species_L.copyWithExtendL(BoundMethodHandle.java:253) ~[?:?]
at java.lang.invoke.LambdaFormEditor.bindArgumentL(LambdaFormEditor.java:475) ~[?:?]
at java.lang.invoke.BoundMethodHandle.bindArgumentL(BoundMethodHandle.java:97) ~[?:?]
at java.lang.invoke.MethodHandles.insertArguments(MethodHandles.java:5161) ~[?:?]
at java.lang.invoke.StringConcatFactory.prepender(StringConcatFactory.java:634) ~[?:?]
at java.lang.invoke.StringConcatFactory.generateMHInlineCopy(StringConcatFactory.java:543) ~[?:?]
at java.lang.invoke.StringConcatFactory.makeConcatWithConstants(StringConcatFactory.java:358) ~[?:?]
at java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:99) ~[?:?]
at java.lang.invoke.CallSite.makeSite(CallSite.java:315) ~[?:?]
at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:281) ~[?:?]
at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:271) ~[?:?]
single alias in commands.yml
caused a memory leak
cant see memory leak... just stackoverflowerror ^^
thats not a mem leak
memory leak is where memory is "leaked" and is kept locked away in wasted objects
nothing to do with an error
well leakage occured in stack memory
duh
im not mentioning Java Stack object here

Stack: The role of stack memory includes storage of temporary data when handling function calls
How stack collision with heap is not an memory leak
Hmm
ofc it could collide naturally but in this case its a memory leak
Just catch the error⊠solved
i think your problem is not the "memory leak" its more the stack overflow that causes a memory leak - but thats still not the exception you get ...
lets just end this bs topic, i feel like Dwight from office trying to debate stupid stuff, which no one cares
i found my problem anyways. Solved
how do I force the player to click?
You can call swingMainHand
how
how can i make a player run a command
How do i get an object for a sweet berry bush? Someone said to cast it to ageable but its just saying its not castable to that. Does anyone know the class I should be using please?
Player#performCommand
Player#swingMainHand
Cast Block#getBlockData
ok ty, ill try the bd.
T-t-triple kill!
kill confirmed, its working now. thanks.
where can i find the jar that gets built from my gradle project?
I have Plugin.getConfig().getString(âur momâ) saved as a var, but when I try to use it in a method, it says Cannot use non-static field in static contex. What does it meeeean
Plugin is not a reference to your main plugin class
Its in my main class. The actual line is this.getConfigâŠ
then its impossible for you to have that error with that code, unless you put it in a static method
But thats what i dont get
No matter waht i do, the err is there
Nothing is static either
?paste the method
?
Your var is static or the method is
and no one can advise you further unless you show some actual code.
He clearly knows better than us, so heâll eventually manage just fine for himself
How may I get rid of the face symbol thing when I use symbols? https://gyazo.com/f07ae7941a1f25089cf46cd334f95772
you could just remove it in your code ....
It's not in my code
and how do you write it ?
I get a message through a string list from the config and send it in chat
well the problem could be the config
location.getBlock().setType(crop)
setType uses a material
yes... and a crop like carrot or potatoe is a material too
doesnt store the data tho
if you set the type you can modify the data after that with block.getBlockData
and how do i do that
location.getBlock().getBlockData() ?
ya but how do i get the block data
your question is bad
you want to modify the age of the crop with the blockdata right ?
yeah
Ageable age = (Ageable)block.getBlockData()
age.setAge(1..2..3....)
block.setBlockData(age)
quick question will getAge return 0 if the block is broken
if the block is broken you will get no ageable data
which will be?
Ageable age = (Ageable) b.getBlockData();
if (age.getAge() == 0)
if the block is broken
before this gets ran
it will probs either return null or throw an error
so i should check if the age is null
if the block isnt a crop you cant even get Ageable-Data
How to send actionbar?
if the block is broken the block-type is already AIR
version ?
1.18
okay so I check for <age> and see if thats null
player#spigot() has some stuff for that
you cant check if a block is broken with the age
Yea I looked it up but it wanted to use "ChatMessageType.ACTION_BAR" but I assume I have something missing as I can not import
not rly... if location.getBlock() is called there cant be a block that == null
is it possible to do without bungee?
bungee is default provided by the api ... there should be no error with this
Block#isEmpty
no
i would say CAVE_AIR and VOID_AIR is also empty ^^
1.18 ?
yes, but if you use isEmpty you dont have to deal with that stuff
1.18.1-R0.1-SNAPSHOT
if its just outdated ok
probably not using maven/gradle and imported the wrong jar
read the damn release post
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar (download), or the contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
alright
md_5 you should waste your time in that: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/685/overview
and not here positing about wrong jar import đ
That PR is just a lot is all
Can u make custom item Id using plugins
Fixed it, sorry for my troubles
No. The client won't understand it
Wdym
If you register a new item on the server, how do you expect the client to understand what that item is or how to render it/let it behave?
;p
In comes client sided mods. Forge, Fabric, etc.
Well it is possible with Enchantments I think
Hello, I want to create a plugin for 1.18, but imports don't work for the 1.18 jar file. When I import another version (1.17), the imports work, but they don't with the 1.18 jar. Any suggestions on what to do?
the only problem is that the client doesnt have a method to accept custom language-file-settings... with that the server could tell the client how to translate "customenchantment:glowing" into "Glowing"...
Nevermind, figured it out
Resource pack
not simple enough
yeah yeah^^ i dont have a problem with this just pointed out whats the problem with custom enchantments is
i remember this not work with custom enchantments... i see the item with not lore for custom enchantments
but i can add more levels
Weird
I guess the client just yeets the lore because itâs not a registered enchant, whether you localize it or not
yeah i think is like this.. many time since check NMS for try make support for this
anyone know if it is possible to enchant an head ? (to see the glow effect on)
its like set a item "glow" (its hardcoded in client side for item)
yes, maybe with unsafeenchant
Yo, I got this board.getTeam("lastdeath").setPrefix(ChatColor.translateAlternateColorCodes('&', "&f" + PlayerUtil.getLastDeath())); that updates the scoreboard, but when I update it with a player name, it says its above the char limit of 16 when thats not even possible. It's 1.8.8
how you added the enchant?
.addUnsafeEnchantment
:(
printed out PlayerUtil.getLastDeath() and it just returns the player name, nothing else and its under the limit so im not sure why it kicks for char limit in scoreboard
you ccheck the length of ChatColor.translateAlternateColorCodes('&', "&f" + PlayerUtil.getLastDeath())? or only for PlayerUtil.getLastDeath()
I have no idea why is it not working
wait
ill send full screenshot
This is Config.yml -
Only the last one, the other one just sets the color for it
check the first.. the translate its like a replace then the length change.
it goes well in for, but not working if condition
hmm maybe its better use a data.contains(entityType.toString()) or check the values
I did ChatColor.WHITE + PlayerUtil.getLastDeath() instead but still gets kicked saying it uses 18 chars instead of 15 which is the lenght of the player name
fixed it, its white either way without chat color
Guys, is there any good API for spigot Unit testing? For now i'm doing tests by overriting spigot components but it's not very efficient approach
MockBukkit
Isnât there another one too
thanks for quick response
MockBukkitPaper?
Something by mini
Thatâs for integration tests
Ah
Ya bit different
for integrations?? what's the name of that api?
and you check data is not empty?
Data might not empty, because loop is working
the for in data its not necesary.. and you debug what print in entitytype and the data values?
So I have two plugins in one
Ones a bungee and ones a spigot
How could I access the plugins BUNGEE config.yml through the spigot side of the plugin?
Any help would be appreciated, thanks.
Yeah in bungee its smtng similar
lmfao i forgot to take new build file in server file, Thanks for your answer bro
Hey, would you be if we can assign multiple metadata to an entity?
Yes
How? I did not find. By assigning it several like what if?
You need a different string for each
So, if I do that it's good ?
Should be
It's good thanks
dose anyone want develop a network Minecraft server together dm if you want do something like that just please know how to speak English a little đ
?services
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/
is there some event when an anvil lands on the ground?
is there an event that fires and returns something like "PLAYER STARTED BREAKING" "PLAYER FINISHED BREAKING" "PLAYER CANCELLED BREAKING"
Only for finished breaking, BlockBreakEvent
PlayerInteractEvent, BlockBreakEvent
anyone know how i can make a custom head?
Please what? What did I do?
choco plz
đ« plz
who pinged me 
@hybrid spoke
@unreal quartz

Does anybody know how to build TacoSpigot? I know it's a depreciated mess but I need it to build a plugin.
It says it's missing a module
We arenât tacospigot
yes but block break event doesn't fire when the player starts breaking blocks. it only fires when it is done
Blockdamageevent
oh, didn't notice this exists. thanks
anyone know the quick way to hide things like
"+2 defense"
or whatever from an item
i forgot how to do it
last time i remember though there were like a few ways that were outdated and its plagued with old fixes
Hideflags
How can I modify arrows created with LaunchProjectile?
ty
also does anyone know how to check if an item's durability is at max
feel like this is also something thats changed sicne like 10 updates ago
nvm Material.getMaxDurability() exists got it
how to I like wait for 5 seconds, but keeping the server running?
scheduler
anything other than a scheduler?
why
LaunchProjectile returns a generic type
because yes
Thanks
A good answer, clearly.
java.lang.ClassCastException: class me.cwickks.firstplugin.Listeners cannot be cast to class org.bukkit.plugin.Plugin idk if im being dumb. but, how do I fix this?
I placed a bukkit scheduler inside a listener class
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I somehow managed to fix it by myself by getPluginManager().getPlugin("firstplugin")
I suppose that works
is it optimal tho?
No
Dependency Injection would be 100% more efficient and better than this.
im confused about dependency injection
Did you read that link the bot sent?
As it also gives examples of how to use it.
yes, and im still confused
About what bit?
The Setting up dependency Injection section on that link explains it and gives a few examples of how to use it.
do I need to create a new class in my Main class?
A class in your main class?
a custom class that I can access in another class?
No that isn't needed.
public class FancyLogger {
private final JavaPlugin plugin;
public FancyLogger(JavaPlugin plugin) {
this.plugin = plugin;
}
public void logRed(String s) {
// accessing JavaPlugin's logger
plugin.getLogger().info(ChatColor.RED + s);
}
}
``` That literally shows what to do @gentle oriole (example from the guide)
Just read over the 3 code snippets it shows in the guide and add it for your plugin
and this is why we don't skip the basics when learning đ
To be fair âdependency injectionâ does make it sound complicated m
what was shown is basic OOP
Yes
there is indeed far more advanced DI
g o o s e
j u i c e
g u i c e
to be fair I am pretty sure it is pronounced like juice XD
Now I have the urge to make a super basic injector just for plugin instances
Just annotate a field with something and then pass an instance of that class to the injector
how do i restrict a command to only operaters
Give it a permission and only give the perm to ops
where do i do that
Or you could check isOp if you want to be messy
You can add permissions in the plugin.yml
And assign them to commands there as well
what is the operator permission called
Set the default for the permission to OP
i have permission: written in the plugin.yml but what do i put for the permission
what do i refer to op as
permissions:
essentials.*:
default: op
description: Give players with op everything by default
That's an example
admittedly i couldâve added more comments when i wrote that example for the wiki, since itâs not too clear why itâs done that way
I find that https://en.m.wikipedia.org/wiki/Dependency_injection this explains it decently as well.
but it's a lot more reading đ
is there is any module related to armour stand?
Module?
yah
whenever i write a code related to something my IDE Imports its modules for me
idk why its not happening for armour stands
Modules?
PLS GIVE ME RESOURCE PACK LINK
You mean classes?
Just type ArmorStand and your ide should find it
delete the d
suppose i type creeper it import its class
I believe itâs org.bukkit.entity.ArmorStand
but its not happening for armour tands
thx
