#help-development
1 messages · Page 1206 of 1
is the max namespaced key length actually 255?
where did you get that information
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/NamespacedKey.html I don't see such a restriction listed
declaration: package: org.bukkit, class: NamespacedKey
source code enforces it
Preconditions.checkArgument(string.length() < 256, "NamespacedKey must be less than 256 characters (%s)", string);```
I guess so then
im asking because paper allows it to be the short max value and i want to support spigot without cutting this out
255 then
my best guess would be to somehow skip the preconditions and see if that caused trouble but i was advised against it as spigot might do these same checks in other places such as packets
in the current config.yml i only have chunkhopper:
but if you mean once its ingame etc then it does this
SuperiorWorld:
'37':
'36': 54
'0':
'37': 54```
are you really going to exceed 255
Namespacedkeywithalotofcharacterlikewowthisisrealyalongkeydoyoureallythinkyoullneedovertwohundredgloriouscharacterbythewayhaveyouevercompletedsupermario64ihearitsaverynicegameonthenintendo64butthereisalsoapcportavailableifyouarewillingtotakesomeriskshello this is 255
me? no, im making a skript addon so i want to allow as much as possible
im more generous
also what the heck is this string lol
:)
not sure if this fits java naming conventions 🤔
@rough ibex assuming this wrong ?
thats what i thought cause it says 54 but it doesnt load the size when restarting like i place 1 and it loads find with 54 slots but after server restart that same hopper doesnt load with 54
Hey guys, why is EntityMoveEvent only in the paper api? ;-;
Like, am I missing something?
not missing anything
the event :trollface:
lol
i'll check it out ty
am I tripping or is invalidities not a real world?
also use a link instead of see <FQN>
also rewrite the whole javadoc
"whether ...predicate..."
does not return boolean
‽‽‽
okay nevermind I hate the entire method
kekw
How do you get used to that font
no idea
Invalidities is indeed not a real world
You are checking whether a tile set is valid yet your function name is “invalidities”. Based on the context that you have given in your Java doc, it’s almost like you want to return a Boolean to check if the tile set in a room is valid.
Should be “returns a set of valid tiles based on the tile set that has been provided” or something similar
it does not
just asked whether a word existed not a nitpick dang
this is help dev
hey yall, i tried defining a recipe like this with my potion
but in the actual recipe it shows the potion as uncraftable
and im not sure why, it's meant to be an invisibility potion
ItemStack invisibilityPotion = new ItemStack(Material.POTION);
PotionMeta potionMeta = (PotionMeta) invisibilityPotion.getItemMeta();
potionMeta.addCustomEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 3600, 0), true);
invisibilityPotion.setItemMeta(potionMeta);
ShapedRecipe invisRecipe = new ShapedRecipe(invisibleRecipe, invisibleItem);
invisRecipe.shape("FFF", "FPF", "FFF");
invisRecipe.setIngredient('F', Material.ITEM_FRAME);
invisRecipe.setIngredient('P', new RecipeChoice.ExactChoice(invisibilityPotion));
Bukkit.addRecipe(invisRecipe);
when you try to give yourself the invisiblityPotion does it also show as Uncraftable potion?
i'll try that, i was intending for it to be just an invisibility potion obtained normally in vanilla
not sure what im doing wrong with the potion tho
what is weird is that when I DO have an invis potion, the recipe book accepts it as valid but shows no output
ItemStack invisibilityPotion = new ItemStack(Material.POTION);
PotionMeta potionMeta = (PotionMeta) invisibilityPotion.getItemMeta();
potionMeta.setBasePotionType(PotionEffectType.INVISIBILITY);
How do I use setBasePotionType correctly?
declaration: package: org.bukkit.inventory.meta, interface: PotionMeta
takes PotionType
potionMeta.setBasePotionType(PotionType.INVISIBILITY);
got it thanks
ItemStack invisibilityPotion = new ItemStack(Material.POTION);
PotionMeta potionMeta = (PotionMeta) invisibilityPotion.getItemMeta();
potionMeta.setBasePotionType(PotionType.INVISIBILITY);
invisibilityPotion.setItemMeta(potionMeta);
ShapedRecipe invisRecipe = new ShapedRecipe(invisibleRecipe, invisibleItem);
invisRecipe.shape("FFF", "FPF", "FFF");
invisRecipe.setIngredient('F', Material.ITEM_FRAME);
invisRecipe.setIngredient('P', new RecipeChoice.ExactChoice(invisibilityPotion));
Bukkit.addRecipe(invisRecipe);
Would this fix the issue then? Do i need to still specify default duration etc for it to show up as an invis potion in the recipe
I'd assume it would require duration.
never really had to do potions in a recipe, looks funky to work with
any google coems up with 2013 forums lol
was the duration required?
spiget order isn't sorting correctly when switching increasing to decreasing
https://api.spiget.org/v2/categories/4/resources/?size=30&page=0&sort=-lastUpdate == https://api.spiget.org/v2/categories/4/resources/?size=30&page=0&sort=+lastUpdate
any code?
do not crosspost
are you developing a plugin or are you simply running a server
oh, i am newbie( sry for that mistake
I'm really lost
You'll probably want to ask on their issue tracker https://github.com/SpiGetOrg/Spiget/issues
Spigot and spiget aren't affiliated
that thing is inactive for almost 2.5 years damn
I'll remove some dust then
oh by the looks of it that github is old
ill see if theres any newer source
they have a discord
Hey I have a problem with my plugin the elytra stops working and i cant use them after I am landing some1 can tell me why?
https://streamable.com/9tjne5
https://pastebin.com/RjEDSqSE
No
well you dont have to answer if you dont know...
i need some help with IntelliJ. I'm running my build from it which copies the plugin file onto a server directory, then run the server from IntelliJ. I hoped i could more easily debug my plugins that way, but it seems like breakpoints don't get hit. Anyone know why?
what im thinking is that you shouldnt even need to save the file at any time except for on disable since you can just load the file onto the hashmap on enable and then reference the hashmap instead for all logic
Player never gets removed from the flying map as the runnable exits at line 54
as teh player is never removed you cancel teh toggle event
Wait this is my first time seeing this. What is spiget?
A 3rd party api to help access data from Spigotmc
how can i do that?
i tried to fix it for hours already
I fixed it all
Thanks tho
oh alr
You are probs right but I fixed it so it’s saves on both I think
My hardest part will be adding a upgrading system for this plugin
pump
as in doing what for the hoppers?
Changes this stuff
speed of pickup - 1-20s etc
transfer speed - 5 - 1s etc
transfer amount - 8 - 256 (amount)
pickup amount - 8 - 256 (amount)
that might be unchangeable
There is existing plugins already that do this for chunk hoppers but they cost money so tryna make my own
ah
might wanna check javadocs for those methods
Where that
Hi, I have a backpack plugin, and I want to automatically store items that are whitelisted in the backpack when players pick them up. Everything is currently working, but how can I handle items given by other plugins? For example, I’m using a crate plugin, and players can earn additional keys to open more crates. I want these keys to be automatically stored in the backpack. Is there an event for this, or should I directly use the SET_SLOT packet?
very likely yes
there is no such rule forbidding you from using rest api lol
hi guys do you know any guide to spawn custom structure in the world?
hi who know how to get nms in spigot
?nms
tysm
org.spigotmc:spigot-api:jar:remapped-mojang:1.21.4-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
I have this error
Did you run Buildtools
ye
replace spigot-api with spigot
but i put it at somewhere else
ah yeah I missed that 💀
in dependency?
yes
org.spigotmc:spigot:jar:remapped-mojang:1.21.4-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
welp
Did you use the remapped flag
When running BuildTools? Also did you set the version to 1.21.4?
yes
i put it at different place
does that matter
Put what
the output directory
Shouldn't matter
Just make sure the remapped flag is set and that you built 1.21.4
yes
cool now it work. thanks
where to contact in financial aspects?
elaborate
but... more specifically?
what do you mean with financial aspects
I dont know what to do. I bought 7 months ago quests plugin premium, and I want now to download the newest version. But... or I'm too dumb and its too hard for me to find this in web, or author deleted this resource. I guess, its nonsense ask about money back, cuz I have this (maybe only early versions, but still I have) so I wanna rather ask, is possibile to find author or find out what happend?
cant you see the resources you purchased?
on spigot my content page: "no results found''
Your content is what you have posted
a, in that case sorry
so... where can I find my bought resources?
in mean, my mailbox on spigot website is empty too. But if I good remember, I got message there
Are you sure you're on the right account
wait, give me 1 minute, I must see something
yes
oh my...
no...
I'm so sorry for wasting time. I found minute ago my mail with confirmation from Gmail. And... I bought this on site with very similar interface... seriously, I was sure It was spigot. Even menu design is almost the same... everything is on good place. Again so sorry
sus
?
why would they make a plugin website that looks the same as spigot
Probably some other site using Xenforo
its buildByBit. I cant send ss from this, but top bar have very similar arrangement
I remember the most well, the mail icon. From this, the whole missunderstanding
thanks
Hello everyone I have a question for my two friends of mine ( @delicate thunder & @fossil hamlet ) they already know the basics of java and have experience working with it but have no knowledge or experience making Minecraft plugins at all but want to start I personally am not a good teacher and I have a hair trigger temper so I’m trying to get advice and or tools they can use to learn the spigot api and start making plugins. If you have advice could you please share it with them
I personally lean towards the "be a good teacher or provide them with one" approach
You have the wikis, youtube videos and guides on the forums
Good habits post both on the forums and pinned on this channel
When I bring someone into the minecraft "market" I usually start with this challenges list -> https://github.com/PiggyPiglet/Challenges
It teaches you a bunch of different concepts in linear fashion and lets you combine all of them at the end into a little minigame
Thank you so much for this. @delicate thunder @fossil hamlet This is some good stuff
thank you
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Im trying to order the tablist by ranks, in my own plugin, does anyboady know how to do that in spigot 1.8.8?
are you running into an issue, or are you starting new
Hello, does a 25Mb plugin jar (like with redis inside, which is used by the plugin) loaded in the server costs 25Mb of RAM ?
Not necessarily at all
Is there a way to have my plugin prevent server reloads
you can prevent the command being run but you can;t prevent an API call
Hm ok
ServerLoadEvent
if load type == reload
server shutdown
though that is after the reload has happened
actually... You could probably register yoru own reload command
is there a way to detect a block is any type of sign?
boys
i code for a plugin that decreeses username avientor's horizontal velocity by 40%
how hard would that be
State instance of sign?
if (block.getState() instanceof Sign) {
yeah just got it lol
i was using the deprecated at first so it wasnt working
Tag.SIGNS.isTagged
disable it after reload event
someone know how to block the portal generation after you kill the dragon?
I tried cancelling the event but didn't work:
public void onPortalCreation(PortalCreateEvent e) {
if (e.getWorld().getEnvironment() == World.Environment.THE_END) {
e.setCancelled(true);
}
}```
pretty sure worldguard has a feature for this, could check their source
i can't do it without worldguard?
From a spigot post “Went over this with andre in discord already, but for anyone else looking, spigot currently doesn't throw the event for end portal activation (when the dragon dies) and doesn't even have an event for the natural portal generation. However, you can trick minecraft into thinking there's an existing portal already by hiding an end portal block somewhere within 8 chunks of 0,0 (could just make a bedrock box for it underground or so) and the exit portal will no longer generate.”
I mean check their source code to see how they do it and implement something similar
this is from 2019 btw
in the case of generic attack damage modifiers, should i always use mainhand? Kinda stupid question but i wanna make sure
already tried moving the original portal a few blocks underground but it still genereta a new one.
When you kill the dragon it keep coming back to the original portal position to die
What version are you on?
1.20.4
the flag is already in worldguard or i have to putt the extra flag plugin?
you have to enable the flag iirc
iirc?
Hey, I've tried several methods for serializing a Map<Int, ItemStack> to a String but I failed, what's the best way to achieve this?
I know that there is Bukkit Serialize method for this but it cannot serialize AIR and some Slots may be null / air which i want to save those too, at least anyone has an idea how i could handle that part?
Pretty easy with yanlconfiguration - set(int, item) and saveToString
If I remember correctly
its only for nether portals
Hmm, not too sure then.
no worry, thanks for trying, ill keep searching
Np, not sure if the spawn location is the same for the portal every time on every world, but what if you just listen for the dragon entity being killed then set all the locations of the portal blocks to air?
I would test but I’m not on my pc atm
the x and z are always 0 0, its the height that's different sometimes (tried with few worlds)
Probably not the most optimized solution you can loop through all the blocks on the y axis and check the type
Or thought a range that it’s possible to spawn on
i can't do that bc theres a custom build where the portal gonna be, i need a way to prevent the generation of it
does anyone know the simplest way to move a armor stand with passenger on it
either velocity or teleport 🤔
the way i do is i get the armor stand location and add a vector then use teleport to set the location
but it doesnt work
define doesnt work
the Location variable is changed but in game the armor stand doesnt move
what version are you using?
1.21.4
ArmorStand positionDummy = plugin.getInGamePlayers().get(player.getUniqueId());
Location positionDummyLocation = positionDummy.getLocation();
switch (direction) {
case NORTH:
positionDummyLocation.setZ(positionDummyLocation.getZ() - 1);
break;
case SOUTH:
positionDummyLocation.setZ(positionDummyLocation.getZ() + 1);
break;
case EAST:
positionDummyLocation.setX(positionDummyLocation.getX() + 1);
break;
case WEST:
positionDummyLocation.setX(positionDummyLocation.getX() - 1);
break;
default:
throw new IllegalArgumentException("Invalid direction");
}
positionDummy.teleport(positionDummyLocation);
alright i fixed it, seems like i have to use nms to move it manually
CraftArmorStand craftArmorStand = (CraftArmorStand) positionDummy;
Entity nmsEntity = craftArmorStand.getHandle();
nmsEntity.setPos(positionDummyLocation.getX(), positionDummyLocation.getY(), positionDummyLocation.getZ());
?gui
i want to iterate through some files on a server, how do i access files outside of the plugins folder?
Do so as you would do normally in Java
I believe new File(); will automatically set itself to the location of execution
what does the code look like
trying to call a method on dir will cause an NPE
dereferencing is just a fancy way of saying you are accessing a variable's method
'dir' is a file that should exist tho
File dir = new File("world"+separator+"playerdata");
probs just the IDE being annoying
you can just assert not null and it should go away in ide
listFiles may produce null
that would be insane api
empty array if result empty, null on io error apparantly
can we see the full code
thats dumb
File dir = new File("world"+separator+"playerdata");
String print = start;
for(File file : dir.listFiles(new FilenameFilter() {@Override public boolean accept(File dir, String name) {
return name.endsWith(".dat");
}})){
};
what is that lmao
me trying to iterate players
that anon class is ugly af
why anonymous class in there
im probably missing something obvious
Can’t you use a lambda for the filter
just make the result of listFiles a temp variable, do null check
thats just a consumer
just use a proper lambda
dir.listFiles((file, name) -> name.endsWith(".dat"));
ah ty, i couldnt remember how to do tuples
not really
try and use it as a variable
hm this is odd. I'm trying to add the command to plugin.yml but its saying the schema validation is null when it should be an object?
the schema was two spaces per indent, right?
schema for what?
plugin yml
oh
just use yml lint
Validate, Verify and Reformat your YAML documents, optimized for Ruby on Rails
will tell you where it's wrong
thats saying its valid
<the usual entries>
commands: <-- warning here
listAllEverJoined:
description: Lists all players ever joined by most recent name
nope same error
two is what ive been using
can you send the entire thing
or a bit more of it
sometimes it can be the stuff before
well the part b4 is like literally the same as in any other plugin just adjusted
api-version: 1.21
author: Moterius #can use authors instead
depend: [] # plugins required for this to work
description: N/A
libraries: [] #experimental. Loaded from Maven Central. Shade/relocate specific libraries
load: POSTWORLD #default, other: STARTUP
loadbefore: [] #This plugin should load before the plugins listed here
main: io.github.moterius.VoidLib.Anchor
name: VoidLib
prefix: VoidLib #used in logging
softdepend: [] #plugins required for full functionality
version: 0.0.1
#website: link.net
i now have two errors
iirc yaml can be either
its bukkit commands that dont support uppercase, and that error im guessing is from mc dev and you can ignore it or probably want to go and ask them about the issue
Anchor is your main class or something
you can safely ignore that error, if spigot parses it on the server its fine
it is most like mc devs schema failing to work properly
oh you weren't compiling this whole time?
this was about the IJ warning
btw whats that mod called that makes your client not timeout
i need to debug some code now lol
ah foudn ti
uuuuh
why is my File.pathSeparator a ';'
i dont think thats correct
ok wtf
its saying that 'ba091b51-a21c-4710-a4d5-799f240ccd6a' is not a valid UUID string but the converter tells me clearly its my account's uuid
Whats “it”?
Theres a few different uuid styles

“public” “Uuid” “MyUuid” “=“
I’m gonna make a new language where all keywords and variable names must be in quotes
"public" "UUID" "MyUUID" "=" "UUID"".fromString("abcdef-123456")"
"public" "String" "mystr" "=" "<<sigma>>"
You can do that in kotlin!
`private` `val` `oh fuck off!`: `String` = "no u"
This is valid kotlin
just dunno whether you can put the keywords and shit in backticks
well, no, that escapes the keywords making them identifiers
oh true
val `val`: String = "no u"
thats just json
"acces":"public", "type":"String", "name":"getWOAHHHHHH", "paramaters":[] = "return":""egg""
What happens if I cancel the SET_SLOT packet? I'm trying to learn about packets, so I'm working with the SET_SLOT packet and attempting to cancel it when I give an item to a player. However, the item is still successfully given even though I cancel the packet. Why is this happening?
Cancelling the packet will just make the client not see the item for a bit
The item will still be there on the server
And last question Im using the SET_SLOT packet to get the slot number being updated. I want to replace that slot with Air. My problem is that player.getInventory().setItem() indexes 0 through 8 for the hotbar, 9 through 35 for the main inventory, etc. However, the first slot in my hotbar is indexed as 0, but the SET_SLOT packet is returning 36. What should I do?
you see that's just an AST
how is it different
just is
well not really abstract then is it
true
WHO THE FUCK EVEN NEEDS TO DO THAT
everyone
My ide is prettier than yours so get fucked
false
True
my theme is called dark purple
I wanna make a joke
purple > anything else
but I'll probably get the boot lol
is it about purple the person
my theme is called "catppuccin mocha" because alxhr hasn't finished the decay themes for JB yet
no
mocha smh
i hate catppuccin so much
excuse you
https://gitlab.com/allianceauth/allianceauth/
I'm too fucking dumb to get it man
they have themese for about 500 different programs
but neither me nor alxhr succeeded in making a JB theme for decay
also the fact they using docker makes me cry
I heard docker was just ass
docker isnt ass
it really isn't
doesn't make their theme any better
my cursor wouldnt be purple without cattpuccin
also no they don't
making a JB theme is just so fucking horribly painful
From everyone I talked to, they all say k8 > docker
if you have 1 server or its ur pc, use docker
if you need something to expand it self use k8s
I mean k8s can run docker containers if I understood k8s correctly
i dont play saints row so nuhuh
well yes it does run docker
just in a fancy overcomplicated way
shrimpol will beat you up if you talk about k8s badly
im just saying you dont need to use k8s on your pc or your singular server
fuck right off
perfection
Well I guess I don't understand what would warrant multiple servers I guess
it would most likely be something that you would a) having running in popular locations and then as needed start up more to cover the load
afaik papers hangar uses k8s or something like that so it can account for extra load going to it by itself
Yeah that makes sense
My goal is to host an auth process and basically put some data into a pretty format
if you want isolation use docker, otherwise just run it
wdym by isolation?
running something in docker isolates it
like you can run something inside a docker container and its self contained inside of it
like ptero uses docker to run servers which can do something to stop malware spreading across servers
i see
when i was on windows and doing stuff for a server i would run something like mariadb or redis in docker so i can quickly purge it or turn it off without having to do 9 million steps
docker desktop + wsl2 is amazing
this be effective if i will create smth like Map<String,Object> properties?
this very confortable but what about casting
this long process?
what
Map<String,Object> properties for object with custom properties
what are you trying to do
where string this id and object property for object
gui item but i dont want use itemStack data container for some data
so i want use it
why
then store them somewhere else
so i want ask this "but what about casting
this long process?"
then don't store them in a map?
why would you not just store your stuff in fields
if you have that many properties, you should probably reconsider
custom ones
no time
"no time"?
it takes 2 seconds
for 3 fields I assume
you can setup live templates and you have default ones for fields
or you could spend 5 hours writing an AP to do that for you
it woud just clutter the code with casts
and what will happened?
why is casting a long process
you say to me or him?
you
"why is casting a long process?" -> "just say casting this long process or not? " ???
so this long for speed or not
okay i have no idea what the fuck you're even trying to say anymore
no, casting does not take long
thenks
Maybe it's a translator issue? It's just that you answer a just question in such a strange way.
because your question doesnt make sense
it's the fact that your questions are worded so weirdly and make zero sense at all
By long process I mean speed
speed of casting object to need class
when i use string -> object map
what's weird about this question lol?
Idk about jvm but I think casting only does one runtime check
What was the end goal?
Gui Item with many properties. This unconfortable use data container
i have one object with map
properties
What don’t you like about having a class with a set of fields?
"no time"
architectural restrictions and time
gonna build a gaff with my fields
and of cose confortable
what do you mean by architectural restrictions and time?
well that's what I said
okay
Yes but what do you mean saying those words?
that does not explain what you mean
omg
I legitimately don’t understand, I’m trying to figure out what exactly you meant by such sentence, no troll.
ok good luck
Looks like there's a translation problem. After all, I wrote in English by hand
No I was more curious as to the explanation behind "architectural restrictions and time", there were no concretions, examples or explanations which left me (and presumably others here) confused.
so i have written code for a custom item:
https://paste.md-5.net/hateqoyaje.java
the only problem i am having is that there is a Mending III written right above the custom lore. I have also set the itemflag to hide enchants. the rest of the enchants are not showing but only the Mending Enchant is being shown. i am not modifying the item anywhere else
yeah idk what u've gained from saying ts but ight
nothing
just observation ig
my bad uncle that were rude
hannah are you their uncle
yeah she used to buy me subway cookies everyday after school
damn i want subway cookies
warm biscuits are the best thing ever
help
to an extent
it still relies on host files so it isn't necessarily 100% isolated
u get it
okay i'm having a dilemma I want to make my minigames api that i'll use for all my minigames and i'm trying to think of where to start
i have no idea where i should start
I'm thinking more and more of making it component-based
having a map component, phases component
for?
phases are the easiest to start
i'm going back to my core and finishing up the player profile stuff all the new data i have to save for each game i'm not sure on how to handle it should i just add it all to the profile for each game or do a separate stats thing for each game i gotta make the permissions system anyway so i'll brainstorm while doing that
✨ Entity Components ✨
man you saying this is gonna make me redo my entire profile system 😭
it would be way better to do ECS
idk why i didn't do it from the start
🤔 given we use kotlin at work I might as well make a PDC system for pojo's
maybe even use kryo for serialization
use extension methods to integrate it straight into players
hm
val data = player.getData<ProfileData>()
Hello, I would like to ask, this Spigot MC is an open-source project, right? Where is the open-source project located, and what is its name? I need it to modify and add features. Simply put, I want to create a Minecraft server software project.
?stash
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
i'm confused, you mean to make a plugin or to contribute to spigot
I want to modify and customize Spigot to add new features, so I need access to its source code. My goal is to create a custom Minecraft server software, not just a plugin.
i dont think he wants to contribute, he wants to make his own private fork
Hello. Is somehow possible get NBT String from ItemStack what can I use in Item class? I need create new Item from ItemStack and use it to HoverEvent SHOW_ITEM. Thanks
Yes, that's correct. I want to make my own private fork to modify and customize SpigotMC for my project.
tbh you'll probably have a better experience if you clone the paper repo and remove every single patch and then build from there
Thats answer for my question?
no
ItemTag.ofNBT(ItemMeta.getAsString())
Item item = new Item(ITEM.getType().getKey().toString(), ITEM.getAmount(), ItemTag.ofNbt(ITEM.getItemMeta().getAsString()));
TextComponent component = new TextComponent("text");
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, item));```
Its showing item without NBT Data (name, enchant, lore)
(ITEM is valid item from hand)
are you developing for 1.20.5+
1.21.1-R0.1-SNAPSHOT
then you'll need to copy over the data components for whatever you are doing
since that stuff is in item components
How? Item wants ItemTag as parameter
hi
i write a new plugin but when i want to download Buildtools librarys (with java -jar BuildTools.jar) so i can compile the plugin and i keep getting this error:
Starting download of https://piston-data.mojang.com/v1/objects/45810d238246d90e811d896f87b14695b7fb6839/server.jar
Exception in thread "main" javax.net.ssl.SSLHandshakeException: (handshake_failure) Received fatal alert: handshake_failure
what i have to do?
are you trying to compile your plugin with buildtools?
Full log please
do you have any idea how to fix this? (issue with Build Tools)
my java version is: java openjdk 21.0.5 2024-10-15 OpenJDK Runtime Environment (build 21.0.5+11-Ubuntu-1ubuntu124.04) OpenJDK 64-Bit Server VM (build 21.0.5+11-Ubuntu-1ubuntu124.04, mixed mode, sharing)
my log error:
https://pastebin.com/9ycU6FMe
does anyone know which sound effect plays when the player triggers a sculk shrieker and it does like the heartbeat sound while they get darkness
Wouldn't that be a warden sound effect ?
Warden's heart beats on the wiki, you can play the sound there as well
yeah but thats the passive heartbeat he makes that indicates his agitation
i mean the heartbeat that sounds when the player triggers a shrieker
or is that part of the darkness effect itself
go to the shrieker wiki and click through those sounds then
yes it does
the heartbeat only comes from natural shriekers doesnt it
is "Warden advances" the one ?
you can probably turn on subtitles to see what effects are playing
thanks a bunch
well atleast to see how they are translated
JKD and JRE are one in the same after java 12. They don't come separately no more
they do in debian packages
are you sure they are different and not just named that way to just point to the same thing?
I don't see how they are providing a separated jre and jdk when oracle and openjdk don't have them separated
vendors just advertise a "jre" when it's really just a stripped down version of the jdk without certain modules
like jdk.compiler and such
that is dumb
I like how its in oldstable repo
anyways, still dumb but I guess you are right to an extent
lol
ok my bad @sullen marlin guess some distros like debian release a so called jre for really no good reason.
only thing I can find why debian still does it, is because it uses less system resources, which technically is slightly true if we are just measuring that one takes up like slightly smaller space then the other lol
there we go
is it updated now?
yep
what is net.minecraft imports?
Can I somehow get Materials from other mods in spigot if the server that the server will run on will have both the mod and the plugin?
lmao.
okay wait, is it possible to tell if a material of an item is that from a mod? Can I somehow get a string from that material and compare it to smth else perhaps
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
a mod won't add a variant to the Material enum
not possible
as long as the hybrid you are using does not do some weird ass shit
but again, hybrids are unsupported
i need help, i am trying to compile a plugin from github, when I import it appears many errors, i add the jars to the build path but stills dont work and some functions disappear

well, older versions are unsupported too but people still ask for help here
i mean older versions still have some API
whereas it comes down to what hybrid you are using
go to their support
Hybrids are an entire different game. They reimplement the API with no guarentee for consistency of the bukkit api and also sometimes fail to fulfill api contracts. On top of that hybrids sometimes break vanilla and spigot behavior because of inconsistent API etc. Also not to mention spigot and ANY modding api have inherently different goals that expressly do not align so the idea of a hybrid in the first place is super flawed
Comparing those things at all is absolutely fucking insane
Write a material enum generator
that would require knowing all mods at compile time
while you can add enum variants using asm iirc, they won't be usable for anyone not having the transformed bytecode or not using jdtc
Not what I mean
Not compile time generation
At runtime generation
.
You generate it before anything can load it
still won't really be of much use to plugins if they don't have the enum variant
the fact that Material is still a thing is just so stupid
it's such a fucking shitshow
Well, you generate it and that's the primary material enum then
well it is possible
mods rewrite methods and in some cases replace entire classes. This is what makes mods significantly different then a plugin
fabric mods are not gonna touch bukkit api classes
lol imagine
or forge mods for that matter
all hell let loose
probably not that part is correct
But yea enums are very bytecode modifiable/injectible even so, scary stuff
would be interesting if there is a hybrid variant that does do that though
would make sense on some level
never gonna touch the buggy mess that hybrids are
I sometimes end up injecting additional constants into enums, but that’s in the environment of fabric/forge so its kinda out of the scope here
I used to. I still have MCPC and Cauldron somewhere
someone join #690688600895127683
pls help
it keeps on deleting commands: when I compile it
You are using the InteliJ MC plugin and editing paper.yml not plugin.yml
Hi, i wanted to send a message in chat that has two colors, but it just keeps mashing the colors together (the screenshot has a different text & color because i made 5 variations of the same thing for different events that happen in the game mode.
StrTex =Component.text("ОСТЕРЕГАЙТЕСЬ МОЛНИЙ!")
.color(TextColor.fromHexString("FFFFFF"));
nameTex=Component.text("⚡ ГРОЗА!")
.color(TextColor.fromHexString("#ffd700"));
Bukkit.getServer().sendMessage(nameTex.append(StrTex));
Looks like you're using Paper and the Adventure API
I suggest you head over to their discord
im banned there😭
didnt realise it was adventure api
(i mean i did but yeah subconssiously went here)
i'll do it for you
?whereami
yes,using buildTools librarys.
@sullen marlin
i need help, i am trying to compile a plugin from github, when I import it appears many errors, i add the jars to the build path but stills dont work and some functions disappear

Disappear?
Anyways you need to add all the dependencies of that project
or if there's a pom.xml or build.gradle(.kts) use that
I have disabled the vanilla smithing upgrade for netherite sword.
And now I'm trying to register a custom recipe:
https://gist.github.com/Pilvinen/4e4b3dc7cb6c95e1ef009d2e915ef42f
But I'm unable to place the minecraft:shield ingredient to the middle crafting slot. It kind of blinks in there, result blinks. And it gets returned to inventory.
@EventHandler public void onPrepareSmithing(PrepareSmithingEvent event) {
ItemStack baseItem = event.getInventory().getItem(1); // Base item slot is index 1.
// Print out the item in the slots.
System.out.println("Base item: " + baseItem);
System.out.println("Result item: " + event.getInventory().getResult());
System.out.println("Smithing template: " + event.getInventory().getItem(0));
System.out.println("Netherite ingot: " + event.getInventory().getItem(2));
The base item is always null when the event runs.
Any ideas?
Is it even possible to create upgrade recipes which have other components than diamond stuff?
I managed to force the ingredient from mouse cursor, but I still can't craft.
how do i send a full code snippit using that web thing again?
?paste
paste it in there, press the save icon, copy the url
buildtools makes the compiler for plugins, its not the compiler itself
run it for the version you want to compile for
oh you are odd. try running it in an empty folder maybe?
on the event if you dont want the player to craft the sword, make an if block that uses the event.setCancelled(); method if the sword is the material being placed in
as far as the shield idk how that could be done but search javadocs for an answer there
bt doesn't make compiler for anything
it builds the libraries and server jar
which then compile the plugin
no, java compiler compiles the plugin
using the libraries
yes
i tryed that
hm. maybe try the .exe version
anydesk
ik. i hav e to compile buildTools itself so i can compile my plugin
yea no clue, maybe try seeing if md_5 knows something
buildtools is failing
why not download the jar manually from a site
coz im lazy and i have this in my quickbar
what version you trying to build
Can't say I've seen that error before
Anything installed that would mess with the connection?
Btw this didnt work. Someone send me this:
@Override
@SuppressWarnings("deprecation")
public HoverEvent getHoverEvent(@NotNull ItemStack itemStack) {
String nbt = String.format("{\"id\":\"%s\",\"count\":%d,\"components\": %s}",
itemStack.getType().getKey().getKey(),
itemStack.getAmount(),
itemStack.getItemMeta() != null ? itemStack.getItemMeta().getAsString() : "{}");
return new HoverEvent(HoverEvent.Action.SHOW_ITEM, new BaseComponent[]{new TextComponent(nbt)});
}```
And its works but its already deprecated
Yes
Use Java 21
1.21.4 and 1.2.3 i tryed both
i tryed with java 17 and 21 and 23
from where?
the site hes most likely talking about is not offical and could contain malicious modifications
Does anyone know how to make player invincible in 1.21.4?
I've tried canceling EntityDamageEvent, but it didn't work.
What about it didn't work
lol i found that i had not registered event listener
yes but I'd really recommend you fix whatever's bricky on your computer lol
i am using java 22 btw
thanks
21 is recommended as its the version 1.21 uses
and it has LTS
it was stated yesterday funnyman is using .23, so i cannot make a guess if the issue is the java version or not
i tested both 21 and 23 and also 17
ok maybe you just have a broken windows install
@ancient plank Are you allowed to distribute jars in such manner?
Ah
i wanna get item's default name!
but ItemStack.getItemMeta.getDisplayName returns null.
how to get item's default name
minecraft::oak_log -> Oak Log```
Get it from the Material enum, ItemStack.getType().name(). Then parse it through a capitalization method
- how to get item's default name in korean
You don’t
The server doesn’t have that data
But you can get a translation component for the items name
Is there any reverse method to ItemMeta#getAsString? used to be UnsafeValues#modifyItemStack, but that seems to take the component format you'd use in e.g. /give now
uh
declaration: package: org.bukkit.inventory, interface: ItemFactory
Yeah you got sniped
On my discord you did
discord moment
Guess discord doesn't order messages lol
just updated discord I got sniped L
I bet they don't use a ConcurrentLinkedDeque
md wins!
woo
🏅
Haven't tested it yet, but are you sure? seems to also use ItemParser internally like modifyItemStack
Will try it later to know for sure though, thank you
anyone know whats wrong w lambdas in bukkit
doesnt work at all the new GUI isnt open
but when u schedule it 1 tick later or 0 tick later it works
Nothing wrong with lambdas


you


Nice name
Alright how about here then
why cant u set the leash holder to null without a task
when it that fired
always has been
thats just called a different server software
yeah why dont they do that
they have
that's called modded
no one cares
modded is trash tho
why?
cuz it supports mods
y-yes
if they wanted modded they go to modded, 99% of server sotwares dont take off because spigot/paper/otherforks exist
that's the entire point
since Bucket is the correct word signifying a working api and Bukkit is just some crooked ol' api
yooo thats cold sm1 should do that
nar
Plugins are just server side mods
just run vanilla and make datapacks smh
datapacks are so cringe idek why they exist
who uses datapcks
atp use command blocks
lmao
you don't know what they can do, do you
they cant do anything
heh
ok bukkit can do everything datapcks can and more
also not true
some things you can do:
add advancements, banner patterns, dimensions, enchantments, discs, some mob variants, paintings, trims
I believe most of these things are yet to be supported by spigot
what like nms
i never use the api, only for plugin loading
sure pal sure
gotta save muh cpu cycles
so ur just sat there making datapacks
fair
Without mixins that'll be annoying
Spigot doesn't have API for all the things, as steve said above
yeah it doesnt have api to remove rats from the server
what does that even mean
i cant only remove rats from the server such as rad
thought u were calling me a rat
RAD NO
🫡
so apparently slimes and magmacubes are not considered monsters, is there any reason why that is? lol
or just an oversight
Internals doesn't consider them monsters so it's just mirroring vanilla
Why that is, dunno
they're cute lil blobs
they are a neutral mob
how dare you call them monsters
they are literally not
and endermen are considered monsters
Idk Just a mojank thing I doubt they actually "attack" though
I'd have to pull up nms I bet there damage comes from bumping into then and their AI simply tracks to players
Nah internals moment
does anyone know a good method of telling where on a map a player is clicking? I feel like the answer involves a lot of advanced geometry 😓
My method of spawning an arrow entity from the player to where they're looking isn't accurate enough unless they're looking at it head-on and far enough away.
If you run raytrace, the result has the exact position.
You'd have to account for the width of the item frame tho.
Should be fairly easy.
can i manipulate how fast blocks break?
You can do server side block breaking
was more thinking telling it 'hey you break instantly on effi v'
depends, are you on newer version ?
there is an attribute for mining speed or you can edit the tool component of an item
ye im on latest
ye, so you can use one of those two
interesting idea but the problem is that would affect all blocks
hmmm not if you use the tool one
yes ?
i can never remember how exactly that works tbh
is ItemStack#hasItemMeta the same as ItemStack#getItemMeta != null
Well, to be clear, the logic would be the same
The approach differs. getItemMeta() gets and clones the meta, so each time you call getItemMeta(), you're doing an expensive clone of the item meta instance only to check if it might be null
no

for anything that is not air, getItemMeta will give a valid itemmeta, but hasItemMeta will return false until you call setItemMeta
hey everyone curious if you use jitpack to make your own dependency?
if so why wont it find my github?
<dependency>
<groupId>com.github.MrArcane</groupId>
<artifactId>Core</artifactId>
<version>me.arkallic.core</version>
</dependency>
version is bad
do you have the jitpack repo in your pom ?
and artifacts "should be" lowercase
<groupId>com.github.mrarcane</groupId>
<artifactId>core</artifactId>
<version>main</version>
</dependency>```
still doesnt. that was just me trying to get it
version is usually a number
use -SNAPSHOT for latest, or specify a commit
yes i have jit
Hey guys, I'm working on a plugin that repairs item damage, I set the damage to 0 on the item but the durability bar stays the same after, only finally updating after using the tool again. Oddly enough if I drop the item my other plugin which shows item drop info shows the correct durability. Is there something else I need to do "refresh" the client side durability bar?
item.setItemMeta((ItemMeta)meta);```
theres an inventory refresh method i think?
ah its on player#updateInventory()
api says its requirement is indicative of a bug tho
I did that aswell, ij just says not found
try using a specific hash
I think something broke
If you want a free repo ask me
rad can i have a free server
Nah
You can have a repo on my reposilite
I can give you a 512mb alpine docker image
best I can do
do you want a repo on my repohttps://repo.epicebic.xyz/#/
thats a tiny bit out of date
No thanks
Are we running outdated software!?
time to see if any vulnerabilities exist >:)
/wp-admin.php
Sure just give me the credentials
ubuntu@resourceful no password
Host and Port?
host is resourceful
ill do it at somepoint bc im prob gonna reset the servers
hope i can actually get a server from oracle when i reset them
Why would you get a VPS
idk how im gonna survive with the fact basically nothing is on my repo anymore
its free oracle vps
Use mine! [My repo]
ur repo?
Yea
Yes it is!
that reminds me i never saved the secret for that
Smort
Imagine not having a reliablesite dedi you're allowed to use for non-work related things
miles repo is down
lmao imagine
@river oracle ur repo is down
That's why you use mine
slide me a vm over
Okay I don't think I'm allowed to do that
smh



