#help-development
1 messages Ā· Page 1012 of 1
so the server can't teleport an entity every 10 ticks to a new location? but it can't do so consistently every time?
I didn't say it couldn't do it, you never gave a proper testing environment
therefore hard to say if it isn't because of something else going on or whatever else. I already explained that the server will skip ticks
even when you believe you have nothing else going on simply because of hardware and settings
second, everything is a priority. Some things take higher priority in the server EG spawning vs teleporting for example
if something needs to spawn, it will spawn before a teleport needs to be done
this is because teleporting doesn't need to be instant and it can be delayed safely
probably should look at the code for teleporting if you are really this curious
also the way you are reporting the entities location is flawed as well
also have to take into consideration that what is shown by the server via your debug message and what you visually see are not always going to match up either
due to the fact, that the packets for messages and packets for world updates/entities moving are different ones
right, this stuff makes sense, and I think that I am just not explaining it well enough. I am going to try to post a video on the spigot thread showing what is happening. The only reason why I think it's not Bukkit skipping ticks is its consistent every single time I run it. However I could be wrong about that I just thought that if it were lag or Bukkit the results would be inconsistent. So I will attach a video to the spigot thread soon showcasing what is occuring. Again, sorry if I wasn't explaining it well enough before
I also stated the way you report the entities location is also flawed
I am thinking about creating a web interface for a banking plug-in. What do you suggest for the web part? It would retrieve data from a database.
Would you use a Python server or a Java Spring one?
heard people telling svelte is the shit
Use what you're most familiar with
If you want Java you can use Spring
but if it's just a simple application something like Javalin is easier to work with
Regarding a Java Spring server, do you think saving the web server as a JAR file, placing it in the plugin's data folder, and running it is a bad practice? I've never done something like that before (mixing the two), so I am seeking some kind of guidance š¤£
Thank you so much!
iit looks exactly like react tho
what you're saying seems right. Is there any way then to teleport an entity every x ticks like this? or is teleportation simply not an option? and if teleportation isn't an option, is there anything else I can do to move a block from A to B in x seconds? I know I can probably use velocity vectors but they would be difficult to get exact.
If you want precise movement use BlockDisplay
Spring will probably be a bit too big for that
but you can if you want to
for embedding in a plugin I'd use Javalin
you can teleport entities, It just isn't reliable to be precise in terms of timing is all. ElgarL gives a good option in terms of being precise. Also, using velocities isn't all that difficult, just some basic physics math
but I am curious though if you changed your flaw reporting of location if it would reveal that it has been teleporting as you would expected
or nearly so
yeah if block displays work that would be perfect, I forgot about that
what is this flaw of reporting?
ent.teleport(loc.add(0.5, 0, 0)); //LINE A Bukkit.getPlayer("FireballAlex1").sendMessage(ent.getLocation().getX() + ""); //LINE B
this
yes but what would you change it to?
its flawed because the teleporting is not instant, and since there is no delay between those two pieces of codes, the location sent to the player could be the old location.
instead of doing it like that, try listening for the teleport event instead
this way you have both the previous and updated location and its guaranteed to be accurate also, the event fires on every teleport
thank you for this, I completely forgot about blockdisplays and they work perfectly
Hello, how can I get the obfuscated nms' method/field/class in a specific version using the intermediary mappings of this specific version?
and then, for sure, manipulate the method/field/class
(Trying to do that, see https://discord.com/channels/690411863766466590/1243264378522959914 for more details)
what event gets fired when the player changes their current select hotbar slot?
PlayerItemHeldEvent ?
InventoryClickEvent
would the client let me send a cheeky packet and change the currently selected slot or no
what a nice guy this client is
oh you want to send a packet from server to client?
don't think you could make it change the highlighted selection on the client
ye
3
interesting, I guess you can change the selection
but only for the hotbar
which is what they want @shadow night
nice
how would I add durability to a vanilla item that doesn't normally have durability
next MC version
so no way to do it rn?
ItemStack item = new ItemStack(Material.DIAMOND);
Damageable damageable = (Damageable) item.getItemMeta();
damageable.setMaxDamage(100);
damageable.setDamage(10);
item.setItemMeta(damageable);
I know ItemMeta is all Damageable, but I didn't think it worked on vanilla items
kotlin
kotlin
pavlovian response
I tested and no, thats now my question:
How i make that the diamond would lose durability if i break some blocks?
xd
just like me, yoursalvation and ocp
listen to blockbreakevent and change the durability accordingly
Hell nah, fr? I have to do it myself? I thought minecraft had something .-. xd
In 1.20.5 Update changelog is a minecraft:tool section:
Where you can set damage taken by block break etc, is that implemented in the itemstack because i dont find anything about that
also how do i make a crafting recipe that uses all 9 slots
shaped or shapeless
it uses all nine slots so shaped ig
create a shaped recipe and set the shape method to the 3 rows
how do i make a shaped recipe lol
ohhh
then use setIngredient(char, ingredient)
alr thanks
API for it is WIP
It's just hard to deal with serialization and deserialization because you can use either a block type, a list of block types, or a tag
Being able to distinguish between those is a bit awkward
How would I go about making an NPC with a nametag that has 2 rows? Should I just have a display entity with text below the NPCs name? No name and two rows? Or is there another way?
You need a text display
No name and two rows is probably the easiest method to manage
So say the person creating the NPC wants to despawn it, should I just do a quick entity search and delete both? That feels a bit hacky
You can just keep track of the entities in a map or smth
Never messed with entities, but don't their IDs or something change?
They shouldnāt
Personally id go with a Wrapper object for the NPC
Make a private field to hold the name as an array of strings. Then a private field to hold the UUID of whatever you spawn
Then like the others said, set the NPCs name to nothing and just use the text displays to show your lines of text above
It would be easier cause you can literally make the constructor of your Wrapper just do the entire NPC creation, so everytime you want an NPC youd just do like MyNPC npc1 = new MyNPC(name, location, other params) and that will spawn it and return an instance to use
Yeah that makes sense, thanks for the advice
I wanna use placeholder api for my plugin's scoreboard, but since placeholder api requires a player object to solve the placeholders, does that mean I need a scoreboard for each player individually?
or what is a better way to organize it
Gamers. Im removing the message x/y players sleeping. Before i start fetching the packet, does someone know if there is a gamerule or config entry
which disables the message?
there is not
is it me or did smile come back from the dead
dispatch command is executing 2 times
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
check the hand
ok thx
how do i check if a block is ANY type of log
i'd rather not make a condition for every type of log
theres probably some Tag.LOGS::isTagged
Was bouta say that
how would i put that as a condition in an if statement?
look at the javadocs of isTagged
got it, thanks
hi , if i want for example to use fawe in my project what kind of libraries i need to add too?
this is for 1.16.4 ..
World edit api
can you send me the maven setup?
Just google world edit maven
been trying for hours ,-,
xD
i get problems with java editons when i try to use worldedit , and fawe
idk why
Wdym like outdated java version?
yeah can't build the plugin ..
Shiw the error
i tried ..
maybe restarting your ide
or did you maybe delete any of your depencys that you added maybe any jar file in your downloads or sum?
omg
I have a custom spawners plugin
does anybody know how to set that the spawner condition will be any region? Like for example iron golems only spawn on ground and pigs spawn on grass and I want them to spawn on air
Are you the dev
or a server owner?
the dev
Check if theres a spawner entity spawn event
or smth
If something like that exists, check the block below the to be spawned entity, deny spawn if it isnt what you want
There's a SpawnerSpawnEvent but the thing is it runs as the mobs spawns by the spawner, The problem is the mobs doesn't spawn when the spawner is mid air
only it it's specific conditions
Ig, you could cancel the event if its ever fired, then have your own random spawning
Does the potion have a time tag?
time tag?
you have it in the code
I am confused
You'd have to check, if you need to add the time directly to the bottle, im not sure, if it transfers the time from the potioneffect to the provided lore
So for now i have this :
but
its still not working?
this is for 1.16.5 and probbly older i have 2 system one for 1.19++ and one for 1.18-- older
Im having a bit of an issue with 1.20.6 and NMS. 1.20.6 needs java 21 to build plugins but then I get this from the special source plugin
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.3:remap (remap-obf) on project v1_20_R4: Error creating remapped jar: Unsupported class file major version 65 -> [Help 1]
update the specialsource plguin to 2.0.3
thank you
Show your pom
same error, ill change the group id
cannot access org.bukkit.command.CommandExecutor
I changed plugin.yml too
When are you getting that error
Have you tried invalidating caches
Looking for someone to help test my plugin and give some feedback. it requires 1.20.6 and java 21+. it handles entities custom entity armor, items, size etc. (no custom AI, yet)
Youāre not really gonna find anyone here, you might get lucky but Iād look somewhere else
suggestions where?
not playing minecraft, no š
Well like I said you might get lucky here
If you mean testing as in testing multiplayer features, you could get an alt account?
Minecraft is on sale at $15 rn you can buy an alt fairly cheap
have alts, but ty for the suggestion š
You can just use offline mode to test and load as many offline accounts as you want and need
gang i have an idea and i need your opinion on it
i'm not the best artist but this is a side view of a super flat world
on the left, we have a lobby that is filled with people and joy and whimsy
on the right, a desolate lobby that is in peak pristine condition with nothing tampered and nobody is allowed to interact with
my idea is the left is filled with cool trinkets and stuff that people can play with
but i wanna be able to reset the lobby on the flick of a dime!
idk wh y i said that
anywho
is there a good method of like
basically just replacing the left (player filled) lobby with the right one
including chest nbt data and piston nbt and entities (bc armor stands)
this is a lot idk how to go about this
What are you trying to do exactly?
i kinda explained the whole thing
i wanna essential copy right lobby and paste it over left lobby
so it resets it
Get sample world and copy it to new world then redirect people there.
wdym
Yes definitely
Use something like redis to copy world data
Then paste it on other server
Or just have a master copy and use smth like SWM
- In memory database which is super fast and used to talk between servers
- Slime world manager
Super fast, efficient world loader
Which is probs what you want
is there like a good tutorial i could follow
Their wiki is pretty straightforward
im trying to use the plotsquared api but i get a ClassNotFound error on all event classes. i tried changing compileOnly("com.intellectualsites.plotsquared:plotsquared-core") to implementation so it adds the classes to the fat jar, but doing that breaks other stuff (like the api not being able to get the instance of the plugin). this is how im adding the dependency to the project:
implementation(platform("com.intellectualsites.bom:bom-newest:1.45"))
compileOnly("com.intellectualsites.plotsquared:plotsquared-core")
compileOnly("com.intellectualsites.plotsquared:plotsquared-bukkit") { isTransitive = false }
this is how i register the events inside onEnable:
import com.plotsquared.core.PlotAPI
// onEnable
PlotAPI().registerListener(PlotSquaredEvents)
this is the class
import com.google.common.eventbus.Subscribe
import com.plotsquared.core.events.PlayerBuyPlotEvent
import com.plotsquared.core.events.PlayerClaimPlotEvent
import com.plotsquared.core.events.PlotAutoMergeEvent
import com.plotsquared.core.events.PlotMergeEvent
object PlotSquaredEvents {
@Subscribe
fun onPlayerBuyPlot(event: PlayerBuyPlotEvent) {
println("${event.plotPlayer.name} bought ${event.plot}")
}
@Subscribe
fun onPlayerClaimPlot(event: PlayerClaimPlotEvent) {
println("${event.plotPlayer.name} claimed ${event.plot}")
}
@Subscribe
fun onPlotMerge(event: PlotMergeEvent) {
println("plot merge ${event.plot}")
}
@Subscribe
fun onPlotAutoMerge(event: PlotAutoMergeEvent) {
println("plot auto merge ${event.plot}")
}
}
i added PlotSquared to softdepend in plugin.yml, so idk what else to try, any idea? these are the docs i tried to follow https://intellectualsites.gitbook.io/plotsquared/api/api-documentation
Dumb question but you do have PlotSquared in your plugins folder right
yes
and i compiled it myself btw, without any modifications, i didnt get the jar from the forum, i dont think that matters but just in case
As long as the package names are the same it should be fine
Decompile the jar and double check the package names
Have you tried not kotlin?
yea, besides i dont get any error with the plugin itself, i tried doing Bukkit.getPluginManager().getPlugin("PlotSquared") as BukkitPlatform and PlotSquared.get() and its all working
you mean the event classes?
why should i
Because maybe it doesn't like kotlin
Yeah decompile the plugin jar and look if they are inside
Or yeah, could be a kotlin thing
how? can that happen?
ill try tho
my own? or the plotsquared jar?
Those method signatures might not be what it expects or something
I don't know kotlin, it's just an idea
Plotsquared
com/plotsquared/core/events/PlotDeleteEvent.class
com/plotsquared/core/events/CancellablePlotEvent.class
com/plotsquared/core/events/EntityEvent.class
com/plotsquared/core/events/PlayerAutoPlotEvent.class
com/plotsquared/core/events/PlayerAutoPlotsChosenEvent.class
com/plotsquared/core/events/PlayerClaimPlotEvent.class
com/plotsquared/core/events/PlayerEnterPlotEvent.class
com/plotsquared/core/events/PlayerLeavePlotEvent.class
com/plotsquared/core/events/PlayerPlotDeniedEvent.class
com/plotsquared/core/events/PlayerPlotHelperEvent.class
com/plotsquared/core/events/PlayerPlotTrustedEvent.class
com/plotsquared/core/events/PlayerTeleportToPlotEvent.class
com/plotsquared/core/events/PlotAutoMergeEvent.class
com/plotsquared/core/events/PlotChangeOwnerEvent.class
com/plotsquared/core/events/PlotClaimedNotifyEvent.class
com/plotsquared/core/events/PlotClearEvent.class
com/plotsquared/core/events/PlotComponentSetEvent.class
com/plotsquared/core/events/PlotDoneEvent.class
com/plotsquared/core/events/PlotEvent.class
com/plotsquared/core/events/PlotFlagAddEvent.class
com/plotsquared/core/events/PlotFlagEvent.class
com/plotsquared/core/events/PlotFlagRemoveEvent.class
com/plotsquared/core/events/PlotMergeEvent.class
com/plotsquared/core/events/PlotPlayerEvent.class
com/plotsquared/core/events/PlotRateEvent.class
com/plotsquared/core/events/PlotUnlinkEvent$REASON.class
com/plotsquared/core/events/PlotUnlinkEvent.class
com/plotsquared/core/events/post/
com/plotsquared/core/events/post/PostPlayerAutoPlotEvent.class
com/plotsquared/core/events/post/PostPlotChangeOwnerEvent.class
com/plotsquared/core/events/post/PostPlotDeleteEvent.class
com/plotsquared/core/events/post/PostPlotMergeEvent.class
com/plotsquared/core/events/post/PostPlotUnlinkEvent.class
com/plotsquared/core/events/RemoveRoadEntityEvent.class
com/plotsquared/core/events/Result.class
com/plotsquared/core/events/TeleportCause$CauseSets.class
com/plotsquared/core/events/TeleportCause.class
thats the output of jar -tf plotsquared-bukkit-7.0.1-SNAPSHOT.jar | grep com.plotsquared.core.events
there are none of the event classes that i care about apparently
Version mismatch then presumably
meaning they didnt exist when i compiled the plugin? it was a long ago iirc, a few months, more than a year maybe
Are they even in the code you compiled?
Make sure you depend on the same version as you use on your server
idk i should check that
the gradle dependency doesnt even has a version, does it mean use the latest?
Id assume itās latest
those classes doesnt exist on the repo i used to compile it, and it seems they were added 4 months ago https://github.com/IntellectualSites/PlotSquared/commit/951f08bc8b0c463e91305cd3db74fe9de5125f65
k i guess ill have to go through the hell of compiling a java project again...
i cant believe it compiled
bc its premium now
im getting errors now
i guess there were breaking changes? that wouldnt explain the class not found error tho, right? is that from a newer version of spigot? im still on 1.20.1 and java 17
They arenāt spigot events so no
but PlayerSignOpenEvent is a spigot event, and i checked it, it does exist on 1.20.1 so, idk how can that error happen
ill try a 1.20.6 server
flagging what
I created a batch entity that is displayed only on the client's page, how should I handle clicking on it now so that it writes something to the chat? 1.20.4
It doesn't work (
@EventHandler
public void onClickNpc(PlayerInteractEntityEvent e) {
Player player = e.getPlayer();
CraftEntity clicked = (CraftEntity) e.getRightClicked();
Villager villager = VILLAGER_MAP.get(player.getUniqueId());
if (villager != null && clicked.getEntityId() == villager.getId()) {
player.sendMessage("You clicked on the special Villager!");
}
player.sendMessage("You clicked.");
CraftPlayer craftPlayer = (CraftPlayer) player;
}
well, now everything is working after upgrading plotsquared and the sv version
that is never gonna be an issue lol
AHAHAHA I'M SAVING THAT
DJDISKFKEBYBUYWHW
Lol
i hate you
Thanks
hey whatd you save
AH
Does anyone know when the attack cooldown damage reduction is applied? Is it just for the generic attack damage or is it for enchants and potion effects as well?
The entity exists only on client-side? Like spawned with Packet?
Yes, Packets
If im not wrong, its impossible to read interacts with client-side entity that you created with packets. You need a packetreader for that
Well, I created an NPŠ” entity, but I can't process interaction with it, how to do it then?
Interact events will only be fired for entities the server knows about
as i said: A Packet Reader
You need to add it to the world rather than use Packets
or as Silver said
are these actual Villager NPC's?
PacketReceivedEvent ?
Yes
then spawn them hidden and only show to the specified player https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Entity.html#setVisibleByDefault(boolean)
Then you'll get events as normal
this is how I created NPC for the test
@EventHandler
public void onBreakBlock(BlockBreakEvent e) {
Player player = e.getPlayer();
Block block = e.getBlock();
Location location = block.getLocation().toCenterLocation();
CraftPlayer craftPlayer = (CraftPlayer) player;
Level level = craftPlayer.getHandle().level();
NpcVillager villager = new NpcVillager(VillagerType.JUNGLE, level);
villager.setPos(location.x(), location.y(), location.z());
ClientboundAddEntityPacket packetVillager = new ClientboundAddEntityPacket(villager);
craftPlayer.getHandle().connection.send(packetVillager);
VILLAGER_MAP.put(player.getUniqueId(), villager);
}
And he appeared to me, but I don't know how to choose interaction with him
@fair rock @eternal oxide
Do you have a specific reason why its only client-side?
npc = world().spawn(location, Villager.class, false, villager -> { villager.setVisibleByDefault(false)});
player.setshowEntity(plugin, npc);```
spawns it and only shows to one player
no CB/NMS needed
you set all its values in the consumer (lambda)
So to display a foam character to a certain player and also to customize his own head rotation logic and other visual things for individual players
Unfortunately, this will not work
Do you use spigot? Or a specific library? Because i dont think spigot had that Event by itself
i use Paper mapper NMS
Its not a paper support but in paper is a PlayerUseUnknownEntityEvent
If, logically, when a player interacts with a mob on the client side, he sends a packet to the server, you just need to somehow catch this packet
If you use Paper, just use that Event.
No work
declaration: package: com.destroystokyo.paper.event.player, class: PlayerUseUnknownEntityEvent
Like the describe it should, so if its not, implement a packet reader
Ń Š¾ŃŠ° можливо
Oh my God, it works for me to kiss you š„¹
Very very thank you!
Np but if you use Paper ask there next time because they know their events xd
Time for yet another average geolykt question: Does anyone happen to know some way of concurrently storing, adding, removing and retrieving potentially overlapping 2D AABBs (which should all have a unique metadata ID of their own) in a 2D space in a performance-friendly manner (I'm looking at potentially several thousands)? The AABBs have the same width as height - that is they are all squares. However, the AABBs may differ in size (I just say that in case I want to add further functionality that would allow to "upgrade" the bounding boxes)
Idk if i understood that right but sounds like you are searching for a PRTree
yeah, but all PRTree impls I know of are not concurrent
what you mean with concurent?
You know, concurrent. So multithreaded with as few locks as possible (as opposed to async, which is multithreaded with as many locks as possible)
hmm ok i didnt have problems with prtree when i used it async or what do u mean?
Generally implementations should be considered to not allow writes to happen concurrently to read or write access, and if they allow that is often explicitly advertised as allowing that
hmm ok never did anything with that so i have no idea xd
often it is okay if multiple threads access the same thing at the same time, but once you write to a structure you need to use some kind of read-write lock. However most often that kind of lock is implemented by locking the entire tree as opposed to a very specific leaf which leads to poor read/write performance
the only way around that is to split the tree by some defining factor
Quick question who is sending keep alives and who is answearing?
server sends it, client responds with the same id
okok
on legacy versions it used to be sent very frequently but now i believe itās every 20 seconds
or something like that
Legacy versions are below which version?
below 13
okok
well i donāt remember exactly when
legacy generally just referring to old
if the client takes too long to respond, theyāre obviously kicked
https://helpch.at/docs/1.12.2/org/bukkit/Material.html Is legacy (has no LEGACY Materials
https://helpch.at/docs/1.13.1/org/bukkit/Material.html Is Not legacy (has LEGACY Materials)
api-version is supported for 1.13+. Everything before is Legacy
Has anybody here written a gradle plugin before? I've published it to my local maven repo, but I still can't apply it in the build.gradle
plugins {
id 'java'
id 'me.andreasmelone.gniremapper' version '1.0-SNAPSHOT'
}``` this errors, even tho if I look into .m2/repository/me/andreasmelone/gniremapper everything exists and shouldn't be problematic
did you add maven local as a plugin repository?
there are "plugin repositories"? I just have the normal repositories block with all of my repos and there I have maven local
Yea lol
in your settings.gradle.kts
pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
}
}
How else would gradle know where to get plugins from o.O
ĀÆ_(ć)_/ĀÆ
Well, I'll test it later, thanks
Gradle, the idiot step child of Maven
<commonLOpinion>true</commonLOpinion>
I personally prefer gradle, I don't like xml ĀÆ_(ć)_/ĀÆ
um
im used to c++ build times so im not essentially worried about gradles faster compile times
apart from that, whats the reason to use it?
It is more flexible
Run some code while building šæ
It uses a programming lang for configuration, so you can basically make it do anything
But for some projects gradle is indeed overkill
but you like c++ build systems???
nah
What about rusts approach is cleaner 
dependency management and build files that run at compile time
that is literally gradle
you can literally just execute code in gradle during compile time
Rust only have toml for builds configuration?
Well build.rs is executed at compile time
only thign it needs
Will anything break if i keep sending them frequently? Like every 5 ticks?
No
The 20 second period is just the timeout
If either the client or the server doesn't hear back within 20 seconds they disconnect
Yea but i thought that if client in newer versions receive KeepAlive too often something might break
Thanks
Hello, can any moderator go to #1243264378522959914 and pin the first message of the channel please ? ā¤ļø
Anyone know the event to check for breeze projectiles? Seems to have no effect on EntityExplodeEvent :/
ProjectileHitEvent?
worked š
EntityExplodeEvent is only for creepers and tnt i think
end crystals too probably
true, yea, forgot them
Explode fires only when blocks get destroyed i would say xd
"Called when an entity explodes" yea
but breeze isn't really an explosion i'd say
more like an air repulsion
"If the wind charge hits a block, only the gust of wind appears. This gust causes knockback but does not do damage, instead pushing objects away from itself." says the wiki
How is air repulsion created? Through a explosion (in the most part) yk?
Thats why i understand his "thought" of an entityexplodeevent tbh
the visuals are midleading, thats true
hellooo
does anyone know how can i get Beacon's item that is used to activate it
theres BeaconInventory, but idk how to get it
Good question, I see no way of getting it
When does onLoad get called?
when plugins Load (not enabled), usually before worlds load
Does spigot let me make a custom plugin loader, which can maybe modify some jars with a specific file in them (myownplugin.yml instead of normak plugin.yml) and load them?
So long as they are not seen as plugins you can do what you want with them
they are not plugins so Spigot will not care about them. You handle classloading yoruself
ig
use getItem()
manually put item in persons inventory or whatever, use setItem() on the beaconInventory and set it to air
they meant they don't know how to get the instance of BeaconInventory
but you just get it from the player's open inventory view
cast it to inventory holder maybe
then they need to be more clear in their questions
but I doubt that is what they want and instead are talking about the item in the beaconInventory
no, it's not. they asked the same question in the paper discord
^ was mu assumption
With no view open I see no way to obtain it
beacon isn't an inventory holder
there is no inventory unless one is open
beacons aren't like chests or furnaces
makes sense
and a few buttons
now that i think about it
one could use a reskinned beacon inventory as a gui cause it got a few buttons
actual buttons
Hello, what is the class that loads spigot plugins?
server if I remember
id say PluginManager
it's an interface
SimplePluginManager in particular
it's an interface
Yeah private final SimplePluginManager pluginManager = new SimplePluginManager(this, commandMap);called from https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/CraftServer.java#423
together with PluginLoader, which i dont know the impl for
huh
ah JavaPluginLoader i suppose then
where the hell is my directory
In build/mappings/
mappings doesn't exist in build and idk why
Idk then
ahh, apparently I had to call getParentFile().mkdirs()
is there a way to try every possible combination (not including moving letters) of a string?
for example tes becomes
es
s
t
e
and so on
you mean every substring of the string
you'd be missing te
is ts included? if so, it's not every substring, idk what you'd call this
ts isn't a substring is what I was saying there last
including only getting the middle part, the ones i tried couldn't get the middle letters
i want it so it can get and/or remove middle letters as well
I mean, at it's core you have 2^n (n being the amount of characters within a string) possible combinations - which means that you can represent it via a bitfield
how is it 2^n? if you plug in te it returns 4 (there's 3 only)
what's a moving letter?
oh moving letters around
Well you have
tete<blank>
oh blank included
so
- 11
- 10
- 01
- 00
respectively
However this strategy is only good for enumerating these strings; if you wish to do something else it might require something else who knows
quite hard to process indeed
is it 2^n or n^2
i still fail to understand the subject yet
so the words have to stay in place and make combinations of the chars it contains?
Well bitfields are 2^n
Since either you can have a character or you can't have it. That's a bitfield at it's core.
And a bitfield is a binary number at it's core.
Binary is base 2, so 2^n.
i'm expecting 250 or more chars sometimes
by the time aquantom computer process it, humans will go extinct
what's this for?
So, you are probably not wanting to enumerate all possible solutions then
Whatās the context for this calc?
at which point, it might be useful to know what you wish to do
are making minecraft mods similar to making server plugins
no
there is one thing that can make it similar : NMS
well, if while making server plugins you abused nms, then probably
but there is still a big difference
Best way to put it (imo): spigot api is for server sided manipulation, and mods or rather for client sided manipulation
There are niche cases like these guys just mentioned
back
Hello, how can I get the server.jar file (basically, the file that makes run my plugin)?
at runtime
ah
ough i have not figured out how to even use nms i should probably figure that out soon
u use getServer()
Eh
...then?
get the class path then the jar path
according to the research i did i kinda need it to make like "ghosts" of people
like just having a fake character in game
i dont see any other way
oh yeah pretty good idea, thanks
Lotta libraries out there with stuff you can use
yeah but i wanna code it myself
I feel like citizens would work for this no?
Youāre still coding the logic you need, but why reinvent the wheel
because i wanna learn the process behind the development of the wheel
Well
what if i split the text by for example 10 then enumerate all of them then rearrange
I get it, but thereās not much point to it, nms is just a fucking pain whereas thereās plenty of public libs that allow you wrapper methods for these sort of things
bruh šjava getServer().getClass().getProtectionDomain().getCodeSource().getLocation().getPath()
pretty much that
at 250 chars doing that would make it 33554432 enumerations instead of 1809251394333065553493296640760748560207343510400633813116524750123642650624
nms will no longer be pain :)
Like peoples skins?
like i make a copy of a person thats the same but with no nametag
and they are 3 blocks to the right of the person
and each movement the original player does the other body copies
including where to look, arms, walking
Oh youāre gonna need a bit more than citizens for that
Iād do it yourself sure
I donāt really think citizens will help here other than getting you access to the mirrored character as it were (at least a bit easier than without)
is there a way to not iterate that much
ou
In today's episode of wanting to end myself, I'm backporting an anti xray plugin from 1.9 to 1.8
What changed? The entire chunk format
Every version starting from 1.9 uses pallettes and encodes bits per block and stuff
1.8 just tosses in the ids raw
Pair that with a bunch of classes that weren't made thinking about this and you end up with a lot of hacky code
#StonksWorldGeneration
Quite goofy looking
Sounds right
Integer.class vs int.class fml
Hahaha
how the fuck can't protocollib read this
nice helpchat commission
easy 50 bucks
(I've been at this for 3 hours)
nice
hm? why backport when there already are options for 1.8
Hey thatās my attitude kek
ay my first crash
Hey only an extra 8000 bytes, not bad
It's conveniently the side of a chunk
p sure
so I'm kinda feeling like I'm writing duplicate data
Cool I see
need to extend more classes
I am so confused right now. I have multiple gradle modules for different NMS versions. I am only supporting 1.20-1.20.6. 1.20.6 requires a higher java version (21) than the other versions. So, I compiled with 21, and then ran it with 21 on a 1.20.1 server, and got this weird error:
And I know I loaded with 21 as it started with ```
System Info: Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS) Host: Windows 11 10.0 (amd64)
Loading libraries, please wait...
Does anyone know why? I saw somewhere that ASM doesnt support 21 on 9.4 version, maybe thats it?
Use Java 17 for 1.20.1 servers
Okay, but what about making a passenger riding a player turn towards the direction the player is looking at? Eg. pitch and yaw, rotation.
Is that possible without teleporting (not riding) the passenger?
For example by editing packets or something?
I wouldn't want to waste my time any more than I already have trying to make an armor stand head gear which can hold things like eyewear, mouth wearables, etc.
Teleportation is not really an option because it involves network delay, which riding an entity doesn't have due to client prediction.
Editing packets will have network delay
Well, yeah. So it's impossible?
doing it that way yes
What did you have in mind?
I would remodel an item place it in the helmet slot
Well, sure. I could do that, but then I can only wear one item in the head.
Unless I join the models. But the amount of combinations can get high pretty fast.
I guess I have to go that route. Well, thanks for the analysis.
It helped clear my head.
how do i kill/remove armorstand
declaration: package: org.bukkit.entity, interface: Entity
is there any way to quit playing minecraft
i feel like its going too far for me
its developing as an addiction
i stay for almost 18 hours playing one minecraft server grinding
wrong channel but still
i've used to get around this by developing plugins for it instead
making the time at least productive by learning java
get very far into development
but now i switched to full-stack development on web a bit its quite alarming for me that i keep getting back to minecraft
you wont want to play minecraft as well as code stuff for it
its a good fucking game
its just
i cant pause whenever i need to
heck i skip programming related work just to escape from its anxiety
by strip mining
today i've digged up the whole chunk with one diamond pickaxe
with no beacons and stuff
sir this is a #help development
this is just general 2
He should write in general 2
Ah yes its not existing, calling a doctor is good too kekw
i have an idea, make a program that force closes minecraft for the rest of the day after a certain number of hours
As long i dont see "HTML Developer" i think everything in your mind is okay!
HTML is a programming language, is a red flag for every doctor
nah
im more into js stuff rn
and for the backend spring
im just trying to find a programming job
so im trying to learn web technologies š
it kind of disgusting how much bloat the web ecosystem has
Ruby on Rails?? š
React/JS + Typescript
stack
with Vite
React is a joke
but im forced to learn it
just because most of the companies expect to know it
:/
Hmm I tried just going very basic with ruby / html / css long time ago donāt even remember if I did anything
at least in my region
if i had to choose my framework, i would probably go with either with HTMX or Svelte
React is a runtime bloat that needs to die before it takes over the net
I def have not kept up with web dev
why does this always return 0
not sure but maybe the Material references are not the same
thus equality check fails
It's an enum
Or is it?
yh it is
material is an enum
does player.getInventory not get the players entire inventory maybe?
Hello, how can I put a jar in my plugins folder without having this error? Could not load 'plugins\test-plugin-1.0-SNAPSHOT.jar' in folder 'plugins' org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml ... Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
The jar doesn't have a plugin.yml, it's the goal
u cant have a plugin without a plugin yml xd
apparently, we can
how is bukkit gonna know what to do
what's the point?
Try a print in the if to verify itās actually iterating
yea we can have one
huh, explaining would be long
mhm i will
you can register JavaPlugin as a programatically
well.. Why?
I just want to suppress this error, the plugin have a cvn-plugin.yml instead of plugin.yml
althought it would be quite messy
good question, idk just to flex your reflection api and bytecode knowledge i guess š
one could flex with making a good API
for remapping intermediary to obfuscated mappings maybe?
lol
guys
does it looks like "flex" ? or maybe a serious project ?
:)
Did you found the error?
i did not *find the error yet
So you want to check for a material in your own inventory and want to count every of it together?
Like Grass:3, Dirt:2, Grass:4
count Grass
= 7
Right?
Debug with running in debug method or sout? xd
thats what im doing rn
mode*
i dont get the idea
isnt this is something that paperweight already does?
with gradle plugin?
What did you count?
wait
it knows whats in the inventory
that's really a good idea
i like it
having consistent mappings like fabric's but for spigot plugins
making cross compatible plugins easily
š¤
exactly
basically, the same nms code for every minecraft version
Send code wanna check something
what code lol
that cpde
do you want to create a gradle plugin or spigot plugin that dynamically remaps it ?
@valid burrow I donāt see how it failed?
I'm working on the spigot plugin, RaydanOMG is doing the gradle plugin
do you actually want to dynamically generate specific version NMS interfaces that after recompilation from intermediary mapping would call those interfaces thus making the plugin cross compatible?
This is correct for the code you have
it returns 0.
wait, I send you the schem
Send pls, i started mc and my testserver xd
ah wait i have 30s
like that
more details are in #1243264378522959914
i seem to have found the issue lol
the method works
its just implemeted wrongly
i need sleep
i spend 10 minutes debugging a working method
so, how can I suppress the Could not load 'plugins\test-plugin-1.0-SNAPSHOT.jar' in folder 'plugins' org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
?
?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!
wouldnt it be more logical if the transformations regarding NMS would be done from gradle itself, instead of trying to load it from separate plugin at runtime
or i dont get it something
oh it wasnt ask lol
theres 1 command that tells you not to ask the same question over and over again
which one was that lol
?
isnt a command
you don't get it
what's the point of intermediary jar file inside plugins folder
because it's the same naming for every minecraft version
couldnt it be just compiled to remapped one at compilation
then we make it usables by the server as obfuscated
so you're developing a intermediary plugin loader for spigot?
yeah
but that's not the subject
Yeah⦠you had me quite confused that first log ss you shared looked like it did exactly what was intended
i know lol it just kept returning 0 though
or so i thought
cause thats what my inventory said
turns out i placed == instead of >
Well in that ss it was obvious that it didnāt right?
Otherwise it would have just said the block name right?
not really i checked the implementation a few times and never noticed anything wrong xd
honestly
i would probably would make a PR
to push it into spigot
since it looks kinda promising
and it would allow you to mitigate those kind of issues
smartest voss moment
I mean because if the return was 0 on that ss, then it should have only printed the block name and no āamountā as it were
by modifying the spigot itself
fuck of
but this will still be in the old versions of spigot...
2nd smartest voss moment
@valid burrow take a shot and a nap
i dont have anything nice here
i am tired but i gotta finish this plugin
been on my todo list for too long
i gotta refactor the entire thing anways
its a mess
where?
kotlin?!??!?!
in the method you send is no == thats why i was confused
one day ill use kotlin
tomorrow, he is tired. You want a good start with kotlin. Let him sleep and wake him up with a laptop in his arms
im a bit to tired to refactor 3k lines to kotlin tonight
itll be fine
looks awesome
is it possible to override the name tab completion for 1.13+ players?
yes many times already ..
are the repositories set correctly?
?
wana use those
are the repositories set correctly?
cant intellij idea just do it for u
3k errors?
what
yes
java to kotlin isnt very good
light classes are fine but heavy ones just die
could you send the <repositories> part of your pom.xml
also dont forget to press this
EY dont you dare ignore me. whoever watching this... ill find you.
i googled it and found an 8 year old github that used it so yeah
i did this but istill get an error
<dependency>
<groupId>com.intellectualsites.bom</groupId>
<artifactId>bom-newest</artifactId> <!-- Ref: https://github.com/IntellectualSites/bom -->
<version>1.45</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.fastasyncworldedit</groupId>
<artifactId>FastAsyncWorldEdit-Core</artifactId>
<scope>provided</scope>
</dependency>
reload maven
I think thats a very old api
Could not find artifact com.fastasyncworldedit:FastAsyncWorldEdit-Core:pom:unknown in spigotmc-repo
like 1.8.8 type of thing
have you managed to remove maven central from ur project
this is the new error
probably no longer available
no i didn't should i?
when they use commands?
no
just name completion in general (it doesnt require commands)
i think its client sided now
just not too sure
<repositories>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
make sure u have this
no
if it cant find it you somehow dont have access to central
is their repo down again maybe?
why my plugin works if 1 player is in server but if there is more players the plugin doesnt work and player stats from database are showing for different players
does that look like an okay implementation of json serializer/deserializer?
it works properly
and prints correct stuff
Yes ig. Make sure to write unit tests for that.
Does using sockets between bungeecord and spigot require extra ports? I'm trying to convert plugin messaging over to sockets so that I can use it even when a player is offline
well, the server needs to have a port open and accessible to bind a socket to for the proxy socket to connect to
so, yes
wdym by unit tests?
hello on 1 easy anarchy cheater, please ban him, he interferes a lot with EzAccount
This information is devastating to me š
Oh, Emily, I didn't know you were here too x)
Is there no way to, on a disconnect, send a plugin message if the server is empty after the disconnect?
Proxy (Detects Disonnect Event) -> Sends PM to Server -> Server parses message using PlaceholderAPI -> Server sends message back to Proxy
I wanna avoid using extra ports because I know port usage is limited but if there is truly no other way then that's okay š just sucks
calling the math heads here
i have an explosive enchantment and i want it to break blocks only in front of the player
this is the code
when i break a block this happens
how can i make it to break only theses blocks?
i tried to play with the z in the vectors, but it only works for some directions
fixed it
my angles were wrong
and i just needed to set the z to 0 in the max vector
anyone know how to add gaps inbetween scores on a scoreboard similar to this:
when I add a blank line it just doesn't show on the scoreboard
I am using spigot 1.16
should work if every line is unique
you can not have the same line twice
so you have to do something like
1 space in empty line 1
2 space in empty line 2
3 space in empty line 3
that should work
if that doesnt work show us your code
?paste
What would be more efficient: getting pdc data of item on equip event, putting it to cache and then use cache whenever event X is called, or getting pdc data of item every time event X is called?
As in, how resource expensive is getting data out of pdcs compared to just using data stored in a field?
how often is the event called?
Okay
well what do you consider very often
Im thinking of a way to make custom statistics
are people permanently fightinh?
if so cache
if not permanently fighting use pdc
or if every person may have multiple weapons
dont cache
Pretty much all the time its supposed to be mmo rpg / roguelike pve gamemode
mhm
well you can cache some data to some extend but you need to keep it in limits
caching at some point becomes very expensive in ram
Things like equipment can be cached
Weapon probably not
But its okay anyway
Good enough
if youre making custom weapons
calculate the damage on every weapon swap
and then cache only the damage
instead of the whole weapon
Is there an event of swapping your current player bar index?
probably yh
That way I could cache entire damage
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerItemHeldEvent.html https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerItemHeldEvent.html
declaration: package: org.bukkit.event.player, class: PlayerItemHeldEvent
Hmmm
Ill experiment with it for sure
gl
When fighting enemies Id have to get their pdc on each hit though, to match their ID in statistics cache
So at worst it's 2 PDC fetches per attack
1 for id, 1 for level
Since enemy cache holds base statistics
i cant see the address/path bar
cant figure out how to get it to show up, i think its bugged
?whereami
mhm i see
šļø
anyone else getting this error with BT?
Same outcome in both exe and jar version hmm
What java version are you using to run it?
What about Java 21?
it only allowed me to do either 17 or 22
Do you not have 21 installed?
wait now its not complaining
same issue with 21
oh wait the override feature doesnt work at all on the exe
it runs latest regardless of what you chose
Does it do the same thing with the jar?
testing rn
Is this a valid syntax in terms of my plugin's config.yml?
Example Setting: [
OPTION_ONE,
OPTION_TWO,
OPTION_THREE,
...
OPTION_N
]
no
How do I allow the user to choose from an arbitrary combination of valid options
Yaml lists use this format.
settings:
- OPTION_ONE
- OPTION_TWO
- OPTION_THREE
either do a List like this:
options:
- OPTION_ONE
- OPTION_TWO
or have a kvp for each option
OPTION_ONE: true
OPTION_TWO: false
Yep, exactly the same for the jar
The only time you'll see brackets is in empty lists.
tested on 4 java versions
Gotta confirm with alex then. May or may not be an issue with JavaFinder
Either that or the current impl is fucked
any idea if theres a way to override the build tools old version warn
so i can use an older ver of bt
Old version warning?
yeah the one saying to download a new ver of bt
The one that says "Your BuildTools is out of date and will not build the requested version."?
Cause if it's that one, then no. Not at this point in time.
Honestly, I don't know the reason behind limiting versions behind a certain version of BT.
Maybe it was necessary before, but as of today, I can't think of a reason.
It's only done where it's required for it to build
ill create an issue on jira
How does it fair when you just use the command line?
i was using commandline for the jar
With full java path?
yeah
Hmmmm
"C:\Program Files\Java\jdk-21.0.2\bin\java.exe" -jar BuildTools.jar --rev 1.20.6
Command prompt or powershell?
Can you paste the full log?
What does this little symbol mean in intellij?
I hover over it and there's no text
Clicking it does nothing
(The full code for reference)
?paste
hastebin is down nice
What would the method to retrieve the list be? Would it be ConfigurationSection#getList or ConfigurationSection#getStringList?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
It depends if its a string or a list of other values
More than likely going to be #getStringList()
But yea, depends on how you store the values.
im guessing itrs because Program Files has a space in it
guess il raw dog it in C drive
Like what..
\bin/bin/mvn
yeah, still same issue, interesting
wait a min
did my M2_HOMe path wrong
lol
yep that was it
Mmmm, that's some stuff that should be added to the debug output.
What was it set to?
you're a saviour, thankyou verytm uch
it had \bin included in the path
where it should've been without bin
What event can I hook onto to see when the player requests command completions from the server? I don't want it when the player sends a command, only when they request command completions.
define completions, do u mean tabcompletions'? or the command list sent on join