#help-development
1 messages · Page 1123 of 1
A car that runs on water.
XD
rly im making a survival game
brb
can i get when players right click and left click on blocks in adventure mode?
this is very helpful, i just wish there was a way to store the amount of times a player has been killed with the item lol, so i could know how much max health that player would have
unless there is and im missing something
quick way of doing it is having two lists (two keys): one for uuid and one for the corresponding number of death
You just have to look at the corresponding index to get the value
for 1.21 plugins java 17 or 18 or + ?
"Mojang has decided to make Minecraft 1.21 require Java 21 or later"
what can i do to be sure that one amount of deaths one player has taken wont be confused for another? like if Player A dies 1 time by the weapon then Player B dies 3 times I still wanna be sure that Player A only has 1 heart missing and Player B has 3, sorry for so many questions again im pretty new to this and just wanna understand this more lol
Just add one death only if the killer of the event is the player A with the given weapon
Didnt read the complete issue but you can store one number per player in your PDC.
probably PlayerInteractEvent?
?paste
https://paste.helpch.at/yidobedete.java and
**RegionContainer** container = worldGuard.**getRegionContainer**();
return container.**get**(BukkitAdapter.adapt(loc.getWorld()));
//import com.sk89q.worldguard.protection.managers.RegionContainer//;
//import java.util.Iterator//;
Bold = red in the code
between // // = light gray in code
How can i fix thid
Tell us what the error is.
It means RegionContainer does not exist at the location you provided, nor the method #getRegionContainer
But looks to me like there are missing dependencies. Just a first guess.
Might be version mismatch between your import and what you want to use
Hey guys, im trying to download net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT.
So I tried this :
repositories {
mavenCentral()
maven {
url = "https://jitpack.io"
}
}
dependencies {
compileOnly "net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT"
compileOnly "com.github.LoneDev6:API-ItemsAdder:3.6.1"
}
but the error said :
:main:main: Could not find net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/net/md-5/bungeecord-api/1.20-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/net/md-5/bungeecord-api/1.20-R0.1-SNAPSHOT/bungeecord-api-1.20-R0.1-SNAPSHOT.pom
- http://59.4.140.144:8081/repository/maven-public/net/md-5/bungeecord-api/1.20-R0.1-SNAPSHOT/maven-metadata.xml
- http://59.4.140.144:8081/repository/maven-public/net/md-5/bungeecord-api/1.20-R0.1-SNAPSHOT/bungeecord-api-1.20-R0.1-SNAPSHOT.pom
- https://jitpack.io/net/md-5/bungeecord-api/1.20-R0.1-SNAPSHOT/maven-metadata.xml
- https://jitpack.io/net/md-5/bungeecord-api/1.20-R0.1-SNAPSHOT/bungeecord-api-1.20-R0.1-SNAPSHOT.pom
Required by:
project :main
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
how can I fix this problem?
You need to add the spigot maven repository, not just jitpack and mavencentral
I deleted -SNAPSHOT this then it work fine thanks
What
Ah bungeecord is on mavencentral now
https://mvnrepository.com/artifact/net.md-5/bungeecord-api/1.20-R0.2
is there like a plugin that makes a website like your.domain.com**:123** and on there you can play on the server if you verify and then you play as a npc but you can still buld/brake etc
Go check on #help-server, and wtf?
How do you play as an NPC
make villager noises
sounds like they just want cloud gaming but on a website
Nice
It's technically possible
If you rewrite half the game in javascript and then rewrite half the game again as a spigot fork
Anyone able to help with using Protcolib, Trying to make Armor stand glow only for certain player?
error log - https://pastebin.com/vfyb18xE
private void setGlowingForPlayer(ArmorStand armorStand, Player player, boolean glow) {
int entityId = armorStand.getEntityId();
PacketContainer metadataPacket = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
metadataPacket.getIntegers().write(0, entityId);
WrappedDataWatcher watcher = new WrappedDataWatcher(armorStand); // Initialize watcher with the armor stand
WrappedDataWatcherObject glowObject = new WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class));
byte glowingBitMask = (byte) (glow ? 0x40 : 0x00); // Use the correct bitmask for glowing
watcher.setObject(glowObject, glowingBitMask);
// Make sure to clear previous metadata to avoid conflicts
metadataPacket.getWatchableCollectionModifier().write(0, watcher.getWatchableObjects());
try {
protocolManager.sendServerPacket(player, metadataPacket);
} catch (Exception e) {
e.printStackTrace();
}
}
what version
oh, 1.21.1
iirc they updated that packet
thats why I prefer packet events haha
umm i mean it grabs the inpoets and like moves a npc/vilagar in game and you get the screen from the npc
right
thats essentially what that would be
but this kinda requires the website to be a minecraft client
which isnt gonna happen xD
Sorry, so what do I need to do? Whats changed?
i mean something like this https://eaglercraft.com/mc/1.8.8/
but then more verifycations requierd so you can't have alt acc and you can ban a player
sounds a lot like offline mode
unless you wanna like authenticate users with the minecraft account
but idk any plugin that has anything remotely close to this
what dependencies are missing then? this is my POM
https://paste.helpch.at/cumozejidu.xml
Send your errors
no suitable method found for getApplicableRegions(com.sk89q.worldedit.util.Location)
why do you have two different versions of WE
Simply means that this method doesnt exist
someone said i needed core and bukkit to fix something else
Yea but you have four in total
By using methods that actually exist
7.0.8 and 7.2.15
guard and edit
ahah
ok thanks
import com.sk89q.worldguard.protection.managers.RegionContainer; this is also not working tho
From where did you copy your code?
i had some parts of it already its the same plugin as one i had working on 1.12.2 all the other classes are working only this one not i just dont now how WG 7+ works
what are you talking about lmao
the very second sentence of their api docs tell you the repo
rad alive confirmed
no
that's world guard
wait no
I'm braindead
they're on the same repo 🙏🏻
got it kinda working still got 2 error's java: cannot find symbol
symbol: method getRegionContainer()
location: variable worldGuard of type com.sk89q.worldguard.bukkit.WorldGuardPlugin
and
java: no suitable method found for getApplicableRegions(com.sk89q.worldedit.util.Location)
method com.sk89q.worldguard.protection.managers.RegionManager.getApplicableRegions(com.sk89q.worldedit.math.BlockVector3) is not applicable
(argument mismatch; com.sk89q.worldedit.util.Location cannot be converted to com.sk89q.worldedit.math.BlockVector3)
method com.sk89q.worldguard.protection.managers.RegionManager.getApplicableRegions(com.sk89q.worldguard.protection.regions.ProtectedRegion) is not applicable
(argument mismatch; com.sk89q.worldedit.util.Location cannot be converted to com.sk89q.worldguard.protection.regions.ProtectedRegion)
This one 6 times
to create a section with some fields inside I have to do this?
The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...
The proper way would be to implement ConfigurationSerializable and save your objects directly instead of using ConfigurationSections
can you send an example?
just implement it and see what methods it has, then come back
public class Thing implements ConfigurationSerializable {
private final String name;
private final int age;
public Thing(String name, int age) {
this.name = name;
this.age = age;
}
@Override
public @NotNull Map<String, Object> serialize() {
return Map.of(
"name", this.name,
"age", this.age
);
}
public static Thing deserialize(Map<String, Object> map) {
return new Thing((String) map.get("name"), (int) map.get("age"));
}
}
FileConfiguration configuration = ...;
Thing thing = new Thing("Peter", 20);
configuration.set("some.cool.path", thing);
// later on
Thing loadedThing = (Thing) configuration.get("some.cool.path");
thank you
does anyone know how to make custom swords with skripts
I need help
I asked chatgpt but It doesnt work
This channel is for plugin development. Nobody here skripts.
oh
then can custom swords made by plugins too?
Yes ofc, plugins are much more capable than anything skript could ever produce.
But better ask at the skript discord or in #help-server
is that milk or what
what else would it be
bukkit juice

