#help-development
1 messages · Page 713 of 1
how can i add hex color?
and is there a way to keep their food level at max?
You can cancel FoodLevelChangeEvent
My idea would be that it is some optical illusion caused by perspective BS. But that would be some huge effort for something small
How can I change methods and apply changes without reloading plugins, is there any tutorials?
In my ide
I wanted to know, when I create a dependency on an api, should I write down the name of the api class in this place or what? I just use this api - https://www.spigotmc.org/resources/✅-api-player-npc-✅-1-17-1-20-1.93625/ - and I would like to specify it in depend and also get it through the plugin manager
hey
ok
does anybdoy use deluxehub
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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Hey, I'm making a minigame plugin. I have a GamePhase interface, which different game phases implement.
Is it generally better to have one event listener of each type in the "listeners" package, or have separate event listeners for every phase implementation?
Just do it monolithically like a true idiot
look at this https://github.com/Archived-Repositorie/Mods/tree/main/src%2Fmain%2Fjava%2Fcom%2Foresfall%2Fwallwars
just don't copy
Latter
I’d say, I like to isolate listeners per functionality/module
Right, ty! Registering multiple event listeners for the same one doesn't matter performance wise right
nah
Good start
Each phase should track its own event handlers and tasks
And just make it an abstract class that contains some collections n stuff
Would it be bad to just have one task in my phasemanager class that upon every tick does GamePhase#onTick?
no thats the way to go
I call mine PhaseChain
which plugins should i download on my bungee lobby?
both aren't good suffixes
fuck off
And how do you handle conditions for switching phases? For example, when a player gets a kill, I want it to switch to phase foo, and when the tick value is over 40 (2 seconds have passed), I want it to switch to phase bar
Should I do all this logic in the onTick method of the gamestate class?
The way I have it is that phases are linear
no, the gamephases dont know each other
So there's only 1 active phase
they should be independent from each other
Yeah
you could give it a state
or use a predicate to give them a condition
and in your manager you check if that condition has been met
or the wanted state has been reached
then go next
👍
you could also do some kind of linking and give it a parent
The way I have it is just an End method that the state calls itself
That just yeets to the next
yeah exactly, symbolize a state
If you're clever you can make a MultiState class that starts multiple states at once and once they're all done it advances

