#help-development
1 messages · Page 437 of 1
yes i know
okay the pugware folder has all of the .java files how do i import them?
just copy them into the source directory of your project?
You really need to understand that you need to create all the gradle buildscript stuff (unless you wish to go with a more exotic build chain that is)
oh okay
thanks!!!
so i replace the .src with the net folder?
well the .net folder is just put inside the .src dir
bit of a code unrelated question but does anyone know how to change/hide commit details on github once they've been pushed? as in i committed something and for some reason it did it under my personal email address
this isnt a huge issue but its something id rather not have
okay thanks
its not the most recent commit though unfortunately lol
Then it gets more complicated:
Check out the commit you want to edit, amend it, then merge the latest commit again and then push that
A) Wrong channel - this is #help-server territory
B) Get rid of minetrends
C) Please learn to read errors. It's not that hard
D) Don't use old plugins in versions that aren't made for them
E) Technically you could use --illegal-access=permit, but I recommend against doing so
okkk will not happen again
wtf is that plugin doing lol
import com.sun.org.apache.xml.internal.security.utils.Base64;
There's literally an API equivalent in java.util. I have no idea how their IDE suggested they use the internal JDK class instead
And just as an aside, their encryptString() method is "encrypting" first as an md5 hash, then as Base64
Asymmetric keys but they're not very well secured
29.03 19:37:40 [Server] [WARN] [MythicMobs] AI pathfinder players is not valid for mob type MAGMA_CUBE``` Please Help
keep getting thjs error
Mob AI is mean now
A pathfinder API is no longer enough, because some mobs use brains :/
Yeah that sort of stuff started around axolotls I think
I thought it was villagers in 1.14
Then they just started using brains beyond that point but never refactored old ones
It might have been villagers
Mojank
life is fun
Why are we assemblying
It seems there is a known bug regarding the Java bytecode decompiler plugin
But they answered my ticket in less than a minute
I guess this is why I pay for ultimate
Sike... for free
Process finished with exit code -1073740940 (0xC0000374) ah shit
im trying to change some old commit details but when i get to this part i just dont know how to get out of it
how does this look like in kotlin?
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
:q?
how do i like, "confirm" what is happening here
i tricked my classmate into opening vim and we both didnt knew how to exit 💀
why is ctrl + shift + f not giving me all results?
like I am trying to see where I create some class
but it doesnt show me nearly all instances
why is deallocating a block of memory at the address from allocate giving me some weird error lol
intellij btw
can i atleast get a better exit code
nvm fixed it
I made a method that makes a player NPC crouch. The method is called by a command method in a different class. The method sends a ClientboundSetEntityData packet to the player, containing the entity data and entity ID. It can be found in the code below.
public void applyPose(net.minecraft.world.entity.Pose pose) {
npcCraftEntity.getHandle().setPose(pose);
List<SynchedEntityData.DataValue<?>> valueList = npcCraftEntity.getHandle().getEntityData().packDirty();
ClientboundSetEntityDataPacket entityDataPacket = new ClientboundSetEntityDataPacket(entityID, valueList);
connection.send(entityDataPacket);
}```
On the first try, the packet is sent, and the NPC crouches. However, when I run the command to crouch the NPC again, or run any other ClientboundSetEntityData packet, I get the following error and am kicked from the server.
```[15:15:35 ERROR]: Packet encoding of packet ID 78 threw (skippable? false)
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "trackedValues" is null
...
[15:15:35 INFO]: Cyrei lost connection: Disconnected
[15:15:35 INFO]: Cyrei left the game
If anyone can help, that would be appreciated. This may be something obvious. I'm fairly new to plugin development, especially NMS. I can send a txt file of the entire error, if anyone would like.
wait wha, why dont i need freeMemory(BASE_ADDRESS + offset)???
Like in kotlin gradle dsl?
Why are you playing with memory
its fun
Is there any way I can prevent my classes of accessing getConfig
From the main class that extends JavaPlugin
Well I can override it
But can I straight up make it appear under red line
Because I'm using a separate class file
For config management
So why
just ignore that method then
Override it and attach deprecated
Anyone have any idea how I can fix my packet issue?
here we go, a scanner and a printer in one
seems like the issue is not my build.gradle.kts but gradle refusing to set the compiler target to 8 if an optional dependency uses java 17
bruh does any one know why this is accruing?
i literally edited one line of code (not in the plugin.yml) and built the project and then it stopped working.....
it worked before
heres my plugin.yml
How are you bulding your plugin
plugin.yml is not in your jar
i am doing build artifact like i always did
Show me your artifact settings
You didn’t scroll down
just use the maven tab in the window to the right of your screen. m tab, lifecycles -> package
Click at the small + icon at the top of left. Click add file and add your plugin.yml
True, but yeah.
So I made a method that makes a player NPC crouch. The method is called by a command method in a different class. The method sends a ClientboundSetEntityData packet to the player, containing the entity data and entity ID. It can be found in the code below.
public void applyPose(net.minecraft.world.entity.Pose pose) {
npcCraftEntity.getHandle().setPose(pose);
List<SynchedEntityData.DataValue<?>> valueList = npcCraftEntity.getHandle().getEntityData().packDirty();
ClientboundSetEntityDataPacket entityDataPacket = new ClientboundSetEntityDataPacket(entityID, valueList);
connection.send(entityDataPacket);
}```
On the first try, the packet is sent, and the NPC crouches. However, when I run the command to crouch the NPC again, or run any other ClientboundSetEntityData packet, I get the following error and am kicked from the server.
```[15:15:35 ERROR]: Packet encoding of packet ID 78 threw (skippable? false)
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "trackedValues" is null
...
[15:15:35 INFO]: Cyrei lost connection: Disconnected
[15:15:35 INFO]: Cyrei left the game
If anyone can help, that would be appreciated. This may be something obvious. I'm fairly new to plugin development, especially NMS. I can send a txt file of the entire error, if anyone would like.
that was current 😳
lmao
Oh might be another one of the top things. Look for one where you can add a file at the top of the left thingy @serene sigil
can anyone tell me how i can give players permissions using luckperm?
i already got the api and everything i just have no clue on how to use it
They got extensive documentation
to extensive for me to understand x) i can barely understand anything with my english
Why are you not just using maven properly?
but that creates a bunch of other files in the plugins folder
no
Huh?
as it should
it only does that if you fucked up your pom
probably you declared the output location in the maven-shade-plugin, or even worse, in the maven-compiler-plugin
while it actually belongs into the maven-jar-plugin
those folders are teh components of yoru plugin
no, it just adds 2 other jars
they get combined into yoru jar in the target folder
if you do it properly, like this ^^, you end up with exactly one .jar in your plugins folder#
?paste your pom
if you have more than one jar you are likely shading or using nms
even if - when using the maven-jar-plugin properly, only one .jar is being put into the outputDirectory
(both ways decribed in the blog post are the proper way)
Has anyone encountered getWorld() returning null?
Yeah.
Do you know how to fix that?
if you call it too early
On what
Or you call it with the wrong worldname
How early is too early?
before onEnable
How are you calling it.
World world = Bukkit.getWorld("WitherBoss");
so in a Field
When do you load WitherBoss world
one question guys
Ah i see... I need to call it after the world loads..
Yes?
well protocols is ALL of MC's networking
I mean like, how does a server manage connections etc
not necessarily minecraft related
look in your work folder of BuildTools
hmm
how would i make all the mobs between two blocks have NoAI if they dont have PDT's?
Using Netty and tcp?
yeah
I want to make a server software with python
not because of being useful, but to learn stuff
I wonder what’s the slowest Lang you could make a server in
hmm
tbh
python is not that slow
js is my guess
It’s fairly slow by itself
yeah but it has something good
you get the c compiled files
so you can code anything in python and get the c code
but as I said, I want to learn networking stuff
rather than making something useful
.
I am on it
You won’t find a good readable example of the design principles in the obscured minecraft server code. It’s simply too big.
I guess the fastest Lang for a server would just be straight assembly
Anyone want to volunteer
assembly get's compiled to binary right?
no
could yo ucode it in binary?
yes
lithography? Not sure what printing has to do with anything
Printing is fast didn’t u know
then I missunderstud thje term
ok 🙂
asm is teh fastest, but not easy. We use high level languages like C to make life easier and coding simpler
So can every language :p
“Yeah this code is terrible but the compiler will deal with it”
Old man
its a lot of fun but definitely a thing for basement dwellers
Back in my day we just switched the bits by hand to make a program run
hwo old ar eyou?
Java got both the compiler and the JIT to optimize ur poopfest
we coded by putting holes in papers
late 50's
we actually did, but that was later. punch cards
ngl I aspire to be something similar like you
Old?
with knowledge
Anyone able to help me here? I’m getting this error
[15:15:35 ERROR]: Packet encoding of packet ID 78 threw (skippable? false)
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "trackedValues" is null
I get this the second time I send a packet to update entity data
knowledge is fine but dedication is better
We coded in Ada back in my day.
do you have any recommendations for me?
recommendations for?
Now, sorry I keep asking this. But I’ve been here for a freaking hour and a half, yet haven’t gotten a single response.
Cause we don’t know and are too lazy to investigate.
Pretty much
You are dealign with nms packets and in a completely new section introduced in 1.19.4
I just started to study networks and it systems, but after that I would like to start studying programming
yeah mb
Kinda.
This is 1.19.3
Networking is a part of computer science ya?
read up on teh basics of networkgin protocols, ACK etc
Alright, well where should I then?
once you understand packets and acknowledgement it will make a lot more sense than now
Well how am I supposed to understand packets when pretty much every resource is outdated or crap? The only way I’ve learned plugin development is by asking questions
sorry that message was to alex 🙂
No worries
Pretty much try your best. read the error, read the sourcode and protocolpage. @opaque scarab
Is there an accurate chart for what slot a certain spot in your inventory is?
have you tried getNonDefaultValues rather than packDirty()?
Well sortof?
Like if you're viewing your inventory, whats the slot number for your last hotbar slot?
No, but I’ll try it. Thanks
You can test it with the inventoryClickEvent
lk
8
depends what inventory is open and if using slot or rawSlot
this looks wrong
for PlayerInventory, what I sent is correct
yep
yeah like you sent
I'm using this in AngelChest and it's working fine
that might be the result in InventoryClickEvent getRawSLot(), but Inventory.get(0) definitely is the first hotbar item
usually raw slot numbers start at the top
getrawslot on what inventory
isnt that for 3x3
no
lemme check
thats workbench
oh
but I thought player inventory was client side
or is that just creative inventory
like obviously crafting stuff in this would send to server but still
It’s server side
creative is mostly client side
Creative is client side but creative is jank
it's super trusted by the server
2x2 crafing inv, clicking last hotbar slot
interesting
however, Inventory#getType() is different
both are CraftInventoryPlayer, but the 2x2 is InventoryType.CRAFTING, and 3x3 is InventoryType.WORKBENCH
you have top and bottom inventories
2x2
Top class: org.bukkit.craftbukkit.v1_19_R3.inventory.CraftInventoryCrafting
Top type: CRAFTING
Bottom class: org.bukkit.craftbukkit.v1_19_R3.inventory.CraftInventoryPlayer
Bottom type: PLAYER
3x3
Top class: org.bukkit.craftbukkit.v1_19_R3.inventory.CraftInventoryCrafting
Top type: WORKBENCH
Bottom class: org.bukkit.craftbukkit.v1_19_R3.inventory.CraftInventoryPlayer
Bottom type: PLAYER
so the top inventory is always Crafting, but the type differs between 2x2 and 3x3.
the bottom inventory is always Player/PLAYER
Just wanted to say thanks! That worked
yeah so it would be 45 in the workbench
didnt you ask that earlier and I already told you to use getNonDefaultValues()?
or was that someone else lol
huehue I'm vers
also yeah im pretty sure bottom type can only be player
the last hotbar slot is always 8 in the inventory.
the raw slot however is 44 in 2x2 view and 45 in 3x3 view
So I've been running into a weird issue ever since updating to 1.19.4
When spigot/bukkit fires a worldinit event, the seed given in the event does not match the seed given in the world's level dat
Has anything changed there
works fine for me
Can anyone give me a good anti xray/hacks plugin what works for 1.19.3
It happens randomly
I have multiple files registered in the bukkit.yml, and seemingly randomly the event just gives a different seed than the world's dat file
default worlds?
multiple files?
idk all I can say is that it works fine for me for all worlds
Yes
what files?
do you mean world generators?
Works on my machine is really not helpful
no idea what you mean
What is so hard to understand about this
That was someone else I think, or maybe I just missed it, sorry.
I have multiple worlds registered under the worlds key in the bukkit.yml
why that? if it would also happen to me, you'd know it's a spigot bug.
yeah probably it was someone else lol, idk
what is so hard to understand is you say "you have multiple files registered in your bukkit.yml" when Bukkit.yml has zero entries for worlds or their folders/files
There is a optional key to register a world to load, is there not?
no not in bukkit.yml
<name>: <generator>```
Then where is that supposed to go
Up until 1.19.4 it worked just fine
that doesn't load or create any new worlds by itself iirc
you always need a plugin to load/create additional worlds
so your answer to my earlier question was yes you mean world generators
The whole point of that entry is to load additional worlds on startup to my knowledge
no its not
its only specifies the generator to use
you still have to load the world if it's not a default world
according to this wiki, it does only change the generator of worlds, it doesn't load or create them
Interesting, I was told some bs then
But that is besides the point, I am still iterating through worlds and loading them manually since this expected behaviour failed
And the seeds are still wrong
how are you loading them? with an empty worldcreator?
https://cdn.discordapp.com/attachments/1070814092178227200/1090093768524431472/image.png
https://cdn.discordapp.com/attachments/1070814092178227200/1090093737083949145/image.png
hey its me again, need help to fix this issue.
im trying to help develop a server, i used to code in a completely different language but now im switching to java, so im COMPLETELY new to intelij, java, etc, im learning & picking up the pace as i code...
problem is, im importing the server project repositry, and it's giving me bukkit not being defined, i tried everything & looking everywhere for a solution and i couldn't. please help me
it works for other people, not for me
have you ran buildtools
i would have done that, BUT its a repositry
Correct
so im confused on what to do
wdym?
you still need to run builtools out of the reop
repo
?bt
you have to run BuildTools (preferrably with --remapped option) to use NMS
i cloned a repositry, which is where im supposed to start coding
Yeah you still need to run buildtools for NMS
so im not sure if im doing the right thing around here
It installs it into your local repo
download buildtools, create a new dir in downloads and follow the guide to run it for 1.18.2
do you just wanna get started on writing spigot plugins?
yup, server project has a core for everything already & event listeners for everything, so everything is pretty chill except bukkit not being defined
is this the solution?
yes
do you even need NMS?
its not their projet, their just helping with it
if that plugin does not need NMS, you can just change "spigot" to "spigot-api"
im starting with java, started a few weeks ago
i would do whatever you tell me, bnut somethign is odd
it works for other fellow devs
it doesnt work for me
they would have ran buildtools
outside of intellij
?bt on here download the lastest version, create a new folder in downloads and drag that jar in
you can easily run it using intellij
open command prompt in that folder and run java -jar BuildTools.jar --rev 1.18.2
no
you really only need to do exactly this:
- Download BUildTools.jar, put it anywhere
- Open git bash in that folder
- Enter
java -jar BuildTools.jar --rev 1.18.2 --remapped - Wait until it says Successfully built spigot-1.18.2 or sth
nothing else is needed
alright, sorry for the bother & for the annoying specifics that im giving
been trying to fix this for like a long time
ill wait until its done and let u know what happens
np, thats what this channel is for lol
You don’t even need git bash technically
I am having trouble implementing a countdown in my plugin. Can anyone help?
been using a lot for discord bot development & other stuff so i had it already
Fair
what's the issue, and what have you tried already?
I probably can't just paste code here right?
i used to just explain what im trying to do & whats the issue then post the code in another dev server
This is what I have tried whilst trying to create a timer
https://pastebin.com/gzf7AU8d
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
?paste if it’s really long
yes
yep
should i do anything else now?
import it to intelij or somethingn or does it just read it auto?
it should read it auto
looks okay to me. however why are you calling run() in in the constructor? you should rather call start()
and I wouldnt do it in the constructor, the constructor shouldn't handle logic, it should only construct the object.
- remove the run() from the constructor
- start your countdown like this:
Countdown myCountdown = new MyCountdown(...);
myCountdown.start();
Well now I just feel dumb 😅
Thanks for help
Btw your countdown will be off when tps are not 20, if you care about that, rather save the end date instead counting down by 1 every 20 ticks
I remember when everyone was afraid of y2k
And then nothing happened
Big disappointment
What's the alternative to spigot/paper which is... like a modular system?
I forgot the name
It's like a project
a lot of work went into fixing y2k
so many computer clocks had to be replaced
alex wanted to see the world burn 🙂
It's ok though alex. You might get to see a y2038k
hopefully
I'm with you if an asteroid hits, but stay away from my games
Minestom
I think I spelt that right
well it's not even remotely like spigot
It's an alternative
it has no vanilla logic builtin
It implements the paper api
But you’ll need to either make or find all the stuff you need
Even for just a basic mini games server you obviously need some vanilla logic
whut? it doesnt
it has no vanilla features (i.e. you gotta write everything yourself, if I understood that correctly), and it also doesnt have bukkit/paper/whatever api
I wonder if anyone actually uses this in productions
But I think the idea of Minestom is that
You can like create instances really easily
no clue, I only know minestom, and then those weird hybrid servers
It's made for like, generating a minigame, playing and then deleting it
So like a multi-game setup I suppose
Glowstone
It's dead
I'm confused tho
Minestom doesn't even have like a plugin structure
It's straight up, everything together
that's the point
Yeah that's fair, I guess for some people it's useful otherwise it would be discontinued
At some point you’ll probably be able to assemble a full survival server just using public libraries
Maybe that’ll be useful? Idk
I think every big big network doesn't use spigot or paper and theyh use a custom fork of either
I wonder if there are any servers I can join to see this mindstom stuff
play.minestom.net
I mean, mindstom seems like the ultimate premade setup builder lol
You can just give someone the repo and everything is already there
Can’t have shit in Detroit
ong
Why does player.damage(50.0) not damage the player at all but player.damage(20.0) does?
Looks like you can't damage a player for more than his current health lol
That doesn't seem right
Well I was running this code
@Override
public void runFor(Player player) {
if (damage > 0) {
System.out.println(damage);
player.damage(damage);
}
}
And it printed 50.0. I also got a damage animation but the health did not change
Let me try in the onEnable just to make sure I'm not messing something else up
Ah, second question of the day. Anyone know the packet to set entity position with the Mojang remappings? I’m trying to tp a player NPC
It's my own class^^
and there are no players online in onEnable unless it's a restart
I can do a reload
But I can also use a scheduler
Hmm that seems to work. Well - time to investigate
Well you can survive 20 if you ate a godapple
And I wanted it to be deadly
Poison doesn't kill you. But it's easy to workaround. I just can't get my head around on why it is not working
damage them their health if 50 doesnt work
Nah 50 does work. I found out why it happens.
Technically yes. But why do you want to save chunks?
I mean they are already saved in the world files + you can use chunk snapshots. That's why I'm wondering why you would want to save them again
declaration: package: org.bukkit, interface: ChunkSnapshot
hey there
i want to know how can i get signature and value of a minecraft skin?
dude, minecraft skin needs a signature and value
it is like a property in gameprofile of player
where property is like:
new Property("textures", value, signature);
value and signature are different strings
i got the base64 of that image
but what should i do with it? game profile texture property requires signature and value
which the only way i found to get them is from mineskin.org
is there any other ways to achieve them in code?
because i want to make a command to let players temporarily change their skin to an image link (with a specific size limit)
ALL skins come from Mojang servers. The base64 is just a URL to their servers
what base64, i don't understand
there are two strings, signature and value
decode a base64 skin and it will give you a url
wait
teh skin is on a mojang server, the signature calculated and provided by Mojang
you set those values on the server, it send the url to the client which (if the signature is correct) downloads the skin
I’m super late here, but you can get the health of the player, and set that as your damage.
https://www.base64decode.org/
i did, its not a url
i tried both signature and value base64 strings
a skin base64 is always a url (json)
All good. Using a higher value does work. I just messed some orders up which lead to setting the players health back up as soon as he took enough damage to die
Ah ok
Glad it was sorted out then
its a checksum calculated by mojang
you can't
well, how other plugins does it?
ALL skins that can be applied to a client are hosted by and come from mojang
can i make a json of that link and encode it to base64?
no, they ALL come from mojang, it's hard coded
only client mods can do custom skins
i don't want to sound uncomfortable but im sure its not
then you'd be wrong
there are plugins that let you to give them custom skin url and set them for u server side
yes and every url is to a mojang hosted skin
teh client doesn;t get any texture/skin data from the server, it only sends a mojang url
the client then downloads it from mojang
are websites like mineskin.org uploading your custom skin to mojang?
yes
thanks
oh yes u're right, they're using mineskin api:
public IProperty genSkinUrl(String url, @Nullable SkinVariant skinVariant) throws SkinRequestException {
return mineSkinAPI.genSkin(url, skinVariant);
}
mineskin uploads skin to mojang, gets the signature and value, and plugin saves that as a skin
how could i add a custom item to a chest loottable of the ancient city
Use the event ChunkPopulateEvent, then iterate through the tile-entities. Check if the tile-entity is a chest, is lootable, and is in a deep dark biome. Get the chest inventory, then add the item @ebon topaz
There might be a better way, but that’s one way to do it. You’ll want check the biome before iterating through tile-entities
you could use LootGenerateEvent
That’s much better. Didn’t know that existed
LOL
Apparently there is PacketPlayOutPosition, but what would be the mojang remappings equivalent?
so no matter what i do i need to manually handle anvil with my custom enchantments?
is there a certain way to register enchatments to make it easier to make it work with anvils?
Hi, im creating a daily shop and when i refresh it the server crash on the line for the random numbers
ThreadLocalRandom.current()
.ints(0, Math.max(4-1, 0))
.distinct()
.limit(6)
.forEach(num -> Shop.items.add(num));
//Code in the Shop (GUI class)
public static final List<Integer> items = new ArrayList<>();
StackTrace: https://sourceb.in/vJZEZGmxog
what the hell are you trying to do
why not just use the Random class?
randomize 6 numbers?
yes
for loop and Random
loops crash it the same way
what does the log say
i send them in the same under the code
I don't even know half the methods on there but I doubt you're actually getting 6 numbers
just do a normal nextint in a for loop
Generate a random array of integers in Java - In order to generate random array of integers in Java, we use the nextInt() method of the java.util.Random class. This returns the next random integer value from this random number generator sequence.Declaration − The java.util.Random.nextInt() method is declared as follows −public int nextInt()
anyone know how pathfinding goals are meant to work in nms code?
somehow I got the brain to work but I'm having a harder time with regular goals
in most cases you just have to mess with the priority for it to work properly
what goal you trying to do
custom movement goal
I am pretty sure the priority is tight
I can see it ticking too
I just can't get it to execute the movement
is it finishing before the execution?
it never finishes because it never meets the movement goal
I am dead sure I did the movement part wrong
I tried creating a path and then even tried manually ticking the path
I don't know because there is a pathing stop but no start so I don't know how to tick the logic to get it to progress
or even if I need to do that at all
may i see your implementation
you can see I've been throwing shit at the wall trying to get something to stick
I know it starts, I know it ticks, I've never seen it stop but I'm sure that's just because it never actually influences the entity's movement
your moveTo should be in the start
I think I already tried that but I am right now in the middle of rebooting to try just that
having a hard time remember all the different iterations I went thru
https://paste.md-5.net/bugegezema.java yeah see this doesn't work either
Me who tried to make sheep ai from scratch and figured out the pathfunding lib sucks
tbf half of the point of what I'm trying to do is create some wrapper over it to make interfacing with it suck less
I am still missing something here
I got ai today so maybe ill create a better pathfunding algorithm lol
I don't even necessarily want to use mojang's pathfinding solution as much as I want to figure out how they are making entities move in the first place
Anyone have any experience with the Component class
This specifically
?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!
Has Anyone Really Been Far Even as Decided to Use Even Go Want to do Look More Like?
by which of course I mean I wonder if there is an easy way to do goal cooldowns that is incorporated in the goals and doesn't require me scheduling it manually
don't think so though
entities have a tick method. you could call a timer check in there
oh it's real easy to do it's just such a banal thing to do that I was half wondering if it was already in there in some format
at least behaviors have end timestamps by default
All entities have a nbt tag called portalcooldown. If its not 0 it is auto ticked to 0
that doesn't sound like something I should touch in this context
If its not going to go through a portal it doesnt hurt anything. But my point is you dont need sceduler if its auto ticked already and only need to check for 0
But it is a cooldown already implemented. And fits what you asked
I meant it strictly in the context of goals and brain, otherwise I'll just do it manually
Not sure what the issue is. All entities have it. If the entities you have are not going through portals you have no problems
it's a library for pathfinding, I don't know if they're going through portals and I don't need to rely on such an unreliable method in the first place
Its not unreliable.
It is mainly used for portals. But anytime its not 0 the server auto ticks it back to 0
you can make all the libraries you want that rely on timers that randomly stop working if you want, i'm not taking that away from you
I won't
Ok, be a dick. It wont stop working as its part of the vanilla code.
But have fun seems you dont need help afterall
you're the one insisting on me using a timer that can randomly reset after I said I just wanted to know if there was a solution baked into goals and brains
It doesnt randomly reset
It is the amount of ticks before entity can use portal again. It is ticked to 0 every tick
so it wouldn't be functional as a timer ?
That is a timer
It doesnt reset to 0 every tick
If its at 200 that means 200 ticks
Every tick it goes down 1
Until it is 0
still not something I have any wish to rely on for a pathfinding lib
Well you didnt stipulate any requirements or that its being used ina lib where it is used outside your control
But its a timer easily accessible with very little nms for it since it is just nbt on the entity
oh endtimestamp has a pretty specific use
ItemStack holydiamond = new ItemStack(Material.DIAMOND);
ItemMeta meta = holydiamond.getItemMeta();
meta.setDisplayName("&b&lHoly Diamond");
List<String> holylore = new ArrayList<>();
holylore.add("&bThis Is The Holy Diamond And Can Do Mysterious Things.");
meta.setLore(holylore);
Player p = (Player) sender;
p.getInventory().addItem(holydiamond);
p.sendMessage(ChatColor.RED+"[NayaPlugin] "+ChatColor.AQUA+"You've Been Granted The Holy Diamond.");```
tryin to code something
this doesnt pass any errors but doesnt add name or lore to the item
You are doing it wrong i am sure because getItemmeta can return null
um
you didn't put meta back on item
but only if its air
Or if it has none
it always has one if its not air
how to do that?
or you null it
and if you can null it its stupid
But in the above code though makes no sense to fetch the item meta if its a new itemstack anyways
Just set the meta instead
yourItemStack.setItemMeta(yourModifiedItemMeta)
ok
ok so how should i handle the anvil merging with my custom enchant
lets try dat
Merging?

i got the inventoryclickevent and i check if its a anvil then how should i then check if its my custom enchant book and combine it will a tool?
Not sure what is confusing about that
You can make use pf pdc for items
Add a custom pdc thing to the item so you cab distinguish it from other items
Knew about it before it was created
Its called folia
they announced that like a month ago
i joined the test server
it only crashed twice
I rather stick to my own stuff
hypixel boutta back port it
what else is he supposed to do if he wants to give the item a name or lore
construct your own itemmeta or what 
They most likely already did something similar
There is no desync
Well the better question is does it need to be synced
No
Because i dont see why it would need to be except every so often to main thread
The regions are merged before it could ever come to a desync
ok so? then how do i handle the anvil, the enchantment combining with a tool?
No
?pdc
Hey i have a development question, my question is how can i make my own api for my plugins and are there some good tutorials?
what would a good namespace key be?
anything you can think of
should i make it the enchantments name?
If you want
PersistentDataType? what should that be if im doing enchatments
isnt here an error
Where to send the player when they die? playerRespawnLocation ==: org.bukkit.Location world: world x: 103 y: 69 z: 131 pitch: 0.1 yaw: 0.1
missing the first :
or am i dumb
it does look like a missing colon
ye
a string.
e.g.
NamespacedKey: yourplugin:enchantmentid
DataType: STRING
Value: <name-of-your-enchantment>
where do i get the enchantmentid from?
well I thought it's your own enchantments, you can make anything up for that
oh ok
e.g. if you'd add a soulbound enchantment, I'd call the id for that "soulbound"
well its a excavate enchantment so do i just put excavate?
so e.g. like this:
ItemStack myItem;
NamespacedKey enchantmentIdKey = new NamespacedKey(myPlugin, "enchantmentid");
...
PersistentDataContainer pdc = myItem.getItemMeta().getPersistentDataContainer();
pdc.set(enchantmentIdKey, PersistentDataType.STRING, "soulbound");
Player p = e.getPlayer();
ItemStack holydiamond = new ItemStack(Material.DIAMOND);
ItemMeta meta = holydiamond.getItemMeta();
meta.setDisplayName("§b§lHoly Diamond");
List<String> holylore = new ArrayList<>();
holylore.add("§bThis Is The Holy Diamond And Can Do Mysterious Things.");
meta.setLore(holylore);
holydiamond.setItemMeta(meta);
if (p.getItemInHand() == holydiamond) {
p.sendMessage("Got Holy Diamond Bruh");```
whats wrong in this code
that it isnt working
you are comparing ItemStack instances with == which is unlikely to work. I don't think that will work since an ItemStack added to an inventory is cloned so the instances will never be the same.
what should I do then?
#isSimilar
also you dont really want to create the same itemstack and metadata over and over again
Custom items should be identified by using the PersistentDataContainer of the ItemStack
im kinda new to spigot so i dont know much about "PersistentDataContainer"
?pdc
oh sure mojang go ahead and protect the core pathfinding creation method...
who would ever need that one huh
this is so lame, the only way I can set the distance the pathfinding will work for is by setting the follow range which will also mess with other stuff
?paste When unloading a world, and deleting the files after, it seems as if it always tries to save raids.dat
How much work wouold you need to update the Holograms plugin to the latest versiuon?
Try it out
that's the issue
Change the mc version in maven or whatever and see how many errors you get
idk if making a python script to migrate the holograms config to an already updated plugin
or update holograms plugin
ill try this
This one is probably easier lmao
if its your own you may wanna try out the display entities
Ooooh yea definitely
when i set the result slot of an anvil i cant get the item out of the result slot?
Those are so cool
Can’t wait to do custom blocks but easily
yeah it looks so cool ngl
DecentHolograms is already updated
I would like colored portals
ikik
Display entities are still not practical for large scale custom blocks
.
Sadly
Bukkit.unloadWorld(world, false);
deleteRecursively(worldFolder); // Standard loop over files to delete them recursively
```This seems to try and save `raids.dat`, but crashes because it can't find the file?
How can i generate 6 numbers different between them, without crashing the server
Yea but they work for like 1 or 2
What
Yes I’m gonna make a special crafting table
if i use for and while, the server just crash for a loop, i need to get 6 number unique between them
What
What
What
So how do block displays work? Are they the same stuff as an item display or are they more efficient? I know we can’t use custom model data with them just curious
They just display a block
That literally doesn't make sense, please explain better and show code
out of curiosity are custom events heavy when done at a scale?
yeah
They are not heavy
No different than built in events
I should be good to do, say
but if you spam them enough your pluginmanager will die
Sure
just do getConfig().getList(path) then use List shuffle and take the first 6 items
hm
The server does that every tick probably
thats fine
it's tricky because technically i'm putting an event based on mob movement but I think I can keep the calls low
Sending event is more or less iterating over observers list and triggering their onEvent
With reflection
I mean if you have a single redstone clock running the server is going to be firing off redstone events constantly
yeah I think it should be fine, hopefully I don't mess it up and get it to fire 3000 times per tick
the pathfinding stuff is sort of fun when you start getting into it, shame I have to do it for both goals and brains x 8 right now
the code im currently using for generating and the server just crash
final Set<String> itemsKeys = plugin.getConfig().getConfigurationSection("items").getKeys(false);
List<Integer> itemsList = itemsKeys
.stream()
.filter(item -> plugin.getConfig().getString("items."+item+".rarity").equals("Common"))
.mapToInt(item->Integer.parseInt(item))
.boxed()
.collect(Collectors.toList());
for(int i = 0; i < 7;) {
int n = TimeUtils.generate(0, itemsList.size()-1);
if(Shop.items.contains(n)) continue;
Shop.items.add(n);
i++;
}
what you mean? and its the same way for generating a number, then will be a duplicated between them
No they won’t
final Set<String> itemsKeys = plugin.getConfig().getConfigurationSection("items").getKeys(false);
List<Integer> itemsList = itemsKeys
.stream()
.filter(item -> plugin.getConfig().getString("items."+item+".rarity").equals("Common"))
.mapToInt(item->Integer.parseInt(item))
.boxed()
.collect(Collectors.toList());
List<Integer> number = new ArrayList<>();
Collections.shuffle(itemsList);
for(int i = 0; i < 7; i++) {
number.add(itemsList.get(i));
}
so in this way?
Is there a faster way spigot could’ve done this
💀
that's not even fair, the length of the goals is smth like 15 lines outside of registering values
me with the minestom sheep
Woo
Could you maybe use reflection to create an instance of an interface that just calls your function inside of your listener
Idk if that makes sense
No one's PR'd an improvement 
I've got my hands full lol
Probably not. Consumers force you to only listen for one event
choco do you wannaa comment on my PDC escape pr 😏
idk, its just a design decision rn
I mean you can only listen to one event per method anyway
I mean paper just constructs classes at runtime with ASM magic
could also use method handles
those are pretty damn speedy
I thought about trying my hand at method handles at one point, yeah
Event listeners were the first thing that came to mind when I learned of their introduction
Now choco can have 11 open PRs
?paste
How to create a list where all elements have their own serial number (which is assigned at the time of their creation and never changes)
To be able to add an object either to the first of the empty fields or to its end (empty fields have to stay after i deleting some objects from it)
alright i will give it ago
I've run java -jar BuildTools.jar --rev 1.19.4 --remapped, but how do I add this to my development environment?
?nms
i did
Anvil_Inv.setRepairCost(0);
Anvil_Inv.setRepairCostAmount(0);
nothing happen
i'm really considering just saying skrew it and just make a normal gui
Yea something like this is what I was referring to
I’m a c# guy so I don’t really know what it’s like I. Java to do that kinda stuff
No reflection.emit
Well yea, its possible and already done /shrug
😞 dam anvil issue
¯_(ツ)_/¯
I've followed this guide, but i'm getting Could not find artifact org.spigotmc:spigot:pom:1.19.4-R0.1-SNAPSHOT in spigotmc-repo
take out pom:
The /shrug has to go at the beginning and it’ll show up at the end of your message
I'm making a 3D model with blockbench, and I found out if the rotation angles are not multiples of 22.5, the textures cannot display correctly.
Is there any way to remove this restriction?
use item.getType() == or item.getType().equals() ?
==
enum
whats problem with this plugin.yml
main: org.bedwars.plugin.MotherClass
name: BedWars
version: '1.0'
description: Bedwars plugin by melon_
load: STARTUP
author: melon_
prefix: bedwars
commands:
bedwars:
aliases:
- bw
usage: /bedwars {args}```
always havin errors with plugin.yml
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:154) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot.jar:git-Spigot-21fe707-741a1bd]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 6 more```
and note i have some apis
Too old! (Click the link to get the exact time)
Jar does not contain plugin.yml
Open the .jar file with WinRAR and check.
It should be in the resources folder if you're using maven
yes
then it belongs into src/main/resources/
no im not creatin jar with maven
but 20 seconds ago you said that you use maven
compiler?
is 17
but not resources folder exists
- put your plugin.yml into src/main/resources. create that directory if it doesnt exist (which means you deleted it yourself earlier)
- run
mvn pacakageto compile
cancel EntityTeleportEvent
oh wait, it doesnt have a TeleportCause
that's weird
anyway you could check whether the EntityTeleportEvent's entity is not a player, and if the world is a different world
i love getting these errors especially when my compile time is 90 fucking seconds
because i totally have nothing better to do than recompile
lovely
I used to have 2 minute compile times
then I just got good and bought a proper pc
now it's around 800ms
my pc does this in like 25 seconds
but i'm traveling with my laptop
at least my hosting is somewhat competent and launches in about 20 seconds
the previous one took over a minute
jeez i need money for a better hosting
fuck
looks good to me
EntityPortalEvent
you could also shrink the code by putting the final condition in the canceller but that will decrease readability
it's small enough
yeah
I wonder if there's a way to make event handles even more reactive
I kinda hate seeing these code blocks
like what?
I really like functional programming but we get to a point where we actually need to use our abstractions and don't know where to put it
maybe like a
subscribe(PlayerJoinEvent.class, (event) -> {
...
});
hi, whevever i use maven package, i always get other jars in my plugins folder, how do i make it so its the same as build artifact and only makes one jar?
but honestly I'm writing my own scripting language to easily make new features
readability pain, no?
i already asked this question, but it still doesnt work
same thing
also you can skip that stuff
wait why does it take a listener class and then something else to listen
what
what the fuck
registerEvent(EntityPortalEvent.class, new Listener(){}, NORMAL, (listener, event) -> {
...
}, plugin)
could be more concise i reckon
but issa pain
?
i can't help you unfortunately but i think it'd make it easier for others if you sent your pom
what doesnt work
?paste
is that your full pom, or did you omit any plugins from that?
@tender shard
I don't believe that that's your full pom. There isn't even a maven-shade-plugin declared, yet you use dependencies like JDA etc
no, i replaced that with what u sent me
i dont get it, what did you replace? o0
why is there no maven-shade-plugin in the pom you sent?
again, i replaced it with what u sent me yesterday
.
better yet, why do you only want one jar and not 3, why does it bother you
it doesnt tell you to "replace" anything, all it says is to add the <outputDirectory> to the maven-jar-plugin
oh
I never told you to remove all the other plugins
on maven central