yall dont have that url in the browser?
No
hi rad
hi
damn
?tas
Best use for the apple device
real
bro i saw this exact game in arcade hackclub
tf
lmao it is from there
wait you did that stuff too
yea
@alpine urchin @onyx fjord !!
kacper got one
what round is it right now
idk
ive got one
how much is it
yea
ive got the bambu
next round would make it just 8
350
what did u make? did u submit to competition?
aw
bro how did my make it to top 50
literally
the read me is fucking shit
the best readme was for the plugin but it lost
how did this make it to top 50 bro: https://ferrumc.com
YetAnotherUselessReimplMC
sh
ut
im just doing it for fun tbh idc
made everything myself
nbt, ecs, packets, all
i voted for his
like top 2
u voted for ferrumc?
yes
whats a ferrum
iron in latin
Someone can explain to me why is it recommended to reset server instead of reloding the plugin, when changes to code has been made?
why doesn't spigot implement a reload handler & allow plugins to implement their own reloading system instead of doing whatever broken thing they're currently doing
i mean most plugins already include a reload command
cuz its spigot
usually they only reload the config
reloading a java program is rarely a good idea
you are asking for memory leaks
reloading classes is cool
only for debugging
valid point, however does it even matter during the plugin development?
I meant a proper reload handler for Spigot
Potentially
to allow plugins to do what they need on reload
Sometimes people reload, encounter an issue, and then come here for help
And it turns out the issue was reloading
I see
Also there is an event that fires on reload
ServerLoadEvent
But your entire plugin will be unloaded and reloaded first, so you can’t easily pass data to it
why is this blocked by the University of Michigan firewall
idfk
i didnt do anything on the domain
I guess to bypass that youcan run Async thread that will pass data even after your plugin is disabled
Thank you
21 now
We're huge on Java and C++ here 😭
idfk how that happened bro
They should not do that and let the plug-in do something in its reload handler
it was at 9 a few days ago :p
ayo ty bro
I mean I don’t think a full reload should exist anymore anyway
Outside of dev environments I guess
A proper reload handler should be provided by plugins
And spigot call those
Not unload and load plugins
not gonna lie, sounds like yall are looking for this ;)
https://github.com/amnoah/BetterReload
even for dev environments, you can hotswap reasonably nowadays
You can’t hotswap with mojmap NMS sadly
or can you
if you have a mojmapped server and plugin
paper 
True I guess I could just run the server mojmapped
mcp mapped spigot when
Fuck no
voldemap
hate alternative mappings, love mojmap
lol
Yarn people will beat you up
yarn ftw
This is perfect
yarn sux
@blazing ocean call your bros
no u
I’m gonna add it to my server
I'm a mojmap user
I’m a spigot user
you suck
you suck better
😳
I mean that plugin requires other plugins actually add support for it
Idk if many do
i leave for one second, and now everyone is sucking
pluginremapper for yarn when
hmm coll is cute too
I was working on making yarn spigotable
Or spigot yarnable?
W
I can do it if you want
most useless project NA
i mean sure if you implement support for custom paper forks
Easily
paperweight is great
But only for plugins, not developing paper itself
Purpur
yea ofc
the merge conflicts 💀
ok hear me out
a inventory menu system where the backend is created such that you're passing classes that implement an abstract run(player) method which is overriden per item
genius or jank
I'm thinking every genius was a little bit crazy
and run handles clicks?
yes
can you show some code for context?
simple stuff
I know it's simple
i do that too
there's a million ways to make an inventory backend
I'm just trying to pick one
and I feel like this one might kinda be cooking
illusion did smth with layers, static layer, dynamic layer based on the page, etc
cant rememeber
yeah but @echo basalt is kinda cringe ngl
?gui
dunno what i should say
wow I can't believe @lost matrix stole my code that I was about to write and then wrote and backdated a spigot post about it
is there a spigot resource post on how to sue someone for stealing your future code
would probably be more efficient to bring him a visit