elaborate
The whole state system is really neat in lots of places, not just minigames
I grabbed the whole state system and made a story/quests plugin out of it
So I can do stuff like this
You can make a MultiState class that only proceeds to the next state
if all sub-states are done
lets you paralellize a bit
Ehh
or refactor the HaveItemObjective to support multiple
Sure that would render this MultiObjective useless
But I'd rather just stick to simple checks
how does it check
is it on a scheduler or just listens to any of the potential events
This seems limiting, how many params can multi obj have?
Seems like the perfect spot for a builder
varargs bro
yes
Never heard of var args
It's the
Objective... thing
that gets converted to an array
You can pass as many args as you want and it makes an array
You can also just pass nothing and it makes an empty array
Got a link to documentation of that practice? How have I never heard of this type of param? Lmqo
public void doWhatever(String... lines) {
for(String line : lines) {
System.out.println(line);
}
}
doWhatever() is valid
doWhatever("one", "two", "three") is also valid
most languages have varargs
Oh shit its that ... that does it?
super useful
yeah
Huh neat.
It allows for stuff like List.of to work
infinitely
And if you want to avoid the first case
You add a mandatory first param
Like this
public void doWhatever(String first, String... lines)
Hmmm, think i feel more conftorble with a constructor imo, as you can pull the collection from elsewhere and loop the right method from the builder
problem with that is you cant pass an array anymore
yeah just collect it to one thing
i wish java had list comprehension like pyhthon
would be nice
public Whatever(String... lines) {
this(List.of(lines));
}
public Whatever(List<String> lines) {
...
}
Yeah I dunno gonna have to look up pros and cons of both before I dive in and use it
Varargs literally converts the result into an array
theres no downsides to varargs if used in the right usecase
its just a quality of life thing
Ahhhh no there is. Can't have more than one var args in a method
Builder gives the same functionality to class constructors but for anything that needs to be initialised via a param
yeah wouldnt adhere semantically if oyu could
I can see the appeal of varargs and where to use it.
Construction methods ain't it for me tho imo
this doesn't run anything on the constructor ¯_(ツ)_/¯
But I'm not going to make an objective builder
The same way I'm not making a phase builder for my minigame stuff
It just doesn't make sense
Each to their own haha.
I try to do builders on stuff that has multi fields where I can so I can just have a factory and forget lol
Makes multi arg commands thar have an end product a piece of piss haha
I do have a command builder
Ayeee
Used to be a class for each subcommand before
Currently rewriting my SQL wrapping library and think I'd die if I didn't have a credentials constructor lol
but I wrote the builder like last week
But yeah here's context
I could write a parser
but I'm not being paid enough for that
blud doesn't like orange
Lmao
I just prefer the whole 'write once and forget' approach. If u needed to change objectives for say story step, or allow for custom user made objectives , gonna be a bitch to do
Just imo ofc
And we're starting small with like 3-4 but we'll increase to like 30+ in the future
20$ each that's 600 bucks
Making an objective takes a couple minutes
My man I'd set it up to be as easy as hell to make a new one.
Multi objective stories i forsee becoming a pain in ur ass in the future 😭
Customer wants it to be linear
Keeping track that is
It's surprisingly robust
Hey fair cop man
God I wish my customers were so chill 😭
To be fair that customer likes to bargain a lot
Spent 5 hours forking their world gen yesterday
Adding some BS structure from another plugin
Ew
It's like a waystone thing
Tbh I need to get my team out there more lol
Had to write checks to not spawn it in trees n stuff
I get these projects because I put the work in, and do it right
Wrote like 9 projects in 2 months or whatever
Fair cop
You can just create compound objectives
Probably
shrugs what works for you lad legit.
WaitForeverObjective that must be manually overriden with commands
For stuff like tutorials or integrating with other plugins
Huh neat.
I'm just hype to get my new database wrapper done so I can finish my portals plugin project :L
:L
Still testing and fixing my Command Engine V3™️ so I can uhh
do my skyblock stuff
Lot of work this week
bit sad that I couldn't buy the office equipment that I wanted today 
Yeah I rewrote it so it could easily be implemented to other databases without rewrite. More interface based like
Kotlin :D
Get that thing out of my sight 😭
❔
Lmao
The one I'm excited for the most is I took smiles modern inventory menu idea and set it up so the same base can be used for custom inventories too :L
Mans flexing
Always flexing 😭
One thing I still need to do is getting tab completion to work on minestom
I pray I don't have to use packets
Their command thing is weird
Ewwww why minestom?
We're using it at work and it's a platform I'd like to support on my skyblock stuff
But like.. why?
speaking of work it's time to clean up whatever mess the team made
looking at you in particular, chat commands
🎵Put that shit code back where it came from or so help me 🎵
What's the context
uhh
we ported our codebase to minestom because we were tired of all the shitty hacks we had to do
Straight-up not worth it
And the dude that did most of the work just uses chat messages for commands instead of the command system
Yeah minestom is probably nicer if you actually care about shit
Mye
Huh fair
can someone help me update my minecraft plugin please?
i changed the version to 1.20.1 but it doesnt work in the server
the code doesn't show any errors
Then there is a very high chance that the plugin never worked in the first place
ItemStack ironHelmet = new ItemStack(Material.IRON_HELMET);
ItemStack ironChestplate = new ItemStack(Material.IRON_CHESTPLATE);
ItemStack ironLeggings = new ItemStack(Material.IRON_LEGGINGS);
ItemStack scoutDiamondBoots = new ItemStack(Material.DIAMOND_BOOTS);
scoutDiamondBoots.addEnchantment(Enchantment.PROTECTION_FALL, 1);
ItemStack stackOfPotions = new ItemStack(Material.POTION);
PotionMeta potionMeta = (PotionMeta) stackOfPotions.getItemMeta();
potionMeta.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true);
stackOfPotions.setItemMeta(potionMeta);
stackOfPotions.setAmount(3);
// Equip the armor
player.getInventory().setHelmet(ironHelmet);
player.getInventory().setChestplate(ironChestplate);
player.getInventory().setLeggings(ironLeggings);
player.getInventory().setBoots(scoutDiamondBoots);
// Give the items to the player
player.getInventory().addItem(
diamondAxe,
diamondPickaxe,
stackOfPotions
);```
yo , line that says "new ItemStack(Material.POTION)" , any ideas how to make that a splash potion? replacing it with Material.SPLASH_POTION just crashes me (error [plugin] generated an exception
java.lang.NoSuchFieldError: SPLASH_POTION)
1.8.9 , couldnmt find anything online
You need to compile against 1.8.8
death himself
Hello, comparing branches in SpigotMC Hub is unavailable?
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/compare
500. Oops, an error occurred. Please see your system administrator.
Hi! I'm trying to work out how colours on note particles work. When I set:
offsetx to 0.5
offsety to 0.3
offsetz to 0.5
speed to 0
count to 2
it spawned only green notes, but when I set speed to 1, it went multicoloured? what's the significance of speed and what does it do in respect to note particles?
bruh it did work i made it
speed is prob 0-1 from green - red
it just said "Failed To load PlutoAddon-2.0 from plugins"
Just make a simple command
Yeah these are random
hmm
I wonder if there's a way to spawn them of a specific colour, and if so, what the range is
oh interesting
ig ill have to sacrifice offsets and do it manually then, thanks
thatll be it
Is there any way to send a packet to change the player's current biome? I am trying to add a custom biome to a custom world but the BiomeProvider class doesn't allow custom biomes. If there is any other easier way to do this please let me know
I would recommend a datapack with custom biomes.
I am using a datapack for the biome
but I use java for the world generation
Actually I got another idea
are there packets for changing the Sky and fog color in 1.20?
basically what biomes do
or is that client-sided?
That I believe is client-sided based on the biome, weather or bosses
I do not believe the API has a way to set custom biomes
But you could dispatch a fillbiome command, but only if you're really desparate :D
well rip I guess. Thankfully it's not too bad. What I am doing works well without different sky and fog colors. It just looks a little out of place
?paste the scoreboard section
You can change biome with packets, yes
I don’t remember if it’s still part of the chunk packet or if there is a new packet for it
Be a damn hero and make a small pr with a new enum to be used as a parameter in the constructor 💪
Does anyone know how to change the numPlayers in the ServerListPingEvent?
If you were replying to me then yes there was a plugin that changed the sky color but it stopped working in 1.17 I think
well if it worked before it will probally work again. They normally dont remove features they only rename them
making the functions depricated
but most of the time theres an alternative
The plugin's last supported version wasa 1.16 and it was updated last year so I am pretty sure that if it was still possible they devs would have updated it
also datapack biomes changed a lot of the sky color code
so it makes sense that it would stop working
as far as I know currently the only way to have custom sky color is with custom biomes
Hey newbie question here
Why do people tend to use armor stands alot when making custom mobs and such?
depends
first of all they dont do shit on their own and dont have an ai
Hey guys, for some reason this is compiling in java 19 and it needs to be java 17. Does anyone know how ican change that?
nvm
I just needed to do a clean and reload
Hi, i am currently kicking players that dont accept my server ressource pack, but when a player try to reconnect and dont have accepted, he is instantly kicked.
How to ask again to players to accept texture pack ?
do a clean and a reload
🥺
👍
how to send clickable message to player?
TextComponent
?componts
String message = "Click me to visit our website!";
String command = "/your-command-here"; // Replace with the actual command or link
// Send the clickable message
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "tellraw @a [\"\",{\"text\":\"" + message + "\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"" + command + "\"}}]");
@kindred sentinel
@worldly ingot add now
?components
sadge
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
that isnt needed
dude player.spigot is ancient
What am I adding?
?????
no it isnt
It's current API, wat
Thanks!
😉
?components command
oh
use the component api
i know
it's tellraw command
TextComponent is also ancient
And?
It... it isn't ancient...
So is player, but we use that just fine
you talking about the fact its 1.14 bungee api?
Deprecated = bad practice
It's not deprecated
You're probably using Paper
you shouldnt be using tellraw in paper either anyway
Yes, the class TextComponent in Bukkit has been deprecated. According to the deprecated list for Paper-API 1.18.2-R0.1-SNAPSHOT
I think your right EpicEbic
My bad
and how to do like two hover clicks in one message? like
[Yes] [No]
'sendMessage(net.md_5.bungee.api.chat.@org.jetbrains.annotations.NotNull BaseComponent...)' is deprecated
Do not use player.spigot
component builder
thats once again paper api
Paper deprecates anything Spigot component related
They have Adventure
If you're using Spigot then you can use the component API
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
Seems we don't have API for it. Paper does, but I could have sworn we did too
Maybe in 1.20.2 when those client settings are sent in the configuration phase I can expose API for it
using component builder or append 2 components together
They have a config change event
PlayerClientOptionsChangeEvent
Then you get getSkinParts()
Choco prepares to write a PR
on his gfs computer
I don't actually like the way they did it tbh
I didn't. Javadocs
It isn't. Only way you'll get it is via event then store it somewhere
Man is still with the female? Smh fake programmer
Until Sunday, yeah
not even a candian female
i can't do "player.spigot().sendMessage(ComponentBuilder)"
call create() on it
Looking forward to .build() 🤞
thanks
For a ComponentBuilder it does
It does??
mhm
https://github.com/SpigotMC/BungeeCord/pull/3490 adds #build() and simplifies things to a single component, yeah
After that PR gets merged it will be the preferred way to do things
usually that would be the convention
but it uses create atm
just a few prs on that
Less than on Bukkit 😄
doesnt github stuff also include issues though
Nah they're separate
Just gotta remove the is: filter
yeah, what i meant was github prs had total issues and prs, not justprs
while stash uses just prs for the number
does someone know how to get the nms version of bukkit itemstack?
CraftItemStack.asNmscopy
i don't have craftitemstack
It's a static method, but if you don't have it then you're not depending on the server, you're depending on the API
Why do you need an internal item stack?
i think that'll work, but let me check
because protocollib sucks
That didn't really answer my question lol
alright thanks so much, that works
can custom durability be hacked or it needs workarounds (like tracking it myself)?
You need to make a custom system. Durabilitiy values are hard coded.
🥲
I think its like 18 iirc
is PlayerItemDamageEvent enough to track?
?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/
But acceleration doesnt work like that in mc
im worried that plugins modifying the durability can break the item too early
yes
Does any dev want to help me with a project? I pay
Is simple plugin
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/
ok
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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
If I have to kill a group of players when server stops, is it alright to do that inside onDisable method?
Nope, clients are kicked before plugins are disabled.
So it would be better to store these players in a file and kill them on their join?
After restart
Depends on what you are doing
can i destroy an item without knowing what inventory has it?
Myea. You can set its amount to 0.
But keeping a reference to an ItemStack is often a very bad idea.
I have a minigame plugin. When players join this minigame, they are teleported to the special location (they should not be allowed to get there in any other way). I want to kill them in case of sudden stop of the server
And this location is not always the same
Then as soon as you throw them there, just add a pdc tag to them and check it when they join again.
Not sure if you really want to kill them or simply set use the spawn location event to put them back.
^
this is code i made to be like a rope physic. it works but when i get near it it slows down, i can see why but is it possible to make it like just swing back and forth ?
Vector cableAnchorPos = new Vector(loc.getX(), loc.getY(), loc.getZ());
Vector playerPosition = player.getLocation().toVector();
Vector pendulumToPlayer = playerPosition.clone().subtract(cableAnchorPos);
double pendulumLength = pendulumToPlayer.length();
// gravislay
Vector gravityForce = new Vector(0, -9.81, 0);
// multiply by pendulum length to make it more realistic
gravityForce.multiply(pendulumLength);
// normalize to make it a unit vector
gravityForce.normalize();
// tension force is here because the pendulum is not a rigid body
Vector tensionForce = pendulumToPlayer.clone();
tensionForce.normalize();
tensionForce.multiply(-1);
tensionForce.multiply(gravityForce.length());
Vector total = gravityForce.clone().add(tensionForce);
player.sendMessage(Prismatica.prefix() + " Pendulum force: " + total.toString());
player.sendMessage(Prismatica.prefix() + " Pendulum length: " + pendulumLength);
player.sendMessage(Prismatica.prefix() + " Pendulum force length: " + gravityForce.length());
player.sendMessage(Prismatica.prefix() + " Pendulum tension force length: " + tensionForce.length());
player.setVelocity(total);```
You'll need to run that on a scheduler
its looping every tick already
This cant be the whole method. Rope physics are pretty complex. Make it a rigid pendulum.
can i send a video lol
im verified on my other account but not here
and my other one was d1sabled
can i dm you the video @lost matrix
can you call event.isCancelled to true, then to false, and it will still happen?
yes im doing some dumb logic sue me
Nah im cooking atm
Yes
You can un-cancel events. You can even use a completely different listener with a higher priority to do taht
eh
if(!(event.getRecipe() instanceof ShapedRecipe recipe)) return;
if(!(recipe.getKey().getNamespace().equals(Echo.namespace))) return;
if(!(event.getWhoClicked() instanceof Player player)) return;
event.setCancelled(true);
its not about priority
its cuz the event here converts the recipes from a 'you cannot' architecture into a 'you can' architecture
let him cook
this is what i ahev rn
the particles are verlet integration
Increase the length of the vector which is normal to the rope
really?
I'd divide it by 20 because vel is measured in ticks
which vector
might screw with your tension force
Negating the gravity is also a great idea
like Vector gravityForce = new Vector(0, -9.81 / 20, 0); ?
which vector
just try stuff
uh
is there any way to identify a recipe that doesnt involve caching the original
cuz if no i've have some fun mapping to do
Recipes have a namespace key
yea on declaration
@echo basalt well yeah, dividing grav by 20 makes it look smoother but it doesnt fix th way that it stops halfway and doesnt continue the swing
scheduler time
huh?
Apply a vector on a task
why cant i declare a class abstract final if all i want from it is a place to store a static method
like the whole thing reversed lol?
How can i get this to load?
I successfully ran BuildTools (--remapped) and got not error when doing so.
But now this is still red, idk what to do?
?nms follow this guide
That's why I hate both Maven and Gradle 👍🏼
They sometimes don't even work as I intend
they do if you use them right
thats what i did
this is the plugin in maven
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
?paste ur pom
here, the whole pom https://paste.md-5.net/gobehosoka.xml
you using intellij?
Nope, works fine in IntelliJ, tried porting it to Fleet and there it's red, even after running BuildTools
or its just not checking maven local
if it works in ij, probably better to just use ij
hi, i was wondering to get a simple explanation about player nametags. Those below player name
By default, you can only have a number, then a short text. Like 1. LvL. The number will always be white, the text can be coloured.
And it is managed by scoreboard objectives.
If you mean the ones that do not contain numbers before any texts, those are made by TAB, which is a plugin.
Right, thanks
cant seem to find these, is there a potion effect or what effect is used when someone falls through snow?
declaration: package: org.bukkit.entity, interface: Entity
Yeah I think at like 80 ticks they start taking damage
It will also decrease every tick so keep that in mind
Oh, well, getMaxFreezeTicks() lol
it resets before it gets to 80 ticks i am having another method control the damage, i just wanted the overlay creating a sleet storm
Does Spigot have some sort of API to connect to their plugin database? Im working on a addon for pterodactyl panel
Thanks
Anybody know how I can get the coords of a map cursor from the map item?
Might be this one but I'm not sure https://github.com/TheSilentPro/SpigotClient
has anyone of yall ever used ProtocolLib
yeap
just to confirm, do i use "$_GET https://api.spigotmc.org/simple/0.2/index.php" to get it?
in php
or am i sstupid
im pretty sure you cant download with that
how do i Initialize ProtocolLib's ProtocolManager
everything i find seems to be outdated
I doubt it's changed
well then i might just be stupid
or all the things i find never did work
how complicated is it to send an actionbar in 1.8 without using a library
Does player.spigot().sendMessage() not have a MessageType enum in 1.8?
Was that a 1.9 addition?
well if i have done my research correctly no
thats why i wanted to use protocol lib
or something similar
Well. Perks of 8 year old software ¯_(ツ)_/¯
not at my state. i have way to little to show of myself to decline offers and i really need the money xd
public plugins help and just random github projects
RE: this I believe it's just ProtocolLib.getProtocolLibrary(); or something like that
Just do it onEnable(), not on class init
https://imgur.com/dyayRhz just found your 6 year old command about it d
thx
^ important
Will be null in a field
alright thx for the heads up xd
how should i download it then?
iirc you can download normally with just the id and version number, choco confirm that for me
I don't think you can download with spigot's official api don't you have to use spiget for that
could you do an example? in php
i mean technically just use tthe same link we would download by, eg https://www.spigotmc.org/resources/simplechatgames.108655/download?version=496667
and it works id only, https://www.spigotmc.org/resources/108655/download?version=496667
just tested that lol
mmm you'd need to bypass cloudflare for that not ideal if your botting
if you're just using some normal downloads though should work fine
cloudflare is only there because people bot/abuse it lol
who wants to abuse spigot downloads kek
You'd be surprised
even chocos?
especially chocos
?components
For hoverable, clickable, hex colored, or otherwise complex text, use the component API. Documentation can be found here:
https://www.spigotmc.org/wiki/the-chat-component-api/
someone?
In php you would use something like curl
But since there is cloudflare you are going to have to mess with some headers
has anyone ran into issues with not being able to pull the changed result out of an anvil?
I'm making it so you can enchant an item that isn't normally enchantable and it sets the result but it just won't let me take the item out.
Does anybody know how to get a MapCursor from a map item/MapMeta? Trying to detect treasure coords from a buried treasure map, if there's a smarter way to do that let me know
I don't think you can. Those cursors are only accessible from the map renderers iirc
Yeah, that's what it looked like from the time I spent reading the docs, figured I'd ask just in case anyone knew better
Any better way to get the coords of a buried treasure you know of? I'd like to have something for players to be able to find the treasures without having to dig around but I don't want to just make a chest detecter because it'd be way too OP
So I'd have to do something like check if the nearest structure is buried treasure, then get the coords if it is?
go away epic
I think you can specify the type to that method
Uhh no
You locate the nearest buried treasure
Alright, is the provided location the exact chest location or does the game do some randomization stuff
Probably where it pasted
So like
Not really
Let's test
Y level is fucked
but this is where the chest is
yeah it matches the chest
The y level is always 0
ye
If you use the locate command in game it just shows ? Instead
Yeah just tested it myself as well
That works well enough for what I need I guess
Thanks for the suggestion
Should be possible to find the chest if you just lord the chunk and then iterate down from the surface
They are only a few blocks down
Yeah but I'll just leave it to the player at that point, the X and Z are enough to find it
how can i print out a big message on plugin enabling?
like this
You print multiple lines
"--------------------------------------------" +
"" +
" TestPlugin v1.0" +
" by ImYuvi" +
"" +
"--------------------------------------------" +
"");```
like this?
Discord formats this horribly, but notice that you gotta add \n to every line
\n means "begin a new line"
ok ill try
thanks it works
No problem^^ Glad I could help
How can I delete advancements when my plugin starts and reload and then have them create
I got the creation feature down but can't figure out deletion
try ascii art generators https://patorjk.com/software/taag/#p=display&f=Ivrit&t=LP
This is the correct code to check if a player is going to die in a Entity damage event? if(victim.getHealth() - e.getFinalDamage() < 1.0)
why is my gradle doing this
try hovering over the lines, it should tell you what is "wrong"
Hey, I want to determine whether a player is pressing A or D. I have the player's velocity vector and the direction they're facing in, how can I determine what button the player's pressing?
Get the angle between the two and go from there
Well, the angle will always be 90deg if the player is pressing only A/D. How do I determine which button the player's pressing?
Get the Player's Direction Vector, Calculate the Rightward Unit Vector, Compare Velocity with Rightward Vector,
im making a chest refill system and i am having trouble with potions (spigot 1.8.8), potions appear in the list as stone blocks (x1)and nothing after a few hours has been able to fix, any ideas ?
public static List<ItemStack> loadLootTable(String tableName) {
List<ItemStack> lootTable = new ArrayList<>();
FileConfiguration config = plugin.getConfig();
if (config.isConfigurationSection("loot-tables." + tableName + ".mandatory")) {
ConfigurationSection mandatorySection = config.getConfigurationSection("loot-tables." + tableName + ".mandatory");
for (String key : mandatorySection.getKeys(false)) {
ConfigurationSection itemSection = mandatorySection.getConfigurationSection(key);
String materialName = itemSection.getString("material", "STONE");
int amount = itemSection.getInt("amount", 1);
Material material = Material.matchMaterial(materialName);
if (material == null) {
System.out.println("Invalid material specified in loot table: " + materialName);
continue;
}
ItemStack itemStack = new ItemStack(material, amount);
// check for potions
if (itemSection.isConfigurationSection("potion")) {
ConfigurationSection potionSection = itemSection.getConfigurationSection("potion");
String name = potionSection.getKeys(false).iterator().next(); // scuffed as shit but whaetever
switch(name) {
case "speed":
itemStack = Potions.speed();
break;
case "shortRegen":
itemStack = Potions.shortRegen();
break;
case "longRegen":
itemStack = Potions.longRegen();
break;
case "fire":
itemStack = Potions.fire();
break;
default:
break;
}
System.out.println("created potion: " + name);
}
...
lootTable.add(itemStack);
code continues but irrelevant```
!?
1.8 old af
Anyway
Add debug lines to see what is getting called
Also check your Potions.whatever constants
public static ItemStack speed() {
Potion potion = new Potion(PotionType.SPEED, 1);
potion.setSplash(true);
ItemStack potionItemStack = potion.toItemStack(1);
PotionMeta potionMeta = (PotionMeta) potionItemStack.getItemMeta();
potionMeta.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true); // Speed II for 30 seconds
potionItemStack.setItemMeta(potionMeta);
return potionItemStack;
}```
what is the iterator for and why do you only get the first key?
you aren't even checking the value
potion:
speed
that's not a configurationsection
that's just a string with key "potion" and value "speed"
should it be possible to declare more than one potion?
predetermined potions , just speed regen and fire res
It still annoys me how all potions are the same item type
Mojang should have changed that in the flattening
Or at least made water bottle a seperate item
yes
brutal
dr brutus
How do I convert a hex number into a minecraft unicode
If I use Chars Character.toChars(0xD0000) it dose not give the expected result which should be \uDB00\uDC00
Why is that expected
It should be that If I understand AmberW correctly https://github.com/AmberWat/NegativeSpaceFont
I Asked on his Discord and got this response but still it dosen't work so I thought maybe ask here
cheers
btw
thanks again
i was so tunnelvisioned
Seems you answered your own question
similar to sending a title to the player, is there a way to send an actionbar? I mean I am sure there is, since mccmo for example displays "you ready your fists" above the hotbar, but I am not entirely sure how they achieve that??
Use the send message with the type actionbar
oh okay.
ChatMessageType.ACTION_BAR?
try restarting IDEA
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
?components
For hoverable, clickable, hex colored, or otherwise complex text, use the component API. Documentation can be found here:
https://www.spigotmc.org/wiki/the-chat-component-api/
Yes
player.sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("test") );
so this should work ja?
Stupid stuff which wont help
Yes
I wanna know what kind of stuff lul
thanks

'id' in 'org.gradle.plugin.use.PluginDependenciesSpec' cannot be applied to '(java.lang.String)'
what is this
plugins {
id 'java'
}
im not doing anything wrong here
is that kotlin or grovy
it compiles
Then just ignore ig
i'd still use the kotlin-compatible syntax
Groovy
or just use kotlin, superiour anyway
the error is still here
what if you just do it like this
plugins {
java
}
I prefer Groovy Gradle
😱
Kotlin is pain
now its an error
this never happened
well if it works, then it's an IJ issue so report it to them
anyone got an alternative to bossbar api since the maven import does not seem to work anymore
don't use 1.8 
maven import?
not my choice
idk what else to call it
the thing you put in the pom
the repo and dependency
which dependency and which repo
from the bossbarapi: <repository> <id>inventive-repo</id> <url>https://repo.inventivetalent.org/content/groups/public/</url> </repository> <dependency> <groupId>org.inventivetalent</groupId> <artifactId>bossbarapi</artifactId> <version>2.4.1</version> <scope>provided</scope> </dependency>
Nexus Repository Manager
version is 2.4.3-SNAPSHOT and the repo is https://repo.inventivetalent.org/repository/maven-snapshots/
oh thx okay
is there a way to make a block completely immutable? I have a block, currently Iam grabbing events like fire events, explosions, and player breaking, and checking if the subject is the block. is there a better way? to get all cases?
no
well you can listen to all subclasses of BlockEvent, check if it's a cancellable event, and if yes cancel it
lol so what, I gotta catch every event that could physically destory a block?
but you cannot directly register a listener for BlockEvent, you need reflection to get all subclasses
yes
ye
as said, you can easily do it through reflection
cus, lets say the block in question is a chest, and I wanna stop all breaking on it, I could do that with this BlockEvent, but what about if using a hopper? like, could it also block the transfer of items from hopper
the hopper uses InventoryMoveItem
oh alright
well, i tried this:
@EventHandler
public void onInventoryMoveItem(InventoryMoveItemEvent event) {
InventoryHolder sourceHolder = event.getSource().getHolder();
InventoryHolder destHolder = event.getDestination().getHolder();
Location sourceLocation = null;
Location destLocation = null;
if (sourceHolder instanceof BlockState) {
sourceLocation = ((BlockState) sourceHolder).getLocation();
}
if (destHolder instanceof BlockState) {
destLocation = ((BlockState) destHolder).getLocation();
}
if ((sourceLocation != null && protectedChests.contains(sourceLocation)) ||
(destLocation != null && protectedChests.contains(destLocation))) {
event.setCancelled(true);
if (event.getInitiator().getHolder() instanceof Player) {
Player player = (Player) event.getInitiator().getHolder();
// Give back the hopper
player.getInventory().addItem(new ItemStack(Material.HOPPER, 1));
player.sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("test") );
player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_LAND, 0.5f, 1f);
}
// Destroy the hopper block
if (event.getDestination().getType() == InventoryType.HOPPER && destHolder instanceof Hopper) {
Hopper hopper = (Hopper) destHolder;
hopper.getBlock().setType(Material.AIR);
}
}
}
It looks right to me? except event.getInitiator().getHolder() instanceof Player doesn't work
the initiater will be a hopper
oh not the player?
if a player takes out an item through the GUI, it's a normal InventoryClickEvent
InventoryMoveItem event is when a hopper moves items itself
anyone here used bossbarapi before?
Years ago
im struggeling with finding a version working for 1.8
the version mfnalex send in seems to be 1.12+
1.8 is legacy
Too old! (Click the link to get the exact time)
i am aware of that.
It's time to let go son
its not my desiscion
client wants it for 1.8
i prefer newer version too
and dont tell me to decline offers
as if i could afford that
😭
You're looking for BossBarAPI that supports 1.8?
yes
https://www.spigotmc.org/resources/api-bossbarapi-1-7-1-8-1-9-1-10.7504/ been trying to make this one work for ages
but i keep getting a load of console erros that i cant even read
?paste one of them
Because that surely should work
What ckient in their right mind wants 1.8
Ur better than their daft standards fr fr
What version specifically are you on?
version of the api? or minecraft
Minecraft version
1.8.8

ive tried all kinds of repositorys, installing it manually without maven etc etc
nothing works
all the same error
It's the biggest challenge with older apis mate.
I'd be honest with your client and tell them the issues and, with em in mind, tk consider upgrading
Clients like that only tend to get with the times once how make it clear the issues the approach causes
Hey bud imo a client that doesn't care for the issues of their dev arnt a client worth having imo
It's a 2 way street
If "the majority of thw spigot community knows nothing about 1.8.8 anymore" isn't enough, then I dunno what to say
i wish i could see it from that pov but rn im just a poor highschool student trying to make some extra money xd
well alright thx for the pep talk
Nw
Can you run /version and send what it says
hey man
lmao what
its a screenshot of my chat
ai will take over the world
ai:
i wish i could just send normal screenshots in here again but i aint verified yet
how to get HEX code from org.bukkit.Color
i mean
net.md-5 ChatColor class should have an of() method
.asRGB()
You can use it interchangeably with Bukkit's ChatColor enum
is a thingh
i dont think theres i direct hex code but you can convert rgb to hexcode
I want to double check something, what could cause this issue
only happening to some people
Maybe try running BuildTools to get a new 1.8.8 JAR? Honestly not sure what's wrong with it
Could possibly be a paper bug?
yh ill give it a try the test server is older then myself i feel
So then is there a way to get ChatColor.of() using org.bukkit.Color?
.rgb
gets rgb
oh
.asRGB sorry
see like way back I was told it was caused by hostflow malware but I am still not sure about that as an answer
yeah, and?
well once you get that use a normal java command to convert that to hex
I think it's a Paper plugin loader bug. Looks like it's enabling your plugin, then disabling it for some reason or another
i dont know it from the top of my head
oh
I'll go ask paper again I guess
String hex = String.format("#%02x%02x%02x", r, g, b);
last time they said it 🤷♂️
I mean, it dies because it errors onEnable ?
thanks
check their server startup log, if you see javaassist and warnings about ProtocolLib when not depend, its a virus
and yea, javaassist is fucking sus
how exactly do i change my java version again i didnt do it in ages 🧍♂️
javassist do be sus tho
Either define the exact path when you run the command or change %JAVA_HOME%
i tried. now i dont have a single version of java 💀
what 
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
wat
That's because it's -version not --version
oh wait both work nvm
What'd you set your JAVA_HOME to
oh but --version worked when i tested wich one i had installed before
8
and then back to 17
but that doesnt work either anymore
Send what you actually put
C:\Program Files\Java\jdk-17\bin
oh wait what
im convused
i do have 1.8 now
i think
but
thats the only version i dont have defined in my env variables
welp
I have a feeling you defined it wrong then 
well now i got a different problem
lots of problems today
but apperatly i only have 247mb of ram?
on a 64 gig machine
na i found a different way
if i just define the amount of ram in the command it works just fine
never had that error before though
makes me wonder were it came from
import org.bukkit.craftbukkit.libs.jline.internal.Nullable; tf is that
something internal
do not use
and i suspect jline is not something you need to use
im trying to make a bossbar in 1.8 and im desprate i found this repo and he used it idk https://github.com/thekeenant/bukkit-bossy/
Quick question, can I publish a plugin on spigot with it using paper api?
You can use Paper API but it still has to work on Spigot
If it doesn't work on Spigot then no, you'll have to post it elsewhere
Can a Netty channel be added/removed async?
if a player quits, are all of his netty channels removed?
?paste
https://paste.md-5.net/azicosiwuh.java am i forgetting something here? like im not even getting an error anymore its just nothing happening wtf
bossbar messages is empty
also
you can use it after the "}" symbol
loadBossBarMessagesFromConfig();
show config
ActionBar:
- "Hello world 1"
- "Hello world 2"
- "Hello world 4"
ActionBarInterval: 10
BossBar:
- "Hello world"
- "Hello world23"
- "Hello world187"
BossBarInterval: 10 #In sec
DenyWorld:
- "End"
wait
ActionBar:
- "Hello world 1"
- "Hello world 2"
- "Hello world 4"
ActionBarInterval: 10
BossBar:
- "Hello world"
- "Hello world23"
- "Hello world187"
BossBarInterval: 10 #In sec
DenyWorld:
- "End"```
nice
how did i not catch that
happens
np
what were you expecting to happen?
to remove the given count of the item
wdym by "all of"? there is a single channel for a player
i mean
channel handlers
OMG OMG OMG I FINALLY GOT IT FINALLY AFTER SO MANY HOURS OF MY LIFE WASTED
so don't use it
you got it wrong
yea
please just use -=
it was -=, i thought that is the reason
no idea why it removes ALL of items instead of the given count?
remove item removes all items of that type
ONLY when itemAmount <= remainingCount
don't think they're removed but the pipeline will propagate a channelUnregistered call once it's out of the EL
and they'll be removed by the GC and so when the player joins again completly new channel handlers are created, right?
it's a completely new different Channel object with its own pipeline, so yes
much appreciated
also how the fuq does ForkJoinPool work
like it just kinda
I dunno
Kinda reminds me of HashMaps
Looks fun
This only looks so bad because of the decompiled local variable names
are they decompilated?
I hope so
like usually decompilation removes empty lines
it's not just the variables, this whole code looks like shit from matrix
it was written by someone like 30 years ago and never touched since
probably by some mathematician
they love their single character variable names
I've noticed slight changes in the code so it's probably still updated
but yeah, the system seems pretty old
https://paste.md-5.net/ligoqozoqi.java Would this be more efficient than ArrayDeque (only for the methods that are present in this class)?
Makes sense
this has more overhead I think using a normal array is faster probably
but it doesnt matter unless it very big
the only downside to an array being a deque is the removing things from the front part
also your method names seem like just a getter, instead of actually popping them from the list, which is what is actually happening
and right now you have written it like a normal queue, since there are no methods for taking the last item or pushing to the front
it is very big
how very big
okay so like not more than 10k
much probably, yes
or like most servers , probably not more than 100
some servers use like 2k despite having 10 players
bro invented the LinkedList
so let's assume less than 300
but without the insertion in the middle
I don't really need it
okay, less than 300, an array or this linked list doesnt matter performance wise
and if it would , its a very much micro optimization
it will start to matter when you are in upwards of 100k elements, in which case using an array is faster most likely
hi , which event should i use to prevent drop item using Q or hold in curser and drop out of the opned inventory
I think both might be the drop item event
or for the inventory you may need to cancel drag event
Looking for someone with intermediate-slightly advanced knowledge of Java. Bukkit or Paper api experience would be nice but not required. I am making a plugin that makes dynamic npcs in minecraft. These NPC's will have there own schedules, lines, quest-lines, etc. Similiar to skyrim. Profits split 50/50, i need one person, 18+ preferred.
?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/

