#help-development
1 messages · Page 1164 of 1
I don't know if I'm just too stupid, but when using Spigot 1.21.1 my plugin works and can be started. However, if I don't change anything in the plugin folder and just change the server jar to Spigot 1.21.3, I get the following error when starting the server.
java.lang.NoSuchMethodError: 'void com.fasterxml.jackson.dataformat.yaml.YAMLParser.createChildObjectContext(int, int)'
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:520) ~[?:?]
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4761) ~[jackson-databind-2.13.4.2.jar:2.13.4.2]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4667) ~[jackson-databind-2.13.4.2.jar:2.13.4.2]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3494) ~[jackson-databind-2.13.4.2.jar:2.13.4.2]
What am I missing here or has something been changed in Spigot 1.21.3?
General understanding: I use Jackson for file handling, because I need it for other things where I can't access the internal Spigot stuff
Spigot doesn't bundle Jackson
You will need to supply it yourself
Adding it as a library in your plugin.yml should fix it
already done
libraries:
- org.xerial:sqlite-jdbc:3.46.1.0
- com.github.twitch4j:twitch4j:1.21.0
- com.squareup.okhttp3:okhttp:4.12.0
- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.0
- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0
odd
Are you sure the method you're using is present in the version of jackson specified
Let me put it this way... With Spigot 1.21.1 it works - without errors. Only when I go to version 1.21.3 does the error occur.
So I would say.... Yes, the function should exist there, otherwise the error should also occur with 1.21.1 or am I seeing it wrong?
Just wanted you to double check
because I've seen people multiple times say they hadn't done any changes
while they had
I check it... only replaced the server jar - started... changed back and again...
From log:
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4761) ~[jackson-databind-2.13.4.2.jar:2.13.4.2]
In 1.21.3 the plugin is getting version 1.13.2 if I am correct.
So my assumption was that this is contained in the spigot jar.... Then the only question would be why exactly this version, since there is already 1.18.3 of it and why between versions 1.21.1 and 1.21.3 (I haven't tested 1.21.2 yet)
Yeah I was about to say that the version in the stacktrace looks off
I don't see it being loaded by the library loader neither
Could you replicate the issue without any other plugins installed
Give me moment to test it (without the other plugins)....
Here is the proof that I really only swap the versions from Spigot:
https://www.twitch.tv/morelaid/clip/RacyEncouragingWatermelonNerfRedBlaster-ltTmDol5dJyh7tWj
I guess 1.21.3 has its own Jackson now - Mojang added a bunch of libraries
oh man the funny Australian Man is speaking wisdom
But why 2.13.4.2, the current version is 2.18.1?
what
Silly question:
Can I make my plugin load a special version of Jackson (currently the plugin.yml defines which version is downloaded, but it doesn't seem to be used) without shading this into the jar (because otherwise the spigot upload size is in danger)?
hiya,
I can't seem to find anything about this online.
Is it possible to make a helmet glow? you have the glow effect which makes the whole entity glow, but I only want to make the helmet glow (the body is hidden).
But all I see online is to use the enchantment glint, which isn't exactly what I want
yeah and why jackson they're already using gson
Not silly but unfortunately not possible without making your own library loader
Okay, thtas... That helps ❤️
Not directly.
Make an armor stand wear the helmet, make it invisible & marker, teleport it to player
Make that armor stand invisible to the player (hideEntity in Player I think)
yeah so that's the thing. the armorstand gets the glow. that's what i wish to avoid.
basically it is to remove a minigame. once you've entered the minigame i want the game grid to "glow" to show which game you're selecting.
but i find it very ugly to have the full armorstand glowing
That's why you need to make the armorstand invisible ?
The armor stays visible and the helmet will have glow effect
invisible doesnt hide the armorstand tho
ah, I hadn't thought about that yet. Yeah that seems to fix it
thanks mate!
Glad the marker worked, np
BlockDisplay have glowing?
I think they do
but I thought they wanted to show a helmet
Which you can't do with display entities
exactly
block display could've worked too, but I would've chosen that as option b
If you want to show playerhead, then either display entity can do that
^^
If you only want to show heads, do use display entities.
Much better.
also item displays can be set to show as if the item was on the head
declaration: package: org.bukkit.entity, interface: ItemDisplay, enum: ItemDisplayTransform
butr item displays are quite new right? are they compatible with 1.18?
no they ain't
ah, there's the next issue :3
Why do ppl never start with the version
but the armorstand marker works fine
That's probably true, it affects the item model and I believe Minecraft uses something non-standard for regular armor rendering
yes
lol sorry mate, but tbf, we already had the solution :p
use the correct group id "com.jeff-media" and get it from maven central
yeye
Just.. in general
o
Idk why it worked my entire life
Official search by the maintainers of Maven Central Repository
https://paste.md-5.net/ariluruxuy.java
I was thinking about it and it may not be the best to be holding a reference to the main in each disc object, though I need a plugin reference to handle the tasks, that being said you guys think it'd be better to delegate this to another method somewhere else ie: a disc manager?
if you are worried about holding a reference object you could also use a static to get an instance of the main as well. Main isn't like going to disappear magically lol
it's a transitive dependency from some azure auth library
Well that is what I am doing right now
generally though you should stick with DI, but if DI isn't really needed just use the static way
It's just that I feel the disc objects should be more independent as they rely on a couple of things right now
the only disadvantage of using a reference object is that its another object, but it isn't really going to harm anything in regards to main class since as I said its not like it will just go away
Yeah fair
All the discs are the same in terms of implementation with minor differences being like disc base speed etc, so perhaps just passing the disc object somewhere else to manage the actual functionality?
It just feels quite bloated
well if all the discs are basically the same, they should be extending a base disc
They are
public abstract class Disc implements Cloneable {
private final int speed;
private final int glide;
private final double turn;
private final double fade;
private final String discName;
private final DiscType type;
public Disc(int speed, int glide, double turn, double fade, String discName, DiscType type) {
this.speed = speed;
this.glide = glide;
this.turn = turn;
this.fade = fade;
this.discName = discName;
this.type = type;
}
public int getSpeed() {
return this.speed;
}
public int getGlide() {
return this.glide;
}
public double getTurn() {
return this.turn;
}
public double getFade() {
return this.fade;
}
public String getDiscName() {
return this.discName;
}
public DiscType getType() {
return this.type;
}
public Disc clone() throws CloneNotSupportedException {
return (Disc) super.clone();
}
public abstract void handleThrow(Player player, PlayerSkills skills, String technique, BlockFace direction);
public abstract void applyDiscPhysics(Player player, ItemDisplay discDisplay, Vector initialVelocity, int maxTicks, String technique, BlockFace direction);
}
and then you should have a manager class for all these discs
that keeps track of them, the discs should really be asking the manager for information, not entirely sure what the discs would need from main
Simply just the reference to invoke the tasks
o.O
I mean the only thing that'd end up changing is removing the field reference, and just passing it to the handleThrow/ApplyTechnique methods
So really now I'm not sure if this is needed
you should have a manager that gets created in main and holds the reference, the manager should be handling the tasks or tasks delegated to it
and in there you would ideally have a task that runs every so often or when needed to do stuff
Also it should be mentioned the tasks inside the disc objects are only for visually displaying the throw
Honestly not sure if I should be worried about this cleanup right now
I still need to get the minigame system fully functional... which is difficult considering I haven't implemented any course stuff yet so the par system won't have much of an effect right now
Also I was thinking if switching to a completely event driven system would be better
This way I can handle individual's turns better within a round and what not
I mean the event classes are basically just data wrappers no?
public class GoalScoreEvent extends Event {
public static final HandlerList HANDLERS = new HandlerList();
private final Player player;
private final int holeNumber;
private final GameRound round;
public GoalScoreEvent(Player player, int holeNumber, GameRound round) {
this.player = player;
this.holeNumber = holeNumber;
this.round = round;
}
public Player getPlayer() {
return this.player;
}
public int getHoleNumber() {
return this.holeNumber;
}
public GameRound getRound() {
return this.round;
}
@Override
public HandlerList getHandlers() {
return HANDLERS;
}
public static HandlerList getHandlerList() {
return HANDLERS;
}
} ```
I'd almost argue that events should just be records
They could be
Also now that I'm looking at this event, the holeNumber should be a reference in the actual round yeah?
Oh actually I think I just did that for testing
it work only one time...
k
Pretty sure 1.21 was fully replaced
it was
lmao
on 1.21 dosent work TextComponent component = Component.text("Klick mich um die AudioSession zu oeffnen");
component.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, "https://www.spigotmc.org/"));
component.hoverEvent(HoverEvent.showText(Component.text("Klicke um zu oeffnen")));
player.sendMessage(component.content());
please help
?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!
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Did you convert it back in to a string
you need to send the component
Take a look at the adventure docs on how to do so
Ja aber ich habe schon andere varianten versucht aber ich verstehe nicht warum es nicht geht
Yes, but I've tried other variants but I don't understand why it doesn't work
sorry
It doesn't work because converting it to a string will remove the data required to make it hoverable/clickable
You need to send the component
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
yes, but these are adventure components
might be better to ask in adventure discord server
text components do
all component stuff is from bungeechat
Component.text doesnt afaik
how it work?
Hello, how can I make a block emit light in 1.21 ?
Basically, I've got a block who is not emitting light normally, and I want to make it emit light
You can put a light block next to it
yeah I thought of that
Not sure theres a method to change a blocks light level
but if I can make it be the light, that would be much easier
Am I reading this right that as of 1.21.3 in order to instantiate an AttributeModifer you are forced to either use deprecated constructors or use an experimental one?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/AttributeModifier.html
declaration: package: org.bukkit.attribute, class: AttributeModifier
Looks like it
I don't like being forced to use deprecated or experimental APIs
You can use the experimental one
The deprecated one should continue to work as well
Yeah and I'm not sure why I'm forced to reference the slot group. imo I should be able to provide null to it but it's marked as NotNull
Use the ANY slot group
It just doesn't make sense if I'm changing the generic max health that I need to give it an equipment group
You need to tell it when to give the extra health
can I use a MapRenderer to draw multiple images on top of each other without them erasing the below one? like the image I wanna use has alpha but it just overwrites all pixels on the map regardless
right
I know
the default renderer is able to draw under my images just fine though
but I cant manage to do the same
also idk what the limited about of colors have to do with it
I figured you wanted to overlay the two images and colour merge them
no I wanted to just say like if the alpha is 0, then dont actually draw a pixel
because whats the point
but now that I am trying again, I can see that it doesnt render under the images , just around it
so I might be halucinating
You could overlay the items manually ig
yeah like read the pixels of the top image and only draw the visible ones
ig that would work
also is there really no way to give the map more pixels?
rn im stuck at 128x128
Nope
Hello, does someone know how I can get to use the Faction API (Factions plugin from MassiveCraft) in order to retrieve a player's faction?
does anyone have archives of the you suck at anticheats series
https://www.spigotmc.org/resources/superstream-tiktok-gifts-streamer-vs-chat.107642/
Which minecraft should I choose to use for this?
Java
Forge
PaperMC
Fabric
Spigot
Mohist
Purpur
SpongeVanilla
NeoForge
Quilt
you are on the spigot discord server
looking at a spigotmc plugin
on the spigotmc website
i like how Java is an option lol
nono you gotta use c++
what the sigma
skibidi
You wanne use a programming language, Modloader or Pluginloader...
Choose your fate!
i wanna use prismlauncher
then do that :3
i think i'll go with binary for minimal bloating and peak efficency 
You can use many things, plugins or mods, but in the end it comes down to preference and knowledge
I see, thanks.
I'm new to Minecraft, so I'll do some research.
NO YOU WONT
Hi, my buildtools is pissing me off, everything works fine, and then there is just a random error getting out of no where
<3>WSL (11) ERROR: CreateProcessCommon:559: execvpe(/bin/bash) failed: No such file or directory
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: [bash, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:679)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
this seems like a WSL issue not a BuildTools issue
ERROR: CreateProcessCommon unless I'm wrong
it'd be helpful to post the entire log
?paste
yeah idk this is weird it really seems like it could be a WSL issue
I've never seen such a log
I mean best you can do is clear caches and try again
already tried that 😦
ill try to containerize it then :derp:
Hi, I would like to spawn NPCs using NMS, but I don't really understand how it works. Does anyone have something that could help me? I'm using Spigot 1.21.3.
Could just run it outside of wsl?
Use Citizens
how, i didn't knew it was in wsl any im using BuildTools.exe
But the problem is that I have to install it, right?
on my server
and you'll have approximately a trillion less headaches
Where can I use the dependencies?
Hm? How did you run that exe?
double click
Yes
did that too 🧓
docker's fine tho
actually ...
i need in my local repository so that's not fine at all
?1.8 
Too old! (Click the link to get the exact time)
Did i ask ?
Try running the cli instead of the gui
i believe for 1.8 you need to build a latest version first and then 1.8
wsl --shutdown ? xD
already did that too
I meant the BuildToold gui
part of your issue is that 1.8.8 doesn't build correctly the first try anymore
but again why use an almost 10 year old version
its been this way for a while
and its a not going to fix issue
you may have to compile a brand new version first
already did the latest and also 1.13
finally 🙏🙏🙏
seriously though running spigot on 1.8.8 is really fucking stupid please find a fork
i use paper
....
coding
paper support classic spigot for plugin
userdev moment
lol common 1.8 L
I love coding in 1.20, but sometimes customer ask for something in old version
imagine using outdated software
could literally not be me
also miles go review my code
U see, that's one of the reason why i hate to ask for help 👀
yeah I'd hate to ask for help if I used a rediculously outdated version too
the three major server softwares rn would not give support for such outdated version
if you use a 10 year old version you gotta know how to fix issues yourself 
that's not the point, there is a reason i need to use this version
yeah but it's not a problem with the version it's a wsl problem
and it does that with any version so the version is not the point
Wonder how many exploits that server will have unpatched
don't worry about that, that's not a playable server 😜
n = n + 1 exploits
-1L
i love how it's a long
this is a two's complement joke
only people who understand two's complement will understand it
two's complement gang 💪
?whereami
I use paper, but I have a problem with the BuildTool which is Spigot who created it, so your point is useless
i think you don't understand you are in SpigotMC discord
And I think you don't understand that I'm here because I have a problem with SPIGOT not PAPER
I can use paper and spigot at the same time ...
dw but just read next time
dw
hit em with the question mark 1.8 instead
?1.8
Too old! (Click the link to get the exact time)
we getting 1.8.8 decade old before GTA 6
seriously brother ...
Your grandpa is old and you don't throw it to the trash anyway
it was a joke bruh chill 😭
I mean you can throw it to the trash, i mean
?grandpa
see it's not that old ig
Sometimes old, dreprecated, and stinky things are just so fun to rage with 🤡
I use 1.8.8 at my own risk and I understand it, but don't just trash me cause I'm using this version for some random project.
Just for depencies it's an headache so I guess you are right, it's too old, but that's just fun to have some challenge with the older versions
and also i dont have the choice its for a customer
idk what any of that has to do with my grandpa but aight man
HES FREAKING OLD
srry 😛
?howold a
damn
Banned
Lol
what
please

any suggestion on improving this singleton design, the main idea is the object with the same value is the same in term of both value and address.
import java.util.Map;
public class AssignedSlot {
private static final Map<String, AssignedSlot> singletonSlot = new HashMap<>();
private final int slot;
private final ActivationType action;
private final boolean isPassive;
private AssignedSlot(int slot, ActivationType action, boolean isPassive) {
this.slot = slot;
this.action = action;
this.isPassive = isPassive;
}
public static AssignedSlot createAssignmentSlot(int slot, ActivationType action, boolean isPassive){
String key = slot+action.name()+isPassive;
singletonSlot.putIfAbsent(key, new AssignedSlot(slot, action, isPassive));
return singletonSlot.get(key);
}
public int getSlot() {
return slot;
}
public ActivationType getAction() {
return action;
}
public boolean isPassive() {
return isPassive;
}
}```
putIfAbsent + get can be replaced with computeIfAbsent
create instead of createAssignmentSlot
it is already referenced by the class name
AssignedSlot.createAssignedSlot sounds redudant no?
use hash and equals and instead of a map use HashSet
you could but then you'd have to create pointless assigned slots, nvm
you can have a static reusable assigned slot that you can modify in order to check if it exists in the Set
but only if you're not working with multiple threads
I wanna restart my sendActionBar timer everytime a player hits another player, and restart the inCombat timer, but i don't know how? I've added a restartTimerOnEachHit hashmap but it won't come to my brain how i'm gonna use it
Make it restartTimerOnEachHit a Set<UUID> restartTimerOnEachHit = new HashSet<>();
Add UUID playerUUID = player.getUID(); (or whatever the method is) under refreshTime for example
Add
if (restartTimerOnEachHit.remove(playerUUID) != null)
secondsLeft = defSecondsLeft;```
in the sendActionBar runnable, as first statement in run()
Then simply add the player UUID to the set when hit
I think
What is inCombat for ?
I see no reason for it to have a Long, it is not used. Could be a Set<UUID> as well.
And instead of removing a player from inCombat via a scheduled task in the handleCombatStatus, do it in sendActionBar, when the task would be cancelled. That would solve the "restarting" too.
Would also be good to change the name of the method in that case probably.
And why does the sendActionBar method have a message parameter when it is called only once and it is always the same.
I don't exactly understand the need for playerBedLocations. Can you not do player.getBedSpawnLocation() once the player has left ? Wherever you use it, you already have a player instance, this seems as a pointless waste of memory.
i use incombat to store the players who are in combat
And I don't exactly like defSecondsLeft and refreshTime in the sendActionBar method.
Those should be static final constants instead.
but i cant get the playerbedspawn location on player quit event
cuz the player has already left
it showed an error something
But you can do other stuff ? Like teleport or set health ?
I mean, sure. If that is the case then it's alright.
and i need the bed spawn, cuz when they log back in i need to tp them there
Yeye, gotcha.
i should make them final?
i put defSecondsLeft (aka define seconds left) and ill make it a config thing later
so u can change the value from config.yml
Ok, that's fine as well then.
This is what I meant btw by that. But don't if you plan on making it configurable
Just re-read my messages.
change inCombat, change restartTimerOnEachHit, change how you remove from inCombat
remove handleCombatStuff and merge it into sendActionBar?
but! i need that to be customizable aswell haha, cuz i want to set in config that you can choose from action bar text or titles or subtitles
And one small thing, change the HashMap<...> .. = new HashMap<>(); to Map<...> .. = new HashMap<>();
thats why like, if its said in config, call sendActionBar method, otherwise, call something else like titles or subtitle timers
use maps instead of hashmaps?
Sure, but if you do my suggestion to remove from inCombat in the sendActionBar then it would be silly to have it multiple times
Instead make method "send message" and there make the decision which way to send the message.
It's the same, but... I forgor the name wait
ohh sendmessage method, and the config will choose which type of message to send
what would that do though?
Liskov Substitution Principle it is called I think
Just a "better" way to do things, it helps you change the implementation later if you change your mind, much easier.
I can't explain these things as well as other ppl here can.
Speak of the devil
There’s practically zero benefit for any other parts of your code to know it’s a HashMap. All it should care about is that it’s a Map. If it then later has to change to an EnumMap or a ConcurrentHashMap, your methods and uses of the map object probably will not change at all, but if it were defined as a HashMap then you may have to update all your signatures that expect a HashMap
Obviously you may need a more specific type of map, like a Multimap, but you often want to just define your types by what you expect to use them for.
ok im gonna do my inCombat logic in the sendMessage method
That's.. not what I said
sendMessage should only decide what type of message it should send
That is it.
ok ill use ?paste next time
no just go that that website
yea yea
:)
i cry when i look at my noob ass code,
ive kinda "organized" it, and made a chain of things. PlayerHit called handleCombat method, and it calls the sendCountdownTimer method and it calls the appropriate type of countdown which is actionBar...
I remember having hte issue "org.bukkit.craftbukkit.bootstrap.Main
java.lang.UnsupportedClassVersionError: org/bukkit/craftbukkit/bootstrap/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 62.0"
I had it before long ago but I forgot how to fix it again
I tried installing java SE 18 but that didn't fix
That's cause Minecraft requires Java 21
It may not be set to 21 on your classpath though. java --version would tell you what it's using by default
Sorry, in your environment variables*, not classpath
You can either update your environment variables to use the 21 installation, or just directly invoke the java executable from your 21 install path
Either one works
the second one is great if you still wanna run servers on lower java versions
or higher
the crying never stops, even after 10 years
Is it possible for BlockPlace or BreakEvent to fire in a chunk which hasnt sent ChunkLoadEvent?
no, not unless a plugin fires the event itself
with Bukkit.callEvent?
yes
ok got it thanks
Could not load 'plugins\LetterShuffle.jar'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `org.bluenova.letterShuffle.LetterShuffle'
HMMMM
´´´yaml
I get that
HHMMMMMM
but there is no letterShuffle
S s
name: LetterShuffle
main: org.bluenova.lettershuffle.LetterShuffle
version: 1.2
api-version: 1.21.1
author: BlueNova
description: can't use the letter that it gives you
commands:
LS:
description: Letter Shuffle main command
usage: /LS <start/end>```
I am awaree
but that doesnt exit in my plugin.yaml
or gradle clean; gradle build
ChunkUnloadEvent is fired before the chunk is unloaded, right? So modifying the chunk's PDC during the event shouldnt cause issues
Yea
I have another issue
it seems Intellij keeps injecting its own plugin.yml
instead of using mine
any idea how to change that?
when I check the jar with WinRaR I see a plugin.yml that Ididn't create.
mine is different
and it's using the wrong api version (i think)
what build tool are you using?
mvn
well maybe it's maven then
how do I tell it to use this plugin.yml and not whatever this is
anything funky in your pom.xm l? Are you sure it isn't just an issue that was solved with clean
that original issue was just because I wasnt using the build tool. I was doing some old method I remember working long ago
your plugin.yml is in the src/main/resources folder ye?
oh
figured 
Yea, the one in the root of your project is not picked up by maven
that is just whatever "old" method you were using
man I've forgot so many of the basics lmao
I'vnt been developing for a while
thanks
👍
making some shitty plugin for a minecraft challenge for my channel
Hello, I've got a method triggered in a command to spawn an ItemDisplay and a light block up, Idk why, but when doing the spawn of the light block, everything after is not achieved. Here is my code :```java
/**
-
Spawn the custom block at the given location
-
@param blockLoc The location of the block
*/
public void spawn(Location blockLoc) {
blockLoc.getBlock().setType(blockInside);// BLOCK
blockLoc.getWorld().spawn(blockLoc.add(.5, .5, .5), ItemDisplay.class, itemDisplay -> {
spawnedDisplay = itemDisplay;itemDisplay.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.HEAD); itemDisplay.setTransformation(new Transformation( new Vector3f(0f), new AxisAngle4f(0f, 0f, 0f, 1f), new Vector3f(1f), new AxisAngle4f(0f, 0f, 0f, 1f) )); commonArguments.apply(this); });// TODO : Wtf not working, it blocks everything
Block lightBlock = blockLoc.add(0, 1, 0).getBlock();
lightBlock.setType(Material.LIGHT);
Light light = (Light) lightBlock.getBlockData();
light.setLevel(emittingLightLevel);
lightBlock.setBlockData(light);BountifulLib.trackedDisplays.add(spawnedDisplay);
}```
Have you made any progress here ?
you need to run .update() on blockdata to update it
Does World#getLoadedChunks return all Chunks that have at least been loaded once or does it return the chunks that are currently loaded by a player?
Oh thanks, I'll try that when I'll be home
what do the docs say
I assume currently loaded
Array of All loaded chunks
Is there a way to read the data of all chunks that have existed?
not with the api
That reminds me of aternos' "optimize worlds" feature (it breaks shit most of the time)
How else emily
without the API of course
Yea that is how its usually done
im trying to leash a player to an entity
would Entity#setLeashHolder be correct
it says
Method invocation 'setLeashHolder' may produce 'NullPointerException'
so ig this is only if they have a leash holder
how can i "create" a leash holder
oh nvm im dumb
world.loadChunk(-825, -650) - do these two integers represent chunk coordinates or world coordinates? Spigot 1.8
chunk
I know that if a UUID is in ANIMALS, it is not in wave_animals but if it is not in ANIMALS it may be in WAVE_ANIMALS. That said, what is the fastest option?
option 1:
if (MonsterRunnable.ANIMALS.remove(entity.getUniqueId()) == null) {
MonsterRunnable.WAVE_ANIMALS.remove(entity.getUniqueId());
}
option 2:
MonsterRunnable.ANIMALS.remove(entity.getUniqueId());
MonsterRunnable.WAVE_ANIMALS.remove(entity.getUniqueId());
idk im tryna do this
player.setLeashHolder(stand.getEntity());
i want the player to leash the armor stand
but nothing happens
oh ight
Assuming those are sets
how can i unleash the player later when i dont have a reference of the armorstand entity tho
the performance is negligible
Try getLeashHolder
or just setting null
The docs are a bit confusing ngl
yeah idk still not leashing
"non-living entities"
ig it doesnt work on armor stands?
An armor stand is a living entity funnily enough
why doesnt it work then bruh
hashmap
That works too
what u think more usable
second one looks cleaner
ok
gpt: "Option 2 is more efficient because it reduces the complexity of logic flow while still achieving the desired result. It directly attempts to remove the UUID from both HashMaps without additional checks, making the code cleaner and more performant"
I'm facing some issue trying to set block data Powerable to true. In my example, I am attempting to set powered rails as powered for every block in a region location:
poweredRails.forEach { region ->
region.key.toSingleBlockLocations().forEach { // <- Location object
it.block.type = Material.POWERED_RAIL
it.block.blockData = it.block.blockData.apply {
(this as Rail).shape = region.value
(this as Powerable).isPowered = true
}
}
}```
the rail does not seem to be set as powered. I have also tried delaying he set the `isPowered` by at least 2 ticks. nothing seems to actually set it to powered
dont have to add the data to the block just like item meta?
idk
apply is called on the blockdata, not on the block
how would it know the block to apply it to
unless this is kotlin voodoo magic
that line basically just sets the block data to the value of getBlockData, but also before it returns getBlockData it applies the following in {}
do i need to then 'set' the block data?
well that's what im doing
let me clarify by using the expanded method what im doing:
it.block.setBlockData(it.block.getBlockData().apply {
(this as Rail).shape = region.value
delay(2) {
(this@apply as Powerable).isPowered = true
}
return
});
Set it without applying physics
ill give it a shot
yeah that didn't seem to work.
yes
also please don't overuse it like that
or you could just onEach instead of forEach, because that's what it's made for
I don't understand the question
so datapack cheanges my world generation
so how i can do this
without putting it in a my world folder with my hands and do it throw my code
sry for my bad english i probably not an english-speaker user
in short, i want to create a small plugin that will genearate a large amount of small worlds with my datapack
hello, i have an issue, i try to moove my world my plugin's folder when i create it but it doesnt work:
private void moveToFolder(World w) {
w.getWorldFolder().renameTo(new File(main.getDataFolder(), "Maps/"+w.getName()));
}
So why are you trying to rename it like that
instead of moving it
Use the Files API and make sure the world is fully unloaded before you do so
(if you have the world instance like above it's probably not unloaded)
hmm i see, and maybe you know a way to create the world directly in a wanted folder ?
i rode thats was not possible but idk
I believe you can specify the folder path directly in the world name
when using the WorldCreator
Though I can't say if that's intended or not
okok, i'll try thx
is there a way to set a wolf's armor? i've tried using ((Wolf) entity).getEquipment().setArmorContents but it seems like this isnt even where the armor is "stored" on a wolf
Isn’t there an EntityEquipment#setItem(EquipmentSlot, ItemStack)
Or something similar
yes sir
how to measure in bytes a size of a block
you look it up
add these up https://minecraft.wiki/w/Block_properties then you also have to account for block state too
which is completely variable
boolean remember is 1 byte
tnx
good luck you've just started an nearly impossible task!
is there a packet for incoming and outgoing traffic?
so i could just grab that number instead
im doing some heavy optimizations
why
"optimization" ⭐
aka I am making some stupid optimization which ends up just being worse performance
but I don't know that yet
premature optimisation moment
do you even know why you're doing this
or are you just doing it because you don't know what you're doing
who in this world knows what they're doing without trying it first?
me
I never understand people who go to crusades like that
usually when it comes to performance, it mostly comes down to how well you can take advantage of a data structure as well as correcting seemingly innocent mistakes in your code
that leaves out a good performance without trying to be clever
what bothers me is that people always want to be clever, and that rarely gets good results on the broader scale
There are multiple types of "performance"
For example you can have an algorithm that's quite fast but uses a lot of memory
I'm looking at you Trie
You can have an algorithm that works great across multiple cores but struggles on single-core systems
You can have an algorithm that takes forever to "train" but gives great results once done (for example, sorting data)
well, when it comes to performance, you don't really think about paraellization/concurrency unless it ultimately matters, since it introdces a bunch of mental overhead which nobody likes to deal with
You only need to make it concurrent when it becomes a problem
For example, if you're scanning thousands of blocks it might be worth it to make it multi-threaded
Either big batches or really long individual processes can be done async
Sometimes you have a big batch that once done leads into a sorting process
I could probably write a blogpost about it tbh, more geared towards the minecraft community where young devs really think "async" is the magic keyword for everything
terminology go brr
here's a concrete explanation
asynchronous just means it runs independently of the main set of tasks
On the server each block state is stored once
And mapped to an integer
A chunk section normally stores the blocks in it using a palette
Normally palettes use a variable number of bits for each block, depending on how many are in that section
Minimum of 4
im trying to make a command that summons a block display at the players location starting at a small size that grows to a full size and then sets the actual block in place on the last incremeent before the size reaches the full size to prevent z fighting and then remove the block display, but im really lost on how to use the transformation stuff
Which part are you having troubles understanding
uh well my current code translates the block display instead of scaling it
its baffling me
oh misode ive used his stuff before for datapacks alonggg time ago
Ur editing the wrong value if it’s translating instead of scaling
i cant remember if im allowed to send code but this is what i have
public class BlockSummoner {
private static final Vector3f INITIAL_SCALE = new Vector3f(0.2f, 0.2f, 0.2f); // Start with a tiny block
private static final Vector3f FULL_BLOCK_SCALE = new Vector3f(1.0f, 1.0f, 1.0f);
private static final float SCALE_INCREMENT = 0.05f; // How much the block grows each tick
private static final Vector3f ZERO_VECTOR = new Vector3f(0.0f, 0.0f, 0.0f); // No translation
private static final Quaternionf NO_ROTATION = new Quaternionf(); // No rotation
private static final Material INITIAL_COLLISION = Material.FLOWER_POT;
private static final Vector3f INITIAL_COLLISION_SCALE = new Vector3f(0.6f, 0.6f, 0.2f);
public static void placeBlock(Location location, Material block, JavaPlugin plugin) {
// Step 1: Summon a small BlockDisplay
BlockDisplay blockDisplay = (BlockDisplay) location.getWorld().spawnEntity(location, EntityType.BLOCK_DISPLAY);
blockDisplay.setBlock(block.createBlockData());
// Set the billboard to FIXED
blockDisplay.setBillboard(Billboard.FIXED);
// Set initial tiny scale, with no translation and no rotation
Transformation initialTransform = new Transformation(ZERO_VECTOR, NO_ROTATION, INITIAL_SCALE, NO_ROTATION);
blockDisplay.setTransformation(initialTransform);
// Step 2: Animate the block growth using a scheduled task
new BukkitRunnable() {
float currentScale = INITIAL_SCALE.x();
@Override
public void run() {
// Step 3: Grow the block (uniformly in all axes)
currentScale += SCALE_INCREMENT;
Vector3f scaleVector = new Vector3f(currentScale, currentScale, currentScale);
Transformation growingTransform = new Transformation(ZERO_VECTOR, NO_ROTATION, scaleVector, NO_ROTATION);
blockDisplay.setTransformation(growingTransform);
// Step 4: Once it's grown bigger than the flowerpot hitbox size, place a Flower Pot for early collision
if (currentScale >= INITIAL_COLLISION_SCALE.x()) {
Block blockAtLocation = location.getBlock();
blockAtLocation.setType(INITIAL_COLLISION);
}
// Step 5: Once it's grown slightly larger than full block, replace with actual block
if (currentScale >= FULL_BLOCK_SCALE.x() + 0.05f) {
location.getBlock().setType(block); // Set the real block
blockDisplay.remove(); // Remove the BlockDisplay to prevent flashing
this.cancel(); // End the animation
}
}
}.runTaskTimer(plugin, 0, 1); // Run task every tick (1 tick = 50ms)
}
}```
oh?
Yes set the interpolation delay
It will make it animate smoothly clientside
looks a lot better
yes that
Also when spawning an entity that you plan on modifying use the spawn method that accepts a consumer
it simplifies code a lot that they're interpolated client-side
That will ensure you modify the entity before it's spawned and not after
The Transformation class is immutable so you can make it in to a constant
spawn method? sorry im not really familiar with spigot this is my first full project ive just done small stuff
and what is a consumer
It's a functional interface that's part of Java
In this case it allows you to give the method a function that you can modify the entity in
so is it like a lambda
yes
ah
Not just like
functional interfaces are commonly used with lamdas
(almost always)
any interface that is annotated with @FunctionalInterface is well, a functional interface
their main characteristic is that they have a single abstract method
ok so i should summon with spawn method, use interpolation, but any reason why my current code would be translating
haven't really looked in to why
since there's no need to keep that part of the code
(Interpolation doesn’t work directly on spawning)
lol ok
maybe the entity metadata packet is sent too late
uh so instead should i just do some delay method
runTask in the scheduler
Presumably it’s because the client doesn’t have the previous transformation yet, since the entity just spawned the same tick
You can’t interpolate from nothing to a new transformation
so it'd be fine if you set the initial transformation as well as interpolation delay on the spawn consumer and then do it again outside of the consumer
I assume they want a bigger delay, so it smoothly interpolates from x to y
yeah i dont want it instant
Delay != duration
ah ic
ah yeah, I always get the two mixed up
But yeah you don’t need to set it in the initial spawn
Just when you make the change a tick later
i found the scheduler code from a tutorial, and the scheduler seems like a core concept i havent learned yet, are there any resources on it besides the javadocs?
?scheduling
figured there would be
how does this make a difference though?
i would still need to call it to access the reference
onEach calls apply for each element
no, it's this
im confused
huh well it calls apply but not T.() -> Unit but rather (T) -> Unit
sooo
am i supposed to change anything?
so is using forEach fine then...?
why
confusing
i feel like the ex i gave was pretty straightforward
i still always find it confusing if you have bigger stuff
this is the reason I hate kotlin
people make it so unreadable
I love kotlin, but I also don't use vodoo magic DSL for anything so maybe that's why I love it?
Based
I sometimes use extension functions, but that's about it
I just searched what the difference was
turns out forEach is appropriate here since they're doing a terminal operation on the elements
onEach is the intermediate version between forEach and map. That is, I want to do something with the data but return it back as is
IJ always told me to myList.onEach { ... } instead of myList.forEach { it.apply { ... } }
well onEach isn't that
so i just assumed that was correct lmfao
oh is onEach just forEach { it.also { } } then
which kinda wouldn't make sense to do
(and then just return self)
it's just forEach but it returns the collection you just operated upon

TIL ig
yes, but if the semantics of it is for it to handle side-effects, I assume you don't want to modify the data there, even if you could
World world = player.getWorld();
world.spawnEntity(location, EntityType.BLOCK_DISPLAY);
so how do i use the consumer thing like you were saying
BlockDisplay blockDisplay = world.spawn(location, BlockDisplay.class, display -> {
display.setBlock(block.createBlockData());
display.setTransformation(INITIAL_TRANSFORM);
display.setInterpolationDuration(TRANSFORM_DURATION);
});
Question about setting blocks in the world; Needing to spawn blocks around 128 area repeatedly. Error im having is its not spawning any blocks and lags the server till it closes. Heres the code: https://paste.md-5.net/pehisekogo.java
hm? Does it not work when changing transform next tick?
didn't know you had to change the duration next tick as well
?workdistro
Thanks ill try it. but if its the code thats wrong because no blocks spawn at all, then its that.
I would figure at least some would show before it crashes
Server can get killed before that is sent to the client
thanks it works now. is there a better way to read where a map will make its mark, looks like 0/0 was incorrect
Weird it maps from -64 to 63
It’s aligned to a grid
How to appeal a resource that was removed?
?support
Should probably see why it was removed in the first place
It would take a long time to recreate the entire page again
So if it can be reinstated by contacting support I wish to contact them directly through the email
I think once it is removed it is gone and have to resubmit it. Unfortunate but that is just how it is sometimes
Gives you an opportunity to make it better
what do I put here if I wanna publish a library
it's not a plugin, just a lib for spigot
thanks, i guess ill have to learn and understand lambdas and scheduler more tho cuz the lambda part is still sort of a blackbox to me and im not fully understanding what this is doing to run stuff the next tick
https://www.spigotmc.org/wiki/scheduler-programming/#:~:text=Run a Task the Next Tick
lambdas are just syntax sugar for anonymous classes
i havent learned what an anonymous class is, is that one that isnt public? like one that cant be acessed everywhere?
the above and this:
BlockDisplay blockDisplay = world.spawn(location, BlockDisplay.class, new Consumer<BlockDisplay>() {
@Override
public void accept(BlockDisplay display) {
display.setBlock(block.createBlockData());
display.setTransformation(INITIAL_TRANSFORM);
display.setInterpolationDuration(TRANSFORM_DURATION);
}
});
are essentially the same thing
new Consumer<BlockDisplay>() { i guess i have even more learning because this syntax is also new to me
and the way that works is that inside the World#spawn method, it'd be used like this:
// actually uses generics but simplified for the sake of explaining it
public BlockDisplay spawn(Location loc, Class<BlockDisplay> entityType, Consumer<BlockDisplay> consumer) {
BlockDisplay entity = null;
/* here goes the entity creation logic */
consumer.accept(entity);
this.addEntity(entity); // this = World instance
}
i have been reading on generics cuz they keep popping up
im not sure what im looking at here
that is a new BlockDisplay class?
that would be the spawn method inside the World class, just simplified for explaining purposes
so like what is actually in the spigot implementation that im not seeing
yes
the reason the API gives you a consumer here is so you can do things to the entity before it is added to the world. You create a lambda/function that consumes the entity and does something with it, then the World#spawn method takes that consumer and gives it the entity to work with, then after your modifications the entity would actually be spawned
oh that makes sense
its like having a better way to specify what you actually want to spawn
for the entity
basically, yeah
rather than creating an "empty" entity then adding its attributes after, it modifies it before creation
is what im understanding
yes, exactly. You got it
on a side note, the new BukkitRunnable() here is also an anonymous class
so BlockDisplay.class, display is the class and name it becomes in the expression
the class there is actually used to identify which entity to spawn, since the compiler can't know what type of entity you're going to pass there without an actual object to serve as reference
ah
that's the reason there's also an overload which uses EntityType instead of a Class, they serve the same purpose in this case
what does it mean to be an anonymous class?
that it is created in the same way with a consumer?
it just means the class doesn't have a namespace
doesn't it also mean that it doesn't have an actual name
*other than the Parent$index thingy
hey
well, the name is part of the namespace
how can you find out if the world isnt loaded or if the world doesnt exist?
how can a world be loaded if it doesn't exist
but the world can also be unloaded and it theoretically doesnt exist in Bukkit.getWorld
right, so it isn't a world, it is just a folder with a world structure at that point
the easy way to go about it would just be walking through the root directory looking for folders with a region.dat file or something
if you have control of when the worlds are unloaded, save the world path somewhere before you unload it, so you can save off looking for the exact path as they may not be in the root folder
if a player tries to teleport to the world that isn't loaded, how can i know if the world actually exists and is not loaded, or if it doesn't exist? but someone could make these folders up.. by creating them in the root directory
and so the logic would fail
it isn't possible for the player to teleport to a world that isn't loaded
it is possible because i can load it with WorldCreator
but here's my question
does createWorld() from WorldCreator create the world or load it
and how to know which is which
🚬
hmm
If the world already exists, it will be loaded from disk and some options may be ignored.
that's what its javadocs say, so I assume it'll just load it if it already exists
why does that matter
we're back at the start
you need to keep track of what worlds are unloaded yourself, Bukkit won't keep track of them once they're unloaded
so, in WorldUnloadEvent, just add the world name and path to a map and you're good
you may have to write it to a file even
I do wonder whether world management plugins like MV keep track of it
yea
and mv also somehow detects worlds that were never loaded.. eg.: if you're trying out a new parkour map and you place it in the root directory
I guess it goes through the world region files or something
it does not
it just checks whether the world is one of the listed MV worlds in its config or not
if it isn't a MV world but the world is loaded, it asks you to import it through /mv import so it can recognize the world in the future
i see
if you are using the plugin though, you can just use MV's API instead so you don't have to keep track of it yourself
not related to your issue, but that usage of optionals is kind of weird
you usually want to use the functional utilities instead of dealing with the optional directly, but w/e
anyhow, I assume you're loading the home location from the configuration in that getPlayerHome method right?
but shouldn't you load that kind of thing when they join, instead of at request? It's pretty non-substantial amount of data so it wouldn't hurt just having it in memory
I think at request is better because they might not always teleport to their home
instead of loading everything at the join event
the data can also change anytime
I mean, it is up to you, I'd consider it less troublesome for all the player-related data to be loaded when they join, since in the end home locations wouldn't even amount to 1 KB of memory
then again, the outcome would still be the same, you'd just have more freedom to check whether the world is loaded or not and what to do about it (i.e., preemptively load the world if not loaded)
it's not just homes. there is a lot more
are you serializing the Location itself or its fields separatedly (x, y, z, pitch, yaw, world uuid or name)?
iirc if you do serialize the Location, it fails to deserialize when the world isn't loaded right?
if you do serialize its fields instead, then you can just check if the world is loaded, if it isn't then just load it by using the world creator
of course, you'd need a Map<String/UUID, Path> where the key would be the world name/uuid and the path would be the one you use for the WorldCreator instance, in the rare case you use a different location other than the server root directory
Typically you dont want to be dynamically loading and unloading worlds constantly as it can cause some lag in doing so. This is the primary reason mc at minimum keeps the spawn chunks of worlds loaded.
Also can cause some memory leaks
As for the home stuff just keep it in memory or make a player wrapper for it.
As for detecting if a world gets added to the world directory there is events that can be listened to in regards to directories or files being modified
That come from the jvm. But it also wouldnt be hard to just have some timer task that checks for modifications as well
FileWatcher is a fun one
Oh, sorry, Java calls it WatchService, https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/nio/file/WatchService.html
I'm getting java.lang.SecurityException: Invalid signature file digest for Manifest main attributes when using the org.eclipse.jgit library
Are you shading it?
why did md_5 add 400 new boat class types? This is just setting up another API headache in the future. It would've been better to move away from using Class as unique per entity type and use EntityType instead
To shade yes however the issue is because it is a signed library. Need to remove the signing and cert of the lib to shade it. Believe there is a plugin that does that for you not sure but typically removing the manifest directory from the lib is usually sufficient
Basically
thnaks that worked
such a shit fix though
it musnt be shading because I get this error
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jgit/api/Git
at net.xincraft.command.list.developer.maps.PullMapsCommand.execute(PullMapsCommand.java:21) ~[?:?]
at net.xincraft.command.Command.execute(Command.java:52) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
... 15 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jgit.api.Git
at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_432]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:87) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_432]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_432]
at net.xincraft.command.list.developer.maps.PullMapsCommand.execute(PullMapsCommand.java:21) ~[?:?]
at net.xincraft.command.Command.execute(Command.java:52) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
... 15 more
PandaSpigot ☠️
i sometimes forget java also has Optional since things can also be null
whats better, nullability or optionals
I give up
good for you
Depends on situation
And how you’re gonna use it
One thing for sure is that you should never be passing Optionals around
Who would use Optional with collections lol, empty collection is better.
ah
i know people who would
Who 💀
...
Fellow intellectuals need ur help real quick!
Is there any way to run an async thing on server shutdown that syncs some local stuff I have to a sqlite database?
im concerned that the server will shut down before the async even finishes running and also not sure which event to use for this
blocking on shutdown's fine, the server will wait
use your plugins onDisable
Hey, I have a 1.21 Spigot server compatible with 1.8 and when I try to make a new flat world in 1.8, the world is black and doesn't load, but when I make the world in 1.21, it works for it. Does anyone know how to fix the problem in 1.8 for it?
delete system 32 and try again later
you have an error @ the line 32 of your JavaPlugin extender class
What? As it's not a development problem.
The problem happens in normal Minecraft.
lmao
Show your pom
chat i have this line and it's throwing a nullargumentexception cause the file doesn't exist lmao what's the best approach to making a new file
plugin.saveResource("variables.yml", false);
wait nvm i'm fixin it
Create the file on your resources folder
OH THE RESOURCES FOLDER 💀
Yes sir
do you want to move a file from inside the jar to the plugins folder, or just create an empty variables.yml file in the plugins folder
the latter
then just use the Files API
you've been typing for 20 minutes @sly topaz
private static final String VARIABLES_FILE_NAME = "variables.yml";
/**
* Creates a file in the plugin's data folder
*/
public static Path generateFile(Path path) {
try {
var dataPath = plugin.getDataFolder().toPath();
// just being annoying here, as this only matters in the case the passed path contains relative directories
dataPath = target.getParent();
if (dataPath == null)
return null;
if (!Files.exists(dataPath))
Files.createDirectories(dataPath);
var target = dataPath.resolve(path);
return Files.createFile(target);
}
} catch (IOException ex) {
if (plugin.debug())
plugin.getLogger().log(Level.ERROR, "Couldn't write to the plugins data folder, cause: ", ex);
else
plugin.getLogger().warning("Something went wrong while trying to create variables.yml; lack of write/read permissions?");
}
return null;
}
var file = generateFile(Path.of(VARIABLES_FILE_NAME));
turns out creating a file properly is more annoying than I had expected
I had to test something in jshell lol
createDirectories does not throw if the dir exists, can just noop it to the front
it can throw for the directory permissions scenario
it doesn't happen that often in the context of minecraft servers, but it happens
I mean, so can all other calls there 
the only one that would throw for permissions would likely be the ones that write, since I doubt a setup would be that messed up to throw due to lack of permissions to read properties
there's apparently also the case where the directory exists but as a file rather than a directory, in which case createDirectories does throw, but idk how one can fuck that up lol
I guess one could preemptively check for permissions before writing instead of just letting it throw, but eh, it's annoying
I have a weird little problem. I want to create my own explosion but I don't know how to detect it that it was that exact explosion. My final goal is to give the player custom damage and knockback (velocity)
I spawn it ofc via World#createExplosion
If you plan on dealing custom damage and kb, why do you need the explosion in the first place ?
Breaking blocks and particles ?
Well if you need the blocks, then just use the createExplosion
And listen for the BlockExplodeEvent or EntityExplodeEvent or whatever, loop nearby players I guess is your best solution?
probably, because there is an event triggered by it, called EntityDamagedByBlockEvent that doesn't tell me the damager.
You can probably make a little workaround
'Cause I don't think you can spawn an explosion with custom data in any way
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#createExplosion(double,double,double,float,boolean,boolean,org.bukkit.entity.Entity)
Create a very temporary entity (probably a marker entity if you're on that version), then you may be able to check the explosion source entity
or even better just make my own explosion implementation from scratch
because I don't want to rely on that
Yeah don't
If you need the blocks and you want them to look the same
It's already quite bad in vanilla and Spigots block manipulation will make it even slower.
so I can:
-explode block in some radius
-spawn needed particles
-damage players if in given radius
-and give then custom kb
what do you get when listening to netty before mojang transforms them into their own packets?
i wanna listen to a packet before using mojang's api, i wonder if i can skip a few steps this way
You get a bytebuf
with the data in it
You can read wiki.vg on the packet structure and how to read certain datatypes from it
but i think wiki only contains the structure for latest no?
It has a version history you can look at
ah awesome
Do note the older you go the worse the docs get
i only need 1.17+
also, is this worth it?
i'm using sockets to send a json back and forth
and it can get larger, so i was wondering if compressing it is a good idea
Is it possible to get Id of some block, door, fence from mod through plugin?
for example get string id
We don’t support hybrid servers
I'm asking about the technicalities involved with spigot.
Spigot can’t run mods
Therefor if you are running mods either spigot you are using some sort of hybrid fork that adds their own APIs
spigot/bukkit api has method for get string id from block?
No
Or getKey
or that
But this assumes the fork injects modded materials into the enum
that is preferred
it is known that almost hybrids do that
honestly when i think about it Skript as a whole is not a bad concept
sure its a bloat on top of already existing java runtime
but no one's stopping the community to create Skripts which work across bedrock and java
That's an interesting idea
basically cross compatible plugins
Using it as an abtraction from programming language?
yea
Basically you use Skript syntax and build Skript runtimes based on the server architecture
just like JDK
So, skript that works on:
Spigot (and derivatives)
Forge (and derivatives)
Fabric (and derivatives)
Bedrock (dunno what software there is for that)
And stuff like that?
Kinda yeah
we have datapacks but they're kinda limiting
also on bedrock there's dedicated scripting api
but that's specific to bedrock only
Yeah I know
Js
Wrote some behaviour packs in the past
building Skript runtimes on top of already existing codebases, like if you're running Spigot you're using Spigot SkRE, if you're using Bedrock you use Bedrock SkRE, if you're running sponge you use Sponge SkRE etc etc
i would even go as far as not using bukkit or sponge api's altogether and hook it directly to NMS
what obaut blockData
the problem i can currently see is with bedrock is that its not completely in par with Java edition but that gaps is closing real fast
scripts this is like mod ?
You can probably still make it work, somewhat
Skript is a plugin for Bukkit API based server software which allows you to write very human readable interpreted .sk scripts dedicated for controlling server's behaviour
basically programming language of minecraft's server functionality
for example
command /gmc:
permission: tutorial.creative
permission message: &cYou do not have permission to use this command
trigger:
set player's gamemode to creative
send "&aYour gamemode has been set to creative." to player
you mean addons?
no
im confused
its completely different language
you install Skript plugin in spigot
then add your .sk script in plugins/Skript directory
./skript reload all
voila
you made a script
this is a skript
this is like addons
not sure what you call addons but whatever
its an old thing
it existed since at least 2011 iirc
its still very contraversial part of minecraft server community, as devs despise people writing them
since they treat such scripts as a kid's version of plugins
skript is finee for really small stuff
but then seeing people make bigass minecraft events & servers with it
fucking hurts my soul
and then wonder why it's slow
and then have like a trillion skript reflect usages
but i think its not so bad as people might call it because having universal language to control the server is not inherently bad
its just gets bad rep because there's no cross platform support, so you cant really do cross compatible scripts with it
i see now. In russian this calls "addons". I have seen such cases when developing plugins
but this is a very rare thing in the server
I never found a use for them
the skript anticheat