Wow that’s some clean code
still default ij theme :|
@blazing ocean help dude
yes plz
where do i vote
/showcase
my little pony quest?
Tbh if I can get my ass motivated to finish my project I have made full proper reloading
🤔
wtf
💀
im not fucking winning bro
thats cool
rad's favourite game
retropoopers actualyl
damn
im not even placing top 10
19 projects and i have to vote out of 18
am i like actually actually cooked
im not fucking winning bro
fuck it im bumping my readme
what did you make?
Hey chat
i quite like that font
looks fucked
we could use it with our game
i didn't
its too compressed for my eyes
Is guns a map? Its not, right
okay but what about this 
You moved the cancelation
it is
-.-
oh yeah i did
It is
blame raydan
I myself made that map
i did not write that code
smile found something, ruuun
with my own hands I summoned it
BEAUTIFUL
what the fuck
use a non monospaced one
Is that font called "1px" by chance
that is actually kinda cool
no please
it#s called railgun
LOVE BUG IN INTELLIJ
bro it's thinner than floss
can you please just use some default font
WINGDINGS???
who doesn't love openoffice ubuntu communism redhat communism firefox postgres mandriva xfce ...
that's openlogos
Wingdings with logos?
10/10
just logos
@EventHandler
fun onPlayerToggleSneak(event: PlayerToggleSneakEvent) = event.apply {
if (player.isFlying) return@apply
guns[player.inventory.itemInMainHand]?.type?.showScope(isSneaking, player)
}```
WHAT DOES THAT MEAN
hehe
Tf does apply do here
why would you apply
its barcodes of course
Does it actually work tho
one way to find out
I don't have a barcode scanner
be so hilarious you get a barcode scanner to only find out it is a price and nothing more
also your phone can scan barcodes just fyi
What
@blazing ocean sos
help me improve readme
what do i add
i cant lose this man
send link rq
i added some diagrams
i don't think you can improve that any further
wdym
its trash rn
compared to others
i need to add more visualize things
no one reads
sure
@blazing ocean did u vote
It's actually a neat theme
There is one called Pumpkin
Yeah I know of them
Because you're a person working on a rust mc server, what's the appeal?
None of the existing plugins will work tbh
and it's harder to get into rust dev than java dev imho
its fun
to create something fast
Now buy a barcode scanner, write some code that will add all the scanned messages sequentially and then compiles the project

Work a 9-5 in home basically
😔
in this AsyncStructureGenerateEvent what is this getBlockTransformers, and why is it always returning empty?
They're used to modify blocks in the structure
It's empty because you haven't added any
Transformers allow you to modify the structure or its entities
^^ entity transformers exist too
how do I get the blocks of the structure?
What do you want to do with them
I have a rarity system (common, rare, legendary), and it is applied to blocks. I want to have a chance of a structure have all blocks rarity set to rare for example
get the Structure from teh StructureManager, then getPalette
in the AsyncStructureGenerateEvent? could you explain more please?
Bukkit.getStructureManager()getStructure(event.getStructure()).getPalette()
ok will try
but this pallet will just retrieve the pallet of blocks, not the block itself, I need the location
the location is relative to the event BoundingBox
bounding box returns an imense location (all y axis), I need just the blocks of the structure
blocks are in the palette
Anyone that knows a bit something about custom models (npcs in my opinion). dm me. or ping me here. like resource pack or smth..
you may need to use event.getStructure().getKey() with the StructureManager
play around and see
but maybe there some impostor blocks affected, not related to structure
impostor?
like a block that is in pallete, but does not belong to structure
A Structure has a defined size. The palette is an array of Blocks which are used in order (I think) y,x,z
impossible
if its in the palette its a part of the Structure
ok I'll test it
iterate the Palette and create a BlockTransformer for any Blocks you want to change
What i really need right now is a method which lets me get a Structure at a certain Location. 🫤
yeah vanilla has a locate
Pretty sure that can find structures
it can also crash the server 😦
Yeah, but those dont have a BoundingBox, at least not in the api. And locateNearestStructure is expensive.
very
and yeah only way I found to get a BB is to read it from teh StructureManager
Not so good for multipart
BB seems to be placed during generation
I dug through the internals but never found where
also includes the ability to add commands to run on reload, adding support fort virtually any plugin
plugin.getServer().getStructureManager().getStructure(event.getStructure().getKey());
is returning null
for what structure?
tested for desert pyramid and end city
with /place, and a mineshaft generated from world
see what the key is
[16:31:46 INFO]: minecraft:mineshaft KEY
@EventHandler
public void debug(AsyncStructureGenerateEvent event)
{
Bukkit.broadcastMessage(event.getStructure().getKey() + " KEY");
Structure structure = plugin.getServer().getStructureManager().getStructure(event.getStructure().getKey());
BlockDataFiler blockDataFiler = plugin.getBlockDataFiler();
for(Palette palette : structure.getPalettes())
{
for(BlockState blockState : palette.getBlocks())
{
//...
}
}
}
key is fine
um try getKey().getKey()
as you want teh Namespaced not teh Keyed
if not, no clue
the structure is valid and registered as its vanilla
NamespacedKey key = event.getStructure().getStructureType().getKey();
"Too expensive" in anvils shows up when the operation requires 40 or more levels. Can this be changed to show an operation that costs more than 40 levels or is it hardcoded into the client's code?
yes you can, but you will lost the Required msg
when you are in lack of xp
mojank
bro 😭
is there a post join event?
ugh anyone knows what the issue is? it compiles fine. invalidating caches didnt help. "Repair IDE" also didnt help
and a manual run of gradlew?
compiles fine
and the reload in the gradle tab of IntelliJ?
(if not you can just remove the gradlew directory for remake maybe...) im not a gradle certified :c
close intellij
rm -r .idea
open intellij
profit
no change
latest IDEA version?
Build #IU-242.21829.142, built on August 28, 2024
its intellij being buggy
usually helps when restarting a few times no?
maybe a plugin dying on you?
time to become a vimmer 😔
could be one of the bundled ones, e.g. java bytecode plugins
lynx has earth computer fixed vineflower plugin yet
I don't use vineflower IJ plugin
idk, my dependencies have their sources published
it's literal garbage
it quite literally errs every single second
yeah
i have no idea how they possibly published their latest update
and this :3
it used to work, then it was too out of date and refused to work, and now thats fixed it errors constantly because its trying to non null some intellij thing
time to write my own decompiler
thx, looks like it was some stupid kdoc plugin

nah the decompiler is not the issue
it's very solid
it's the intellij plugin that's hot garbage
side quest for me
make it a usable decompiler intellij plugin
a man needs something to keep himself busy with
_<
it will be written in native code if it ever happens so dunno about ij
kotlin ffi moment probably
I created a kit system and added a self-drops listnerr, how can I keep the kit item separate from other items?
You can add some persitant data container to the item showing it as a kit
The animated java plugin for blockbench was meant to export for datapacks but it appears to have a .json export feature for plugin solutions. Yet looking through this channel, I got the impression that no complete rendering engine exists for those animation.json files. Does that mean I have to create my own interpreter for the animation.json or call functions of a datapack export?
hmm, ic. Ty
There’s also FreeMinecraftModels and Aquatic model engine
from skimming over their spigot pages they appear to be more alike with what I was looking for, nothing super abstracted just some interpreter for any kind of animated blockbench files. tysm
There is any way to get a player uuid with the username? Mojang api seems to not work without no cors mode and not sending data
Off topic: now I need an answer lol. I have to understand how some programmers manage to release so many plugins in a short time. That is, you have to practically think about creating a plugin that is fully customizable for the end user, so a lot of stuff to write. Please tell me how they do it 🙂
Honestly the speed of which some programmers can go at just comes from experience and practice, say you've written several minigame systems... that being said if you are tasked with another it probably won't take all that long considering you already know the fundamentals of said system, this is pretty much the same with every project but for the most part the programmer has just been doing it for so long that they know what these plugins are going to require and have done it enough to genuienly implement it in such a speedy way
There's no shame in having to take a couple days or whatever to plan your implementation, like I said that speed will come with experience
there is this 3rd party api that sends a cors header to work in web browsers: https://github.com/Electroid/mojang-api
I ran into some issues tho, where names wont be updated until a few months after namechange but from my research only way for mojang api to work within browser
thanks mate, finally i decided to search in the database and check if the player already played on the server
we are talking about web fetch
That’s what it does
If necessary
If you need it for something outside of spigot presumably you can just check the impl
Can getOfflinePlayer be called async?
none of the two overloads are thread safe
Guh
I always run the name one async since yknow
Web request
At least I recall doing so in the past
Does it make it more thread safe :D
What if I cope harder
Does the getOfflinePlayer method cache the result?
I remember in the past that the first call is always slower than the next calls
I believe so
Maybe that's why it is not thread safe?
hey, has anybody here had problems while testing plugins that use kotlin-reflect? For some reason I'm getting this error whenever a method from this lib is executed: kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath.
I checked my resulting jar and kotlin-reflect is there :/
here's my dependencies section from build.gradle
dependencies {
library(kotlin("stdlib"))
library(kotlin("reflect"))
compileOnly("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT")
compileOnly("com.github.Slimefun:Slimefun4:RC-37")
implementation("org.bstats:bstats-bukkit:3.0.2")
implementation("co.aikar:acf-paper:0.5.1-SNAPSHOT")
implementation("io.github.seggan:sf4k:0.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0-RC2")
}
in a PDC in an item, how can i store an array (or just more that one string, whatever works really) of strings under the same key? i cant find much info online about this lol
you'll just have to serialize it to a string
or check this out
Pdc has lists now
yeah i seen that, i had a hard time finding info online to use it though, i suck at reading docs
PersistentDataType.LIST.strings()
oh dang it does too
@eternal night thank you
Isn't Plugin#getConfig() supposed to be NotNull?
indeed it is supposed
I've fucked something up royally
Did you save it
yeah, it was working perfectly fine then it just stopped working lmao
good day all
did you try invalidating caches
did you make your intellij have minecraft font? that looks cool
indeed
that's monocraft
idk it just feels like having pixel fonts your ide fonts
it feels weird
i have a lotta monospace pixel fonts but they don't really work in ides
maybe I wouldn't like it long-term but it's a cool gimmick
tbh it makes some things a lot easier to read
i'm a big fan of zed mono bold
i just don't like JBM anymore tbh
i will ALWAYS be arguing about fonts tho can't say no to that
beaver was pretty decent tho
slapduck is funny too
Hi everyone
Is this font available publicly?
yeah it's called monocraft
Nice
fuck you
you're just jealous of my great code
what pizza
the one that made the stain on your shirt
haven't had pizza in a while
are you in withdrawal?
no
have you finally stopped eating junk food or are you just back to eating rotisserie chicken for every meal
haven't had chicken in a while too
so you're just saying you've not eaten in a while
no
I was not aware you were physically capable of eating something not in these two categories
ok
so what are you eating
food
this deflection makes me think you might just be going to burger king or some equally degenerate thing
had a sandwich like an hour ago
ok so you're not actually eating healthy food yet either
had me worried for a second there
actually fun fact my cut stops today
I'm already at my target weight and I'm switching meal plans
first change since february
Twitch streamer ahh lifestyle
its not the food that makes you fat
you need to exercise and not sit on your ass all day
burn calories
work
you burn a surprising amount of calories just being alive
While with exercise you tend to get hungry and end up consuming some of the few calories you burned
Now, the key is to burn A LOT of calories and not consume that many
So exercise helps but eating less also helps
Its not the exercise per sé. Its building muscle mass so your base energy consumption rises, even if you do nothing.
if you burn more calories than what you eat, you will lose weight but mainly lose your muscles
But yeah if you just dont eat a lot you wont get fat either
it's a lot easier to eat 100 calories less than to burn 100 calories let's just say
yes its easier to eat than work
anyone with modern cardio equipment will tell you
it all also depends on your metabolism
some people eat 1 hamburger and shit for 3 days
some dont shit at all
you can also only absorb a certain amount of calories at a given moment
as in, if you eat uranium you will NOT gain like 20 million calories
At most a couple thousand
unless your body dies before
false, my friend did that once
did he become morbidly obese
It was definetly enough calories for the rest of his life
Hello, im trying to set the skin layers for my npc in 1.21.1
SynchedEntityData synchedEntityData = npc.getEntityData();
byte b = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40;
synchedEntityData.set(EntityDataSerializers.BYTE.createAccessor(17), b);
```
This is the code i looked at and it's for 1.17
I'd like to ask if anyone knows the code changes needed for 1.21.1
EntityDataAccessor<Byte> accessor = new EntityDataAccessor<>(17, EntityDataSerializers.BYTE);
SynchedEntityData.DataItem<Byte> skinLayerItem = new SynchedEntityData.DataItem<>(accessor, (byte) 127);
... // get or create List<SynchedEntityData.DataValue<?>> dataList
dataList.add(skinLayerItem.value());
creating data accessors instead of accessing the existing ones :(
might break stuff with version updates
Thanks for the help but im still a little confused as to how this works
That sets the entity datas skinlayer (id 17) to 127 which will make everything show
127 in this case is the result of a bitmask
which you sent above
0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40; is 127
here's a funky ass trick
just add the tens together and multiply by 16
or whatever
10 + 20 + 40 = 70, /10 = 7
01 + 02 + 04 + 08 = 15
7*16 + 15 = 127
crazy how numbers make math
SynchedEntityData synchedEntityData = npc.getEntityData();
EntityDataAccessor<Byte> accessor = new EntityDataAccessor<>(17, EntityDataSerializers.BYTE);
synchedEntityData.set(accessor, (byte) 127);
I tried this and the skin layers still dont show. Sorry im still pretty new to this so i'll prolly need a more full explaination.
Are you sending the entity data
What don't you understand? The bitmask, or the actual EntityData?
entitydata
Do i have to send it as a packet or something?
yes
if you've never worked with packets before you should just use Citizens
dont you need to pay for that?
no
Alright thanks for the help i managed to get the packet working with
If this is a bad or non ideal way to create the packet please do let me know
real
Are there any things that I shouldn't do on a virtual thread?
dance?
I'm using them for database operations and getting offline players
Hello. Is there a native method for retrieving playerSkin information? I just need to get a bitmap array from a players skin, I see a lot of plugins using a HTTP API for this.
Arent they just managed differently? KThreads by the OS and VThreads by the vm.
In terms of thread safety they shouldnt differ too much. At least not when it comes to Spigot.
The server never actually sees or receives the pixel data of skins. So you would have to get the skin URL of the skin you want to view, and request the image from mojangs web endpoint, which is done via an http client.
There has to be a downside to using a virtual thread to a platform thread
I mean I can probably Google that quickly
There is one downside I can think of? And that's the assuming thread identity.
Don't rely on thread identity or assuming a specific thread will execute a particular task. JVM's scheduler decides which virtual thread gets assigned to an available platform thread at any given time, so it's non-determinilistic. Don't write code that assumes a particular thread will do a task.
But where you'd ever actually assume threads in Spgiot dev? idk
a virtualthread is nothing more than the vm deciding on what platform thread to use
virtualthreads are more scalable
(iirc)
I dont see the drawback in this. Unless you allocate resources specifically for one specific platform thread.
Hm, that sparks the question how ThreadLocal references are handled in virtual threads...
I'm more talking about the behavior
not different from normal threads except their tasks are being executed by an actual thread which is decided by the vm on which to use
If 10 virtual threads with blocking operations ran on the same platform thread (by chance), are they technically blocking each other in a way?
Pretty much the same. However you can be more lenient with virtual threads. Blocking them or waiting for some IO ops in a virtual thread
is preferred to doing this on a kernel thread. You cant break it as easily because the vm can just free kernel threads from virtual threads if they
block forever.
So for IO i would give you the go. Just use VThreads.
PS: ThreadLocal is not suitable for virtual threads and the alternative (ScopedValue) is still in incubation.
But that should be irrelevant to you
So whenever a Java VThread is scheduled, the Java runtime "mounts" the VThread to a platform thread
Let's say, supposedly there was only one platform thread
because of whatever
Right
If VThreadA is scheduled before VThreadB, and VThreadA blocks for 10 seconds, does this cause VThreadB to wait 10 seconds as well?
No a virtual thread does not block the underlying OS thread
How
scheduling 🪄
I don't understand how two tasks can run in parallel if there is only one thread
The other thread steals the OS thread when its free.
There is a scheduling strategy underneath virtual threads which ensures that all threads have the opportunity to use the OS thread if its just a single one.
You could take a look at real time operating systems if you are interested in the different scheduling strategies and how you can work on multiple parallel stacks at hand.
Im not 100% certain how the vm detects when a vthread is unscheduled, but there is some sort of strategy that ensures a fair distribution of the OS threads between all virtual threads.
god wtf is mojang on
wait till you learn about the RecordCodecBuilder
RecordCodecBuilderCodec and RecordCodecBuilderCodecBuilder
RecordCodecBuilderCodecBuilderCodec frfr
Waiter there’s a codec in my codec
nah but like literally how do you serialize raw bytes
I'm going over kyori vs vanilla code rn and this is so unreadable
for some reason minimessage -> vanilla components leaves a lot of junk data
Like a gradient turns into just a "bold": false, "strikethrough": false spam
and I can't tell if there's a way to fix it
but I suspect it's in the conversion of Kyori's Styles to nms styles or whatever
prob just defaults
no because defaults are null
There are 3 states: NOT_SET, FALSE, TRUE
and NOT_SET should just.. not set it
Instead of constantly assume it's false
It could also be a minimessage thing with gradients
component compacting is a thing
they forgot to make variables final
Let’s make our own adventure!
no let's not
@onyx fjord is because he's just idfk
as well as ike
It supports any platform if you make an adapter
Well not even an adapter
adapter adapter
You will be able to precompile messages and send them directly
ﭏ
Message#send(Commands ender)
I just want components for items without jank
And by jank I mean NMS
i just want strings, anyone?
tbf that's kind of how I send configurable messages nowadays
Translatable components and fonts
messages.loadMessage("invalid-target")
.withPlaceholder("target", targetName)
.send(sender);
I have my placeholder library too
immutable builders go brr
i just have a CommandSender.sendMessage(LangKey, Object... args) extension method
I started using minimessage for that
Supports different prefixed and suffixes
Since it handles placeholders for me :p
As well as parameters for example
My placeholder:var1:var2
Supports things other than strings
so based!
Meh
supports sounds if you make the message a config section instead of a string
I’d prefer not to shade all that stuff :(
invalid-target: "Invalid target: %target%"
invalid-target:
message: "Invalid target: %target%"
sound:
key: ...
volume: 1
pitch: 0.5
still working on slowly modernizing my utilities but this is.. better
no not quite, i mean the mapping is 1:1 with os threads
:(
solid bro
were transfer packets 1.21 or 1.21.1?
i mean virtual threads are for running finite, terminable routines
1.20.5
.5
if u occupy a virtual thread forever its basically a platform thread
I still gotta make that decentralized minehut
That connects a ton of servers via transfer packets
the point was to allow virtual threads to change its underlying thread during blocking operations allowing for higher throughput
how does that make sense
oh well that way
sounds like thats just part of the jvm scheduler
this is not quite correct. Normal threads are managed and scheduled by the OS. Virtual threads are managed and scheduled by the VM. This is the main difference. Both are scalable because it really depends on the OS and hardware you are working with, just because something takes a slight bit more resources doesn't mean it can't scale since we been scaling java applications before the existence of virtual threads. One of the drawbacks of a normal thread is that it can be a costly operation to create a new thread as well as you have context switching and blocking. Virtual threads are cheaper in terms of creation and is free of the system context switching as well as not blocking.
i mean while a vthread is blocked it wont hold its carrier thread hostage
^
just lightweight tasks at this point
which is like, the entire point why its so useful depending on what u're doing
yea
kotlin coroutines?

my beloved
fun fact: everyone calls it coroutines and have no idea what it means
yea, well there's the formal definition of a coroutine
if you turn your brain off coroutines kinda make sense
until you think ab how they work and then you cry
should i just call it suspension then
accurate description of nms
its where the flow is passed between two different routines cooperatively without returning or something like that
kind of like concurrency but not quite the same
coroutines being compiled into a state machine
depends on the dispatcher you use
its not impossible
lombok moment
thing is that youd have to insert await points in running code
someone add js' async/await to java
thats just syntax sugar
you have to use bytecode manipulation to get coroutines
gonna have a hard time where to insert those yields
Time to steal borrow Kotlin coroutine code 😎
suspending functions are too
what
asyncAwaitPayment()
why are they using java in the first place..
ig they needed a gc lang cuz they have skill issues
is it possible to get an offline players skull?
I have all my players UUID's stored in a database
I was wondering if I could get the skull from the UUID
Guys can someone tell me what are command frameworks and how to use them
ah okay
declaration: package: org.bukkit.profile, interface: PlayerProfile
thanks
I could solve the problem, I changed it to implementation instead of library in my dependencies
this is how offline players look compared to online
shows as alex
Show your code
?paste
Well that's some useless code
how lol
You're not using the class that was linked to you
does anyone happen to know which SpawnReason applies to the ender dragon respawning
if theres any special one
what are the options?
because it will depend on how you want to spawn the dragon
first time?
or a respawn
thats not what im asking
what are you asking
when the ender dragon respawns, what is its SpawnReason enum type
im not looking to respawn the dragon
oh
What do you need the SpawnReason for specifically? I could only imagine the NATURAL spawn reason.
using it now and it won't show my skull correctly.
i have a list of "valid" spawn reasons where i only want such spawns to be affected by my plugin logic, but ender dragons seem to be ignored
the spawn reason was the first assumption but im just gonna test further
You need to fetch the textures with the update method
so just update it afer i've grabbed it from the profile?
Hello everyone, Is there any good way to store items? Like en ender chest clone with only 9 slots? So far I've been storing it using PersistentDataContainer but it kinda takes long using an unique Integer for each of my items and it bugs out sometimes
wdym using a unique integer?
you can use my MorePersistentDataTypes lib from maven central to use itemstacks as pdc datatype https://github.com/mfnalex/MorePersistentDataTypes
Map<Integer, ItemStack>
0 -> None
1 -> SomeItem
2 -> SomeOtherItem
Just serialize the contents array
Can you show me how xwx
I dont usually work with serialization and deserialazition
if it doesnt need to be human readable, use a bukkitobjectinput/output stream like here: https://github.com/mfnalex/MorePersistentDataTypes/blob/master/src/main/java/com/jeff_media/morepersistentdatatypes/datatypes/serializable/ConfigurationSerializableDataType.java
"could not serialization" lol
hello, I haven't been able to get it working to summon my custom ender dragon with custom ai. For now I want to spawn a default implementation of the dragon, but with the code I will provide it spawns a dragon I can hear, but cannot see? Can you just from this code see the issue? (I am using nms for very specific reasons)
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if(!(commandSender instanceof Player)) return true;
Player player = (Player) commandSender;
World world = ((CraftWorld) player.getWorld()).getHandle();
EntityEnderDragon dragon = new EntityEnderDragon(world);
world.addEntity(dragon);
return true;
}
I looked at spigot's impl. of the addEntity and they do it somewhat like that (but their function just supports every mob)
world.spawnEntity?
nms world spawn entity doesn't exist
why nms
I specifically mentioned why in my message; to add custom pathfinder goals
cant you do that with the api?
spigot only registers my custom ender dragon after I spawn it with nms
I think not because ofc you cannot just pass nms classes into native spigot functions
I know :(, but spawning at least the default dragon (like doing /summon) with nms shouldn't differ from my attempt?
so i found this, but it uses url's is there away not to use URL's?
https://blog.jeff-media.com/creating-custom-heads-in-spigot-1-18-1/
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
All skins are URLs
also what's wrong with using the update method
You're updating the profile after setting the head meta
so do it before
playerSkullMeta.setOwnerProfile(playerSkullProfile);
how would i make sure it completes?
doesn't seem to change the outcome at all
how to get into foreign projects for work like freelance ?(English, etc.)
#general message
who knows of any sites like "hhru" ))?
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/
What does ChunkGenerator#getFixedSpawnLocation determine?
it determines the fixed spawn location of a world instead of searching for a random one
if you set this within your world generator it massively speeds up world loading times
Does anyone know how I can use and send packets? I'm using IntellijIDEA and Classes like "Player...Packet" don't exist and I can't access them, I'm using Version 1.21 Spigot
The API itself doesnt have any means to send packets directly. For that you either have to use a library like ProtocolLib, or NMS directly.
What do you need packets for?
I want to make a player glow, only for one player
I'm guessing packets are needed for that
How may I use NMS directly?
?nms
5pm lol
6pm for me
When is it used, exactly?
iirc at some point during world creation
I have ran BukkitTools on my project main directory (not in src), what now? Still cant see anything
if i have a HashMap of <Player, BukkitRunnable>, and the BukkitRunnables have acces to this map and make some changes, do i have to make it thread safe? Im kinda noob in threads, maybe dumb question, should i just use synchronized word in the field declaration? (hashmap)
You should probably not have a runnable per player like that at all.
But to your question: If you schedule the BukkitRunnable normally and not as an async runnable, then it will be run on the start of each tick and there is no need for any synchronization.
What is this for? There is a better solution for what you are doing for sure.
why would you want to do that in java tho 😭
i was trying to do something, do you know what's the best way to make an item that when you hold it it gives you effect?
i dont see why i wouldnt