#help-development
1 messages · Page 1128 of 1
When I try that, I get [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.966 s [INFO] Finished at: 2024-09-09T00:12:33-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project TWClaim: Could not resolve dependencies for project com.ethan:TWClaim:jar:1.0-SNAPSHOT: Could not find artifact com.jeff_media:CustomBlockData:jar:2.2.0 in jeff-media-public (https://hub.jeff-media.com/nexus/repository/jeff-media-public/) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
So I guess something happened with Jeff's repo?
Since I am using everything he posted publicly in my pom, and it was working for about a year.
This is just a general question, but is there a way to tell what entities actually use the EquipmentSlot.BODY? I'm trying to identify which ones, but just haven't found anything, besides horses and wolves which are explicitly listed within the javadocs
if you go to the link its a 404
its on maven central now
How do plugins like essentials store data? Like warps and stuff? I've never really looked into it. But from what I remember, there is no database file is there?
file
files or databases
there is no other way
pdc be like
tbh i doubt there are more entities that use that.
Horses can have horse armor and wolves can have wolf armor.
I think the java docs only state it like that so that they won't immediately have to change the docs if a new animal armor comes out.
I did do some minimal testing, only entities that I found to use the slot are regular horses (Not skeleton and zombies), wolves, and [trader]llamas
True, but at least you don't have to think as hard
i mean yea
Thanks!
but i doubt that a massive plugin like essentials stors all data in some Cow lmao
The ancient cow of omnipotence is essential to every plugin
that would be hilarious tho lmao
just some cow with a sign "DON'T KILL OR THE SERVER BREAKS"
XD
like yml or is it an sqlite file?
Im only curious how those kind of plugins do it
yml, json, sqlite, whatever you feel is most fitting
yml is easy to edit for the average joe but its not the fastest or suitable for mass data storage. for example, i use yml for storing player clan data
well its nbt
json is very easy for you to implement and is fast, but users tend to make more mistakes while trying to edit it. i use json to store custom recipes and such
nbt are the .dat files right?
they are stored in the players inventory, which is in the playerdata, which is .dat yes
sqlite if you wanna store a large amount of stuff and get only parts of it with queries without loading the whole file, i use it to store player data
xml is also fine
not for mass storage obviously but can kinda be used in place of yml
if you're more comfortable with that
and are a complete psychopath
yea that too
its fine in the same sense that pouring your cereal after your milk is also technically fine
it is NOT fine
its technically fine but you belong in a mental institution if you do
I more so mean, what does Essentials use? because I have never seen a database file before. So where do they store their warps
it might just store stuff in the world save file idk
save in warps folder, each warp has its own file
https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/com/earth2me/essentials/Warps.java
The modern Essentials suite for Spigot and Paper. Contribute to EssentialsX/Essentials development by creating an account on GitHub.
Very interesting. ty.
What exactly are the X and Z coordinates for chunks? is the 0,0 chunk where 0,0 is but 1,0 the NEXT chunk next to it in X direction? (and not the same chunk bc 0,0 and 1,0 are in the same chunk)
tl;dr: do chunks have their own coordinate system?
not really, think of them as compressed forms of the coordinate system
to get a chunk coordinate of a particular coordinate, divide x and z by 16 and round down
Chunk chunk = world.getChunkAt(0, 0);
Chunk chunk1 = world.getChunkAt(0, 1);
sout(chunk.getX() + ", " + chunk.getZ()); // 0, 0
sout(chunk1.getX() + ", " + chunk1.getZ()); // 0, 1
This is what i get.
Are those now the coordinates of a BLOCK (without Y) or of a CHUNK?
Bc it seems to get the correct chunk with getChunkAt(blockCoordinateX, blockCoordinateZ)
wait
or does it
technically there will be a block at the location of the chunk coord
now i'm confused on what my test returned me
I gave you the formula to determine what chunk coord a particular coordinate belongs to
dividing the coordinate by 16 and round down
knowing this, you should be able to verify if its getting the right chunk or not
so if i want to get the chunk of the block coordinates:
256, 64, 122
I have to: world.getChunkAt((int) 256 / 16, (int) 122 / 16) ?
getChunkAt does the math for you
so you toss in a coordinate into that method and it will get you the chunk that coordinate belongs to
ah okay
however, you can if you wanted do the math yourself and verify the chunk coord
okay so i asked this bc my tests confused my but i cant retest it rn and i apparently cant remeber anymore as well lol
(i'm kinda dumb sometimes)
but
uhm
well now you know how to verify your test
tests are not very good if you can't determine if they are correct or not 😛
I think i tried getting a chunk with getChunkAt with 0,0 and 0,1 and it let me set the plugin chunk tickets
but if it converts my input to chunk coordinates
it should disallow me from setting that, no?
it's not that i can't determine, i just can't remember rn LMAO
coordinates 0,0 and 0,1 exist, and both of those should exist in chunk 0,0
exactly
that's what's confusing me
and the chunks getChunkAt returned, returned 0 for getZ and 1 for getZ
docs could also mean both lmao
at least from how i understand it
The world has two coordinate systems, one chunk grid and one block grid. When getting a chunk, you select from the chunk grid.
Should probably be mentioned somewhere in the javadocs
test:
player-list:
9226563f-1b48-38e4-b2d1-b4b400e0b646:
playername: _SinHa_
player-uuid: 9226563f-1b48-38e4-b2d1-b4b400e0b646
_SinHa_:
player-list:
530fa97a-357f-3c19-94d3-0c5c65c18fe8:
playername: test
player-uuid: 530fa97a-357f-3c19-94d3-0c5c65c18fe8
when i deleted SinHa in my friend list.
test:
player-list: {}
_SinHa_:
player-list:
530fa97a-357f-3c19-94d3-0c5c65c18fe8:
playername: test
player-uuid: 530fa97a-357f-3c19-94d3-0c5c65c18fe8
RemoveCommand
https://paste.md-5.net/saxagiwode.js
FriendsDataManager
https://paste.md-5.net/qogaxinute.cs
When I remove a player from my friends list, if the removed player is offline, only my name is not removed from their friends list, and it still appears in the "friends.yml" file; the offline player's list isn't updated, and I'm struggling to find a solution for this issue.
When I remove a player from my friends list while they are online
everything works correctly, and the player is removed from both friends' lists However
if the player is offline when I remove them
they are only removed from my list
but not from the offline player's list in the "friends.yml" file
what is that
Unrelated
i solved this
How do I change the max stack size of potions?
I'm on 1.20.4
The components where introduced in 1.20.5 iirc
So updating to just that should give you the option to set any ItemStacks max stack size.
Okay thanks
The method I sent will get the chunk based on block coordinates
Otherwise you can use X >> 4 and Z >> 4 to go from block to chunk coordinates
imagine if they used chunks of 15 blocks instead 💀
The power of 2 wasn’t just a lucky coincidence :p
because you have a class named ActionType
?
?
what do you mean
my class
yeah you imported it?
Do you have another import called ActionType
in import section
well second one is not imported
it is showing as option
when I want to import my own
show us ur imports
import it, then it should be there
if not ur intellij is probably just bugged, maybe clear cache?
well like i said it is adding it at front of new object
insted to import section
cleared cache same
is anything in ur class imported and named ActionType?
.
how does horizontal scaling make perfomance better? in the case of a database for example, every server should share the same data (or does it), if they always replicate the data once it changes on the another node, wouldn't it handle the same amount of requests as before?
Data doesn't always have to be consistent across nodes
but in such case, how does horizontal scaling work?
It really depends on the type of distributed system
It doesn't always replicate data, you can look at Cassandra for example
That database kinda sacrifices consistency for availability
okay
what is this shorthand, even?
oh signed right shift
ohhhh it shifts the bits by for to the right therefore dividing by 16 in a fancy way lol
I've read in the docs, that HumenEntity#closeInventory is unsafe in InventoryClickEvent... Would the following cause bugs?
@EventHandler
public void onClick(InventoryClickEvent event) {
HumanEntity humanEntity = event.getWhoClicked();
if (
/*Inventory check for it being the correct inventory*/humanEntity.getItemOnCursor().getType() == Material.WRITABLE_BOOK ||
humanEntity.getItemOnCursor().getType() == Material.WRITTEN_BOOK
) return;
event.setCancelled(true);
humanEntity.closeInventory();
}
I want to prevent the player from moving anything into a specific custom inventory except book&quill/signed books
i believe moving items into inventories that aren't bound to blocks (think ender chest) will always cause an event. i think there's around four?
unless theyre all counted under the click event
you dont necessarily need to close the inventory tho
it could. close it on the next tick rather. with your code you close the inventory before the click technically happened
unrelated, but is there a way to obtain the ItemEntities dropped from a EntityDeathEvent?
otherwise if you mean the actual entity being spawned, try something like https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntitySpawnEvent.html
oh right! that's what's stated in the docs, i can't read yet again
lol
sorry
but that could be a hacky solution
i want to manipulate the Entity 'Item' thats generated by the event
unless manipulating ItemStack allows you to pass data to the entity when it gets turned into one i dont think that'll happen
my approach would be to store the drops, get the itemstack from the item entity around the death location and compare. if it hits, you have the entity
but no idea if there is a more easier solution
there an event thrown when the items start existing or do i need to run a 0/1 tick scheduler?
trying to use the adventure-api and minimessage rn. i shaded adventure into my plugin but i still get a ClassNotFoundException.
[14:34:04] [Server thread/ERROR]: Error occurred while enabling VanillaUtility v1.5.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/github/shioku/vanillautility/misc/external/adventure/platform/bukkit/BukkitAudiences
at com.github.shioku.vanillautility.VanillaUtility.onEnable(VanillaUtility.java:106) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:492) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugin(CraftServer.java:575) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugins(CraftServer.java:489) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.reload(CraftServer.java:1013) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at org.bukkit.Bukkit.reload(Bukkit.java:870) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:150) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.dispatchCommand(CraftServer.java:921) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.dispatchServerCommand(CraftServer.java:906) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at net.minecraft.server.dedicated.DedicatedServer.br(DedicatedServer.java:431) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at net.minecraft.server.dedicated.DedicatedServer.c(DedicatedServer.java:407) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1321) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1071) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.ClassNotFoundException: com.github.shioku.vanillautility.misc.external.adventure.platform.bukkit.BukkitAudiences
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:160) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:112) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
... 18 more
its an entity. you can just listen to the entityspawnevent
fair
identification via uuid possible or na?
for itemstack there is the isSimilar method
alr
wait but wouldnt that trigger on any random itemstack if its the same material and count
most likely. as i said, hacky solution
ill go check smth else ig
imo there has to be a better way
the item stack might still be the same reference
if thats the case use uuid. imma check that
apparently there is this https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDropItemEvent.html
wheres the website for how to setup debugging again?
ill take a look once i can actually take a look lol
wasnt there some argument in the server args involved?
(new computer :/)
in what case?
i dont quite recall how to connect IJ to my local server
thats absolutely not what i meant but also works
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
theres a different one with like a port connection
there is this wiki page https://www.spigotmc.org/wiki/intellij-debug-your-plugin/
yea that
ah
is there a repo or sum i'm missing??
can you show us your pom?
wait build? cipher im not trying to make changes to the server lol
ill use the 2nd one
or build gradle
?paste
you are not shading it
uhm
provided means it should be already there
you want to either remove the <scope> line or put compile in there
how do i get the name here in the workspace.xml to change? I dont want to manually do it coz that might break something
im trying to rename the workspace from my preset
${project.name} maybe?
i mean i managed to do it with IJ interfaces before
i just dont remember how
like, the intended renaming stuff like pom + f4
no idea, i dont even know what workspace.xml is
.idea/workspace.xml
im aware, still no idea what it does
ah
its thinking the module classpath is renamed but still showing the old name
weird
ah yes of course
restarting intellij is the solution here
man i hate when that happens
why cant stuff update properly without a restart
why wouldn't it?
why would they constantly monitor the file for changes when it's meant to be read only at start-up and written as you change settings
i mean... isn't that the first thing to try when finding some sort of inconsistency?
see i expect software to work as advertised
aka the renaming button to rename my stuff 😭
idk what you're talking about ngl
Project Structure -> Module
ah, well, intellij will pull module names from maven/gradle upon reloading them
Module renaming is so cursed
One of my multi module projects still has a module I deleted months ago
How do I make all items have a specific lore when in a specific menu without taking a big risk
Like for example a crash with the menu opened
Copy contents
That makes all the items in the player's inventory have that lore
Ok
if the meta is null there is no pdc because its air
is that the only exception?
yes
ItemMeta#getPersistentDataContainer() or over the itemstack, one of them it is
howd u grab it directly?
directly?
just use your meta variable
sounds like you grab it without meta
Class#MethodIndicator
what
How do I use Translatable components via the adventure api?
i recommend an ItemBuilder so you don't have to go through the annoying process with the meta and stuff
Well
Obviously only applies to creating item stacks lol
see im not making an item, im manipulating an existing one
yeah mb wasnt thinking
im flagging them for 'dont despawn'
i just assert item != null
i dont quite recall what does
if i know that it's not air
isnt that a test only thing
nah
it's a shorthand
for
if (item == null) throw new RuntimeException();
And assert item != null : "Item is null"
does:
if (item == null) throw new RuntimeException("Item is null");
iirc
ouch
ye ill go with if null continue
ive been ingrained to not throw exceptions if preventable
i mean in what case will an item stack actually be an item?
for item stacks that you want the meta from at least
idk, im just grabbing the stacks from item entities and manually checking them
Hmm
I'm wondering if when iterating through an inventory
Does it return the air item stacks?
if so, then i was completly wrong lol
assertions don't run unless you add a vm flag
continue; is the 100% correct thing to do
vm?
virtual machine?
oh yea
wait what
you have to change something for assertions to work?
they always worked for me out of the box
lol
i mean is computers not working as intended news at this point :V
then ig IJ automatically does this(?)
well are you launching your server over IJ?
PS E:\projects> jshell
| Welcome to JShell -- Version 21.0.4
| For an introduction type: /help intro
jshell> assert null != null
jshell>
PS E:\projects> jshell -R-ea
| Welcome to JShell -- Version 21.0.4
| For an introduction type: /help intro
jshell> assert null != null
| Exception java.lang.AssertionError
| at (#1:1)
doesnt it throw an AssertionFailedException
how do i change the module name in maven?
tbh
i never gotten to that point
bc ig i never handled Air-ItemStacks
fair enough
time to change stuff
bump dis?
huh this is odd
anyone know why trying to type into w11 console constantly eats my inputs
wdym how to use them?
that's weird, what does your server startup log look like?
are you using java 22
you are running paper
spigot
x to doubt

i understand how to use the text components and minimessage.
With bungee, i could new TranslatableComponent. This is not a thing with adventure
this is what buildtools gives me
Component.translatable
ok and try it on java 21
java 22 is such a mess lmao
java 22 not breaking something challenge (impossible)
the java 22 issue is only a problem on paper, not spigot, because spigot doesn't bundle nor work with jline, paper does
i thought that said jishell
i totally am not sitting here staring at this item for way too long to determine if my code worked lol
darn it failed
wojt
oh this is annoying @hybrid spoke EntityDropItemEvent doesnt trigger for death items
im using that to flag the item but i still dont have access to the entity itself
the problem is that i need to un-flag the item so it becomes stackable again
otherwise id just set it when it tries to despawn
oh hold on
what happens if you overload event handler methods by naming them all 'event'?
is this why the second method doesnt seem to run?
the method name doesn't really matter
spigot will collect them by the event parameter
Classic Paper breaking things >:( /s
Classic Choco blaming everything on paper 😡 🗯️
he even added /s for serious
Yes. SUPER serious
uuuuuuuuhhhhh
I'm debugging my code right now.
container.remove(key);
stack.setItemMeta(meta);
--> return true;
debugger says the following:
meta.getPersistentDataContainer().customDataTags.size = 0
and
stack.getItemMeta().getPersistentDataContainer().customDataTags.size = 1
can someone explain why it's not setting the meta back to the itemstack?
is it safe to assume when I use Bukkit.createInventory(owner, MERCHANT) it'll create a MerchantInventory or would it be unsafe to cast like that
its safe to assume anything Bukkit#createInventory spits out is literal garbage
and that's about it
are you on 1.21.1?
Oh no he's gonna shill
lol
you know it, well I haven't completed the API for merchant menu yet
so I can't fully shill
You can create a custom merchant with Bukkit#createMerchant
for others you can let me shill this brand new API
i want to make it when a player clicks on a villager it opens a custom virtual merchant inventory instead of the regular one, so i can make custom trades without changing that villagers data
is that capable of doing so
HumanEntity#openMerchant
for now 😈
I'll ping you in a few weeks when I'ma start shilling my new API
Hey hey hey but remember any other of those cool and spicy things like Anvil or Loom check out MenuType!!!
no thanks!!!
its brand new hot off the iron and is just askinggg to be used
i dont need it!!!!
:( okay
really thank you though lol
I own such a code:
@NotNull
private final Pattern pattern = Pattern.compile(".*[^\\x20-\\x7FąćęłńóśźżĄĆĘŁŃÓŚŹŻ].*");
@EventHandler(priority = EventPriority.LOWEST)
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
long start = System.nanoTime();
if(pattern.matcher(event.getMessage()).find()) {
event.setCancelled(true);
}
long end = System.nanoTime();
System.out.println((end - start) + " nano");
}
It works the way it wants, but I'm wondering if the code executes 2746568nano/2.7ms will the server somehow lose out on that in terms of performance.
This is probably an amateur question, but that's how I am
I mean when you're working with RegEx it's not necesarily the fastest thing. But I wouldn't worry too much about it until it's a problem
What the heck is that pattern though? lol
Rudimentary chat filter?
well, first of all, that is not any accurate way of benchmarking java, secondly, the event is fired on a separate thread, so it won't affect tps, thirdly the pattern doesn't need the leading and trailing .* if you're doing find()
Totally don't know, I found it on the spigot forum but according to the description:
then warn Only American English ASCII Characters Are Allowed
In addition, I added Polish characters
thank you!
i mean, if you're looking to disallow characters outside of the ascii range, personally i'd just do a for loop on teh string's characters and check they are <= 127
also that pattern is going to only allow strings with non-ascii characters lol
can someone explain why setItemMeta seems to not set Item Meta? i looked at the source code but that also looks like it should just check if the meta is applicable - which it is - and set the meta afterwards
can ItemMeta keep records of it's previous PDC and overwrite it with that or something?
I'll say this much, measurements now show about 27562nano, or some 100x increase in performance
: D
well what else can it be
Show some code
this is the code
that is not the whole code
show the whole method or class that uses the stack and meta
?paste
like i said, your code is wrong somewhere, that one specific line is not it
and where exactly are you encountering this issue?
line 56 is the breakpoint its stopped on (last line of clean(ItemStack) method)
the debugger gives me the following two very confusing outputs
i just want to set the damn meta to the stack
it says it does but doesnt
(interestingly the setItemMeta(null) DOES change the item meta, but then setting it to the new one restores the old meta for whatever reason)
looks fine, let me check real quick
want a zip of the folder?
i can't test right now but it looks alright
grass block
hopper
what the fuck
this is related to containers
why does metadata not work on containers
it happens on barrels/chest/shulker, and doesnt on signs/grass/trap doors/chest boat/signed books
yea enchanted swords fine so its not related to the data previously there, it just doesnt work on containers
for whatever inane reason
How do I make a dragon face where the passenger's facing.
hm its getting overwritten by blockentitydata maybe?
augh i require the help of someone who knows spigot better than i do
i cannot find where the blockentitydata access is in the API
like this here
cant figure out how to change it
Is there a way to remove a vanilla recipe for example the wood pickaxe recipe. With Bukkit.removeRecipe() but i dont know the Namspace is there maybe a website or another method?
Okay i found that it works with Bukkit.removeRecipe but now it shows this Message in the console. Can i disable it somehow?
some can help?
bungeecord don't see messages send from spigot
https://www.spigotmc.org/threads/spigot-message-received.662184/
Hi, is there a way to check whether the players is allowed to place a block? (using setBlock method) I am using this code for my randomizer now but when I am standing on the top edge of the block I am still allowed to place a new block on top of the one I am standing on.
well yes you're never sending a message to the Bungeecord
You're sending a message from the server to itself
can i send messages to bungeecord?
it must be channel BungeeCord?
Use your own channel
but i want to server send messages when there is no player
Then you can't use the plugin messaging channel
You need to setup your own messaging system
for example you can open your own websocket to send data through
redis might be interesting for you
why regeneration applied for 1 -2 seconds doesnt work lol, only if i apply 3 seconds
does applying for example:
2 second effect every 1 second
restart it? or is it required to be at least few seconds left or... i dont have ideas
Because regeneration heals half a heart every 2.5 seconds
so if you give less it doesn't do anything
oh.. umm so.. does it restart
try it and see
yeah it works with 3 seconds, but actually how does it work that it doenst regenerate because i gave the effect for 30 ticks every 20 ticks so
the effect is constantly
but probably reseted or something
How can i make a Languge like Skript? Im not so good in Java and i need a easier Language. I want to make a self
Java is easier than skript
no i have to make a own language for spigot programming @odd gulch
can u help me
that i can get a language with spigot support
Learn Java and make an interpreter for ur own language
but i want it private ):
how do i make a interpreter?
no, what you are asking is ridiculous
hey does someone know how i can move the pivot point of a block display to make it not rotate around its edge?
im not acually using commandblocks, im working on a java plugin
You have to move the entity and then rotate it
using an offset fucks it up because mojang said "that's intended"
god forbid plugin developers do any math beyond addition
(They can't comprehend it)
is there a way to check what tool player used to kill another player? - if player hits another player with for example sword, then changes slot to some other item, then player falls and dies - it counts as killer would use the item that they are holding at the moment of death - not the sword
how to add empty scoreboard lines? I added one for 5th, 8th and 2nd line but only the 2nd one appeared?
I usually use wonky color codes for that
People when they are born 💀
?
yurr
cant use "" or " " or maybe... invisible sign?
invisible sign?
where, on the scoreboard?
Pickles on pizza typeshit
i like pickels on pizza
Bro I'm faded asf 😭
?
Drank 2 coca colas, faded ash
whats faded"
Shit this is help dev
i dont get u
Use ChatColor
Or " "
use item display for blocks, instead of block display. Item Display has origin in the middle of the displayed thing
does any1 here have an example i could look at of a plugin framework split into modules?. so like a module for commands, gui's etc.
bruz
?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/
#general message
good?
private static final List<Material> PASSABLE_BLOCKS = Arrays.asList(
Material.WOODEN_DOOR, Material.IRON_DOOR, Material.TRAP_DOOR, Material.FENCE_GATE,
Material.WOOD_BUTTON, Material.STONE_BUTTON, Material.AIR, Material.WATER, Material.LAVA
);
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location from = event.getFrom();
Location to = event.getTo();
if (to != null && (from.getBlockX() != to.getBlockX() || from.getBlockY() != to.getBlockY() || from.getBlockZ() != to.getBlockZ())) {
if (isSolidBlock(to)) {
event.setCancelled(true);
player.teleport(from);
}
}
}
private boolean isSolidBlock(Location location) {
Block block = location.getBlock();
Material material = block.getType();
if (PASSABLE_BLOCKS.contains(material)) {
return false;
}
return material.isSolid();
}
}```
Set would be better
This is gonna be weird but how do i update a plugin :skul: on the spigotmc page
What's the point of that code
You can use the post resource update button on the spigot page
if it's not there you might need to enable 2fa
Where do i find enable 2fa
i did it 😄
maybe use packets or no?
So I wanted to prevent death event so I checked for entity damage and canceled it if it reduced the players health below 0, but... it doesnt work if they have a totem of undying. Can anyone tell me why?
what...
The player doesnt pop the totem
Well its not that im trying to make him immortal
Im doing some checks and mark him as dead
I just dont want him to actually die
^^
You can check both hands for a totem before cancelling it
Alr
Wait but
What if the player dies in like
The void
or just listen EntityResurrectEvent and cancel?
@glossy laurel
I hope its allowed to get help with ProtocolLib here, I couldn't find a support discord from the plugin itself.
ProtocolLibrary.getProtocolManager(); returns null, so I assume I haven't included it into my project correctly.
This is what I added to the pom under repositories:
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
and this is what I added to the dependencies:
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.1.0</version>
</dependency>
Does anyone see what is wrong with this? Or am I completely skipping a step? I'm new to pom/maven in general.
i dont know what that means, sorry
do you have an article or other explanation of what I should be doing? 😄
you need to mark the dependency with provided scope
in the dependency, add <scope>provided</scope>
How do I remove all entities (the unloaded ones too) from the world?
Delete the entity files I guess
that indeed fixed it, thanks! currently looking into what it all means
on ondisable?
whenever you want to remove them
I would like to do this in onEnable because ondisable may not be called
vehicle plugin
idk what your goal is but probably on command+
I remove all entities when the server turns on (in this case I wanted) and spawn all entities according to the vehicles placed in the database
I am not sure why you would want to remove all entities from the entire world for vehicles
that also effects players, mobs, pets, armorstands and so on
Maybe just keep track of your existing vehicles....
^
not have problem
ig?
I have all vehicles on mysql
Why are you trying to delete them tho?
but mysql is not always updated in real time, there is a delay of 36 seconds
tf is going on with your db
lol
so I need to delete all entities when the server starts and then create them according to the coordinates in the database
I don't make the cache consistent with the db
no, you should recode your system so that it works like one should do it
what?
my cache isnt consistent with the db
performance issue
what cache?
mf using slowql
👍
set<vehicle>
calls your mysql more than 10000 times in a second brother then
you should NOT track your vehicle position just by database entries lol
and see if the system will not be overloaded
What kinda fucking vehicles are you spawning???
i have cache too??
if you have >10000 calls a second and are using mysql you should be reconsidering
give your vehicles a proper PDC to keep track of what entities are vehicles and which are not
PDC?
redis :D
yes
im on 1.8
oh
💀
then ig NBT tags
💀
😆
no way it's the gongas kid!
use NBT Data to track vehicles
frfr
how?
that's NMS stuff
yes ik
idk if anyone here has a proper NBT nms guide
proper way is updating
entity.addNBTTag(new NBTTag("myentity"));
How will this solve my problem?
appreciate it, that worked
pdc exists?
this should do for items @tardy garden
wdym
but for entities
If I set the nbt, does it prevent the chunk from unloading?
?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/
The Class
Persistent Data Container exists
You could also just store the entities uuid in a database
exists on 1.8?
Bro had the guts to write "for free"
No
hummmmmmmmmm
ok fair
Thats why he told you to update...
i can get unloaded entity from uuid?
store entity uuid in db
maybe
i feel like you're slightly over exaggerating
best BedlessDeus answer
nope
public void onEntityMoveEvent(EntityMoveEvent event) {
mysql.insert(event.getEntity, event.getLocation().toString())
}
Do you have any idea how many packets you send per second?
💀 💀 💀 💀 💀 💀 💀
packets != db calls brother
im not using playermogveevent wtf
lol
In my case no because I didn't do what you said
like with packets and db calls
That’s not even a real thing!
Is entitymove event really not a thing?
lol
?
Dayum he made his own event to spam his db
Imagine an event that gets called that often
and I don't know if you know but if the server crashes there may be inconsistencies either way
on paper it is
saving this in real time is crazy
no it isn't
Saving what?
the entity object on every tick obviously
whenever a person walks in an armorstand save in mysql the new location in mysql
Are you trying to make an entity tracker, that logs the entities position every tick, or save vehicles?
200000x per tick*
imagine the amount of calls EntityMoveEvent would get if you spawn 100000 cowas
cows
💀
Server begging
i was about to say
now imagine you have several of those plugin instances running
no, because it is well done
I dont think it matters, how well you do it, your server aint surviving that
mysql is no longer mysql
it's boomql
how is it well done if you call your persistent database >10000 times per second because of vehicles?
Now imagine in these 10,000 movements 10,000 insertions in the DB and having the guarantee that the cache is only modified when the insertion in the DB occurs and take into account that an insertion takes 1 ms. The server's TPS will not drop, imagine
You shouldn’t need to be tracking the location of the vehicles
Just track which entities are vehicle entities
The location will be tracked by the entity itself
ill save uuid on db but
the servers tps will not drop
?tas 
The entity knows where it is because it knows where it isn’t
its possible get a unloaded entity frmo uuid?
1ms*10000 = 10000ms = 10s/second
congrats
you receive 0.1TPS
?tas
i got 0.04 tps once 💪
Why are you trying to get an unloaded entity anyways?
that was without plugins tho
now imagine if mysql is slow and takes 5 seconds
with plugins it's ez shit
then you have much bigger problems
as I have to have the cache 100% updated with adb, then the vehicle will take 5 seconds to move one block
I remember dealing with some decoration door mod having some bug where it would literally drain 50ms/tick or sth
Dude, stop defending your shitty idea
Like the 10mb ram and intel I1 1k with 1 core and 2 threads your running on
and if you really need to do so many db operations per second, whicj you don't, you should never even be using mysql in the first place
??? 💀
🌟 REDIS 🌟
well if you are amazon or sth. yes you do
they deffo aren't
you should rather be doing something like cassandra
HEH???
discord uses it
ye ik
.-.
Now how am I going to take all the vehicles in the world and give them to all the people without having the uuid?
you dont
wtf
Why are you hyped
because I like school and I am entering the course-phase
i have to be awake in 7 hours
i've had school for a week now and already missed today and friday
rly fucking sick
school beginning on tuesday. First houseparty of someone in school? you guessed it, this Friday
✅
School start on a tuesday??
ye
Nahhh
tf
whats wrong with you
first schoolday is always tuesday
no??
Monday???
no lol#
Like a normal person?
no
yes
no
yes
It’s always Tuesday here
Hehh
Right after Labour Day
Coll you are based
Which is a holiday
someone know why my src folders not appears?
L
always had it start on mondays
Where
Bavaria just built different, we are just better
ew
we speak more languages than you
on intellij
School started this monday for normal people, but I've had it since last monday
how i send sscreenshots here
what
ill send u on dm
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
?verify
never use lightshot
why no worky :(
I ain't clicking on lightshot links, I am traumatized by jumpscares
I got jumpscared scrolling through instagram reels still being sleepy today
this sucked
Well
telling ya rn this kid is gongas
Can confirm, works 50/50
same shitty font
Did it at least wake you up
its possible remove all entities?
yup exactly
And is also in paper discord
what files i need remove
collio it's the gongas kid fr !
ALT + F4
Wrong mesage
oof
I give up
i failed miserably
wft!
what
paper user caught !
Minecraft Commands
you
who's
no
it's real !
you too, you're both on it 
can i use char(36) to save serialized uuids or no
Was thinking about this more And honestly I think the only spot this would fall flat is Generic_9x1 and other generic inventory that aren't backed by a Tile Entity. I think it might be still beneficial to be able to make these without a player. Curious of your thoughts there. I mean could maybe add a bukkit method or something?
you are literally getting an answer in help server genuinely why the fuck would you ask again
hey rad
hi
I want to ask a question to you
go on
do you think I should persist bullets after being shot, or clear them out slowly if the player gets far enough
persist them after being shot? as in, they just float?
no as in, they cartridge flies off and the bullet itself can ricochet and then just not hit jackshit, should I keep the bullet on the ground permanently or fade it away after some time
idk I like the thought of the first one but the 2nd is more potato friendly
o
@shadow night
okay so
- shoot gun
- cartridge falls to the ground
- does bulle talso fall to the ground once it stops (if it doesn't embed itself into anything, ofc)
Bullets aren't visible, cartidges Idk shit
If a bullet ricochets, it can lose most velocity
and just
lay there
Bullets aren't visible
they are not visible while flying straight
but you can def see them if they slow down enough
They aren't visible at all
i.e. from long enough distance
In our impl
Cool
What are you asking me about
You didn't ask
Not a single question mark since I'm here
I asked in the original message, but: do I keep the bullets/cartridges persistent or do I remove them when the player is far enough
Remove them
kk
question because when I use this:
material.addDefault("enchants", metaMaterial.getEnchants());
I get this
enchants: {Enchantment[34, DURABILITY]=1}
whats wrong
that when I put this
material.addDefault("enchants", metaMaterial.getEnchants())
I get this as a result
enchants: '{Enchantment[34, DURABILITY]=1}
What were you expecting to get as a result?
to give me the name of the enchantment and the level
but it's a map, i don't see anything wrong with it
Maybe you were expecting Enchantment to be an enum, but it’s not
The result is correct
context? try comparing the diff with the actual code and see if u ca manually insert the line
I get this error trying to build 1.19.4 from BuildTools, anyone know why?
[INFO] ------------------------< org.spigotmc:spigot >-------------------------
[INFO] Building Spigot 1.19.4-R0.1-SNAPSHOT [3/3]
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spigot-API 1.19.4-R0.1-SNAPSHOT .................... SUCCESS [ 9.636 s]
[INFO] Spigot-Parent dev-SNAPSHOT ......................... SUCCESS [ 0.010 s]
[INFO] Spigot 1.19.4-R0.1-SNAPSHOT ........................ FAILURE [ 0.017 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.768 s
[INFO] Finished at: 2024-09-09T16:56:25-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:3.0.0 or one of its dependencies could not be resolved: org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, C:\Program Files\apache-maven-3.8.3/bin/mvn.cmd, -Dbt.name=3763, clean, install]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.runMaven0(Builder.java:936)
at org.spigotmc.builder.Builder.runMavenServer(Builder.java:905)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:683)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Looks like you have a cached lookup failure of a maven plugin
You can delete it from your .m2 and try again
ty
Hi I dont know if I am missing something but can I get food's saturation and nutrition using FoodComponent? if not is there a way to do it? getSaturation and getNutrition return 0. Even in second picture.
Do you have an item with a food component
Idk if the vanilla food have it by default
Oh I see so there is no way of finding vanilla saturation and nutrition?
of vanilla food items*
so are the only ones missing then, the 1x9, 2x9, 4x9, 5x9 sizes? If so, it might be best to just have dedicated methods for those in some form
I guess you can't create a 6x9 either with a single block entity, then you might as well include all those sizes
honestly, you could just add some API to change the size of chest block entity inventories
I keep failing at making the dragon face the direction the passenger's facing.
https://paste.md-5.net/aqikoweker.java
I'll look into it. Working on menu builders than I'll prob throw out a draft
I am setting a display block's billboard to center but it only faces me for about a second after being spawned can someone help me fix this? I am quite new to java so if my code looks messy
public void cool(Location L) {
int x = 0;
int y = 0;
for (int i = 0; i <= 5; i++) {
y = 0;
x += 1;
for (int u = 0; u <= 5; u++) {
y += 1;
BlockDisplay bd = (BlockDisplay) (L.getWorld().spawnEntity(L, EntityType.BLOCK_DISPLAY));
bd.setBlock(Material.OBSIDIAN.createBlockData());
Transformation transformation = bd.getTransformation();
transformation.getTranslation()
.set(new Vector3d(x, y, 0));
transformation.getScale()
.set(new Vector3d(1, 1, 1));
bd.setTransformation(transformation);
bd.setBillboard(Display.Billboard.CENTER);
}
}
}
I switched to packets, but it's pretty janky, the dragon keeps trying to face a different direction, but it gets forced back to the direction I'm facing, which causes it to shake a lot. I tried using the Hover phase, which has worked, but the dragon no longer moves, only turns with me.
What is a good way to expand GUI slots with the amount of items you have?
return Bukkit.createInventory(null, taskManager.getTasks().size(), "Tasks");```
so say i have 9 items but i add another so i want it to make another line
int size = taskManager.getTasks().size();
size = ((size / 9) + 1) * 9;
Bukkit.createInventory(null, size, "Tasks");
That should work fine. The ((size / 9) + 1) * 9 is basically just rounding down to the nearest 9
((x / 9) + 1) * 9
((0 / 9) + 1) * 9 = 9
((5 / 9) + 1) * 9 = 9
((10 / 9) + 1) * 9 = 18
((24 / 9) + 1) * 9 = 27
That will give you an extra line if you have 9/9 though, so you could do ((Math.max(size - 1, 0) / 9) + 1) * 9 to fix that I think?
You're amazing ❤️ Math makes my brain mushy
uh remind me, was there a way to click to go to a url using spigot text components
there was right
yeah I see it nvm
truly gigabrain I even had a utility method for it in a library I forgot about
sometimes my wit impresses even me
help me pls
java: cannot access com.viaversion.viaversion.api.Via
bad class file: /C:/Users/Lol/.m2/repository/com/viaversion/viaversion-api/5.0.4-SNAPSHOT/viaversion-api-5.0.4-20240907.084814-31.jar!/com/viaversion/viaversion/api/Via.class
class file has wrong version 61.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.```
“Class file has wrong version 61.0 should be 52.0”
ceil(size/9) moment
And just make a special case for 0
hey can some1 helpme makin pets?
i wanna replicate this style
https://imgur.com/a/CrRSCjA
Fairly easy to do
new to developing
Then don't do it
As a newcomer to developing you should not start with this
i'm not thaaaaaat new
but i'm not expert AT ALL
Many concepts are involved in this, and not mastering any of those might make the development of this pet extremely difficult
Oscilates up and down on the Y axis and ensures a distance to the player
okay
should i
If you spin in circles it won't really move because the distance is there
Dunno java code
u aren't helping yk
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
oh wow
I'd prob tick them every tick given they have idle animations n shi
k
Looks like a constant loop with:
- animation (jump)
- change facing to player
- move if distance
Then you have to figure out how to manage multiple players, the spawn / despawn, ...
I have the logic to spawn, despawn, assing to players
I only want that animation and i want that if player goes forward facing the pet it stays until player stills goes forward
Yeah you just need to ensure a specific distance to the player
Let's make it a "min distance" and a "max distance"
So there is a range where the pet doesn't move
If the player is too close, move the pet away (get the difference between it and the player, nuke the Y, normalize, multiply by max distance)
If the player is too far, move the pet closer (get the difference between the player and it, nuke the Y, normalize, multiply by min distance)
and then you do the Y after ig
You can also just not nuke the Y and add a constant value to it, also works
up to you
Don't forget to also check the collision and actual floor Y
if one were to PR it in
thats a whole entity
oh i misread
yo how do i get killer of EntityDeathEvent?
Most likely from the DamageSource
And how do i get player from damage source?
(obviously, making an if to detect if it is a player)
DamageSource#getCausingEntity docs
declaration: package: org.bukkit.damage, interface: DamageSource
then you cast it as a Player if it's one instance
exists some api to set persistent data Is there any API to set persistent data in an entity?
on 1.8
no
you are lying
You can use the nbt API stuff. It's super miserable but it works.
no working
Caused by: de.tr7zw.nbtapi.NbtApiException: [Selfchecked][2.13.1]This Method is only avaliable for the version MC1_14_R1 and above!
Then you've got to figure out what works for 1.8
I'm sure there is documentation for the method you called that threw that
omg
very good idea Best workaround is putting an item on the entity like a button as helmet
hi while using mongodb , the collection is not creating .. what should i do?
