#help-development
1 messages Β· Page 205 of 1
forntite refrence
nope
accept my friend request babe
already denied it
bruh
I swear why are half of the people here german
denied and blocked
guten tag
guten tag
y'all can probably fill a stadium
only mf from my country here is my lovely friend magmaguy
Well, there's 1,800+ verified users online currently, we probably could all fill a stadium tbf
I'd meet him if he didn't threaten to yeet me off a cliff every day
ich spreche londonese
understandable
I won't even bother to open google translate
i speak londonese
turn the table and actually throw him off a cliff
some of y'all probably live in the same neighbourhood
you wouldnt know, city boy
I mean I'd probably stab him quicker than he'd throw me
@torn shuttle did you hear that
my knife is hella sharp, my finger can confirm
when the depression speaks
average brit
if you aren't one
you'd make a good one
I accidentally cut myself don't judge me like that
the peppa pig bandages saved the day
still average brit
peppa pig bandages 
more drippy
dora the explorer bandages absolute flex
it didn't hurt that much
spongebob >>
true
I don't indulge in fanfiction
its called lore
and its important, please indulge
Waiting for the SpigotMC lore book to this day
yeah I wanna know if the craft bukkit death is canon
dedicated chapter for our war
i managed to register a custom item type using nms
i did it in 1.8 so you can register the item with the same id as a valid item (like a diamond pickaxe) but with a different string id (test_item), so the item can be rendered by the client without any modifications
not sure if that could be any useful
I'm pretty sure this can break some things. not sure when it came into the api but setCustomModelData on ItemMeta and a resource pack does the trick without nms
i'm not trying to make items with different textures, rather making two identical items look the same from the user's perspective but different internally
in 1.8 that may be necessary but PDC can do that in the newer versions
so i don't have to wrap around itemstacks and construct the wrapper each time i want to modify that item, or even worse run the checks each time for the type of wrapper i need to use for the item i want to wrap
Might have to use nms to create a custom item like that
that's what i did if you look at the screenshot above but i am not sure whether that's a good design because 1) I'm not sure whether it will actually make my code cleaner and faster and 2) this could break a lot of things i haven't noticed yet
the items persist through restarts but if I ever load the server without my plugin all the items are gone
Well I am uncertain if you can do it via api. So regardless that may be the only way
which is a pretty severe drawback
i'm pretty sure you can't
spigot ain't forge
Nope it isn't but the api is always improving
not that huge, the plugin is private and also this was more of a test to see if it was actually possible
being able to define custom items and mobs via api only would be a massive step
and also i have fun tryna break minecraft with NMS
I doubt there is a point in custom item definitions on the server side unless the client is able to understand it
mocking a custom item type just to translate it back to a vanilla type when getting it out to clients seems rather meh
it was more of a proof of concept but if that proves to be helpful i might actually use it
Yea, I mean a library for that would be fun
tho I wonder how much it would break in other plugins
As long as you use current items like it is with mobs. Client will understand it since its mostly server side anyways
not sure if that could work with 1.13+, because i have to rely on numerical ids to do what i'm doing
well, the item type itself tho does not really give you anything beyond some identifier of a custom type
custom textures would still need custom model data
additional data would still be in NBT/PDC
that's what i need, i wanna get rid of my wrappers
hey, how do I set a sign on the chest?
Sign would be wall sign and you just need to ensure it faces the right way to attach
right now i have an hierarchy of wrappers and each time i want to wrap an itemstack i need to run some methods that try to invoke the constructor of the correct wrapper based on an nbt tag stored in the item
it's a mess
final BlockFace face = event.getBlockFace(); final WallSign sign = (WallSign) event.getClickedBlock().getBlockData(); sign.setFacing(face);
using PlayerInteractEvent
and it still doesn't seem to be working even with the WallSign
how would that change in regards to accessing custom data on a new item type tho π€
You would use blockstate unless blockdata lets you do the same
you can use ``` <Code> ``` to create a codeblock, instead of using the quote feature
The facing would be the reverse of what you get from the chest if I recall
i am still figuring out how do the item internals work but i think it might be helpful
i'll do some testing
getting a cast exception
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.CraftChest cannot be cast to class org.bukkit.block.data.type.WallSign (org.bukkit.craftbukkit.v1_19_R1.block.CraftChest and org.bukkit.block.data.type.WallSign are in unnamed module of loader java.net.URLClassLoader @759ebb3d)
[getting the blocks state in this scenario^]
the item nbt tag refers to an enum constant that stores the class object of the wrapper which constructor i need to invoke
Should be able to cast blockstate to wall sign
You're trying to cast a chest to a sign???
Well yea but your wrappers are there because they presumably access custom nbt data right ?
similar to item meta implementations
final WallSign sign = (WallSign) event.getClickedBlock().getState();
the state Olivio
Ah yeah can't cast the chest to a sign lol
oh
yep, i'm using NBTapi
what do I do then?
Yea so you'd still need your wrappers
I will let the others help. Have work to do lol
to have method contracts for the NBT data access
Olivio, any idea?
it's also important that i have my wrappers used properly else you could add illegal data to items
i have a lot of edge case checks but it's getting messy
i'm pretty sure i will but i might be able to get to them in a cleaner way
by making custom Item classes (which are basically nms' Material)
You need to get a sign
Either by placing or locating one in the world
so i just set the block infront of the chest as a wallsign?
Yeah if that's what you want
it would be fun to try and fork spigot to try and add custom item registration as a proof of concept
Does anyone know where is pdc saved?
I wanna know pdc of block can be saved whenever I change world file.
got it working but how do I set the direction of the sign to be right on the chest?
you mean what's the file or what's the NBT path?
Hello,
I need a plugin where the player can open someone's inventory, but not all slots should be visible. Do I need to clone that inventory or can I open and edit whit out making changes (hiding slots) in existing player inventory?
Idk, if someone can understand, I hope someone can π
blocks dont have PDCs
yeah. where pdc saved?
if you do player.openInventory(target.getInventory()) then changed are reflected in both ways afaik
well if they are tile entities they do
Ahha...
i suppose that's what he meant
well
you can with my library
it uses the chunk's PDC to store block data
WOW let me see π
i was using chunk pdc too to save locks for lockable blocks
Yep, I did that like that. So I need coppy than inventory into GUI, I some other virtual inventory? So I need loop true all slots?
if you want that you can modify the target's inventory, then create another inv and copy all the slots yes
To keep, that visible slots updated, can I run for ex. every 1 tick? Or do I need handle every inventory action?
running thro it every ticks and checking for changes would work ig
Ex. If player pickup block and it is on visible slot, that slot should update in GUI
Ok thaanks!
Should be pain to handle every inventory action at lot of work π Mby would be more optimize to do that than checking inventory every tick. π€
How can I download Custom block data API. I can't find how to download it π’
you usually add the dependency to your pom.xml or build.gradle as explained
<repository>
<id>jeff-media-public</id>
<url>https://hub.jeff-media.com/nexus/repository/jeff-media-public/</url>
</repository>
<dependency>
<groupId>com.jeff_media</groupId>
<artifactId>CustomBlockData</artifactId>
<version>2.1.0</version>
<scope>compile</scope>
</dependency>
As the post says
you could read the thread :D
otherwise, here's the direct download link: https://hub.jeff-media.com/nexus/repository/jeff-media-public/com/jeff_media/CustomBlockData/2.1.0/CustomBlockData-2.1.0.jar
I added It but I learned when I use API
I have to add depend to plugin.yml
that will not work, it's not on maven central
you need to shade it yourself as explained in the thread π
lol everything is hard for english noob π
are you using maven at all?
yeah
then just add the <repository> and <dependency> and also add the maven-shade-plugin to your <build><plugins>:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<relocations>
<relocation>
<pattern>com.jeff_media.customblockdata.CustomBlockData</pattern>
<shadedPattern>your.package.name.CustomBlockData</shadedPattern>
</relocation>
</relocations>
<minimizeJar>true</minimizeJar>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
I still cant load CustomBlockData API
I write relocating code in pom.xml. But It doesn't work π₯²
I added this depend code in plugin.yml too. what can be the problem?
depend:
- CustomBlockData
with that in your depend, the plugin will not enable at all
CustomBlockData is NOT a plugin
"doesnt work?" show the error pls
you must not add anything related to CustomBlockData to your plugin.yml
CustomBlockData-2.1.0.jar, TheGlacier-1.0-SNAPSHOT.jar define 3 overlapping resources:
- META-INF/MANIFEST.MF
- META-INF/maven/com.jeff_media/CustomBlockData/pom.properties
- META-INF/maven/com.jeff_media/CustomBlockData/pom.xml
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See https://maven.apache.org/plugins/maven-shade-plugin/
https://paste.md-5.net/icuguzefod.cs
Why is this PacketPlayInSteerVehicle class not working for 1.19.2?
that's not an error
I don't really understand what the problem is
Thanks you so much It worked! π
but there is some error messages in bukkit
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
does the client make assumptions on how fast it can mine a block or does the server tell the client while it is breaking a block how far into the action it is?
then you broke your plugin.yml, show it pls
This is my plugin.yml
name: TheGlacier
version: 1.0.0
api-version: 1.18
main: me.rukon0621.theglacier.main
commands:
//some commands here
is the main path correct?
yes its correct
classes should be TitleCase but anyways
show the commands too
or just read the stacktrace and see what went wrong
Here is it
commands:
test:
description: test command
usage: /test
permission: <plugin name>.oper
permission-message: You don't have permission to use this command.
aliases: [ν
μ€νΈ]
level:
description: test command
usage: /test
permission: <plugin name>.oper
permission-message: You don't have permission to use this command.
aliases: [λ 벨κ΄λ¦¬]
exp:
description: test command
usage: /exp
permission: <plugin name>.oper
permission-message: You don't have permission to use this command.
aliases: [κ²½νμΉκ΄λ¦¬]
money:
description: test command
usage: /money
permission: <plugin name>.oper
permission-message: You don't have permission to use this command.
aliases: [λκ΄λ¦¬]
playerstatus:
description: test command
usage: /playerstatus
permission: <plugin name>.oper
permission-message: You don't have permission to use this command.
aliases: [μνκ΄λ¦¬]
read the stacktrace
Jar.. does not contain plugin.yml ..? what? lol
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:159) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-379]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.reload(CraftServer.java:1014) ~[paper-1.18.2.jar:git-Paper-379]
at org.bukkit.Bukkit.reload(Bukkit.java:909) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchCommand(CraftServer.java:906) ~[paper-1.18.2.jar:git-Paper-379]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchServerCommand(CraftServer.java:869) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:510) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:484) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1456) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1226) ~[paper-1.18.2.jar:git-Paper-379]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-379]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
do you have a resources block in your <build> thing?
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
not sure if I've explained it correctly, but basically i mean if the server keeps updating the client about breaking stages
and is plugin.yml located in src/main/resources ?
yes path is correct absoulutely
what about this?
umm... let me check
the client makes assumptions
for itself
That's okay...
the server then predicts the stages based on start and end time
yeah that's what i guessed
All things are in their location
that's too bad
and sends it to all other players
You can somewhat override these stages with negative mining fatigue effects
then ?paste your full pom.xml
i mean it would be worse if the client didn't because it would be painful to insta mine
?paste
instamining is weird
or mine in general with high ping
the client sends a "start block dig" packet but not a "finish block dig" for instamining
mojang wtf
swapping items to your offhand is also a block dig packet for some strange reason
ikr also blockhitting or shooting with a bow
iirc
shoot bow might be item consume
?paste it
yeah bow and eating
o nvm
wtf why is the constant supposed to be called DIAMOND named EMERALD
that's so weird
the more i dig into nms the more i'm confused
I copy pasted exactly this and it works fine
so your plugin.yml is eithe rin the wrong location or you'Re not using the correct .jar file
umm okay... Let me check it
it must look like this
ayy finally someone else with the default theme
mfs be putting gym pics in their ides
indeed, i love nms
it's fun to break stuff and seeing what happens
it's just that i get weirded out by some stuff
you just have to be patient and do a lot of research either in the code itself or on google
especially for advanced stuff
Sorry... π
I knew I have to put api jar file in my plugin folder...
now I realized... thank you so much..! π
also you need a good knowledge of java to understand the code because obfuscation adds a layer of complexity but that's it
nothing else is hard about it
that's what i do 90% of the time but sometimes i have found useful info on google
right now i'm digging into items and block breaking
the more i work with nms the more i understand how hard it is to make even a simplistic game such as minecraft
the packet impl is nms right?
like i wanted to see the impl of PacketPlayOutBoss
you can do it yourself, sure
rn i'm working on 1.8 and that packet didn't exist back then
Does someone know why checking items for lore doesn't work?
Here's my code. I'd appreciate help
Iterator<ItemStack> i = list.iterator();
event.setDeathMessage(null);
while(i.hasNext()){
ItemStack item = i.next();
if(item.getItemMeta().getLore().contains("Bound")) {
//if (item.getType() == Material.GOLD_INGOT) {
i.remove();
}
}```
because none of your lore lines is exactly "Bound"
btw you should use PDC to detect your custom items, not the lore
PDC?
?pdc
is that a thing on 1.8?
no
lol of course not
Does anyone know how to store data in a json file and then remove a specific value?
I have a survival server too on latest so I'll learn it as well
is there a way to check if a plugin is reloading because someone called /reload or someone calling /reload and placing an more up to date plugin jar in the plugins/update folder?
(Context: I want to store multiple values under another value.) (ex. Value1 is a string with a number labeled Value2 underneath)
you can detect a reload using the "currentTicks" field
ik how to detect a reload, im trying to see if a plugin gets disabled due to its jar being replaced by a newer jar in the plugins/update folder
You can store a hash
if so some state of my plugin isnt reflecting reality anymore
or read the plugin.yml version string
the thing is that my collection becomes empty when disabling plugin and placing a new jar
I'm basically just trying to make my own IP ban list, how would I go about doing something like this?
then save it in a file
It's just json object with few properties
mye i think im close to find a solution cuz my collection only got renewed when a player joins and not when the plugin enables
I've never really used json in Java before so if you know any good resources, that'd be a great help.
gson or jsonsimple
Yeye I'm like 25% sure
doesnt it only have guava?
Cuz it has guava
Just Google how to use gson json object, after that you can just use toString on that object to get output like that
I'm guessing there's a way to remove the object based on the property too?
Also you can make different class with those fields
Because I'd like to remove it by a string property.
And just de/serialize
Hey fellas, would anyone know of a quick way to send data from one server to another while over bungee? I heard that plugin messages get ignored if a player isn't online, any better way to do this?
redis
No!
Spigot contains gson by default
Its include since Legacy 1.8 and havent been removed
https://paste.md-5.net/icuguzefod.cs
Why is this PacketPlayInSteerVehicle class not working for 1.19.2?
hello everyone :), can i check with the EntitySpawnEvent if a player spawned?
i think its not called for players... you can use https://hub.spigotmc.org/javadocs/spigot/org/spigotmc/event/player/PlayerSpawnLocationEvent.html (?
declaration: package: org.spigotmc.event.player, class: PlayerSpawnLocationEvent
thanks im checing it out π
Is there any fix to the new feature of Minecraft 1.19 that makes all commands caps-sensitive?
Does anyone know the best antibot plugin?
lets not spam that
?
when reloading the server, player objects do not longer remain valid right?
does it matter? I mean since your plugin also loses all data only in memory and you tend to only keep player references in memory
well bossbars seem to be persistent as when reloading the server they are still visible to a player, i just looked into the impl and they hold a Set<EntityPlayer> and i think theres some confusion because calling BossBar#addPlayer with the new player object (after reloading) makes the player have that bossbar twice
just figuring some bug in my code out lol
you have to manually remove the players from the boss bar
mmh ye thats what i thought then
have been implementing so many things just to handle reloads correctly XD
I get that. you also have to be careful when creating a bossbar and completely restarting the server it saves some boss bars and persists them. gotta clean that out every so often
np
just some other bugs smh
there always are XD
I could also send you what I have on boss bars if you want... see if we can pool knowledge (and code) on those
XD you working with packets?
no?
just invis potion effect?
and some more things yes
ah, the good way π
been refactoring my old code from ~450 lines
?paste
How can I make the console execute the command /[command] reload of the plugin
My code: https://paste.md-5.net/yayizumaya.coffeescript
What
Hi, I need to add an attribute modifier to an itemStack (add more armor points on an armor), but since I'm in legacy, I must use NBT but idk how to do it. If this can help, I'm using NBTAPI
@tardy delta can we cry together?
sure
no
lmao
okay now I'm crying alone!
https://media.discordapp.net/attachments/961659642130333737/1036664891433570405/unknown.png?width=959&height=222 (the code)
Hello Community! im new to Java, and i wanted to code a lobby plugin but this isnt working, can anyone help me?
IntelliJ is trying to help you here, it is giving you a warning as you are trying to compare the ItemMeta to a String
https://paste.md-5.net/icuguzefod.cs
Why is this PacketPlayInSteerVehicle class not working for 1.19.2?
You are comparing the ItemMeta to the displayName
if (event.getItem().getItemMeta().getDisplayName().equals("...")) { //Code }
?notwork
do ya'll know the best place to talk about Redis?
16:53:27 ERROR]: Could not pass event PlayerInteractEvent to Lobbyplugin_keks v1.0
If i sit in the vehicle the w a s & d are not working ad it should be, in 1.12.2 it is working completely fine. But in 1.19.2 the only key that works is A but that moves it forward?
This means that your item doesn't have a displayName
You have to change few things to make it better
The full stacktrace would be helpful
?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.
Trying to make a way to copy Loka damage in a plug-in with it being togglable, how can I go about that?
Loka damage is basically normal vanilla damage with a 33% multiplier
can enyone help me?
https://paste.md-5.net/icopupiney.cs
Error [17:13:24 ERROR]: Could not pass event PlayerInteractEvent to Lobbyplugin_keks v1.0
Gonna need more of a stack trace than that
?paste the error
Paste the whole error in the future and honestly if your working with spigot plugins your gonna wanna learn how to read stack traces. Java has some of the most readable errors so it's not very hard
rust has lol
Can anyone help with this?
Rust is just crazy though
Can someone help me? please
That looks like some of the opt out pages for advertisers
i tried changing org.spigotmc:spigot to org.spigotmc:spigot-api and got a way worst error, so thats something
never mind i still dont know what to do
java: cannot find symbol
symbol: class EntityType
location: package net.minecraft.world.entity
now its mostly this
man
Anyone know how can I get mojang uuid from premium player on cracked server? .getUniqueId() returns randomly generated uuid.
api lookup?
hello , can i use WorkloadDistribution for a heavy task?
lets say rotating [armorstands , 1 tick ] ..
i have been looking for a quite sometime ... if it will be better for performance i will deffently add it
?workdistro
yes as i said i have been searching and reading , but i didnt get a full idea on how i can implement it for armorstand rotation
xd
would this work in im trying to increase dammage by 20%?
ye but i didnt know if it would do it right or mess up
why is the method static
ok
and why is there no annotation
genuinly no idea
im p new so yknow
trying from the API sight
so like this?
anyone , have info about it ? and will it will make the rotation less laggy
multiply, not add
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
oh wait ye forgot to do that
now my issue here is idk how to get the normal damage without the modifier
event.getDamage() probably
@EventHandler
public void onDamage(EntityDamageEvent event) {
event.setDamage(event.getDamage() * 1.2)
}
What's your current implementation? Also how many armorstands are you trying to rotate at once? Cause it shouldn't be causing lag if there are only a couple armorstands.
An if statement?
add an if statement based on whatever check you wanty
a permission? add a permission check
hi
and so on
someone have a suggest for making plugins plz i want to learn
its for my lootbox system , so i can have 5 armorstand , or i can have 300 armorstand in one server
Are they permanent? Also, again, what's your current implementation?
google, youtube
can i send you code privite?
i suggest using packets for armorstand animations, for some weird reason using actual entities as stands makes the movement not so smooth
I mean, I'd rather you send it here. If you really wanted to keep it "concise" make a thread about it.
sorry
also not having entity ticking is a big improvement for performance
i don't think workload distribution really fits your needs
also if you use packets you can use a completely different thread
^
Armorstand spawning + rotation using WorkLoad.
i tried packets before , it didn't work out really well
it was working only for 1.8.8 player's , if a 1.9+ joined , he will be kicked
and a error spam will appear on console
i have always used packets for animations and they have always worked fine
protocollibs?
i usually use nms but either one works
the thing is , my plugin is 1.8.8 based [ so i need to support 1.8.8++)
Yikes
then use protocollib
i send you the code , nothing happend , can you take a look xd?
the packet has not changed much, only difference is that it takes floats instead of bytes for rotations and such
iam just testing for now , i didnt make up my mind
and spawning ..
Well, I'm still wondering why a runnable wouldn't suit your needs?
spawning should be pretty straight forward
send a spawn packet then a metadata one
i were stuck 7 days in the past , with spawning using packets
Like, you would need to spawn thousands of armorstands before it gets really laggy.
^
not thousands
packets are the proper way
maximum is 100-200 [depend on the map
if you want to make good animations
i'd show you some clips of stuff i made using packets but i've lost the footage
animations are not easy
Hmmm, I'm not sure what the performance disparity would be for 1.8.8 vs 1.19.2, but I don't think it would be that bad.
I think you might have other issues going on if you can't spawn in more than 200 armorstands without getting lag.
spawning , removing , clicking i need to implement packets for all these
stands are one of the heaviest entities in the game
spawning is not super easy, send a spawn packet and then a metadata one
the current system for spawning , is pretty soild
clicking is easy, listen for attack packets
i have no lag what so ever with spawning , i checked like for day's ..
removing is even easier
send a destroy packet
oh these are the same images
you have a red underline so clearly something is wrong
rip
also yes you have sent a duplicate image
as i said , i did it before like 2 years ago , but i had a problem for 1.9++ players joining , they were kicked out of the server
so i had to use normal ArmorStand
never had such problems
well i think i did it wrong ?
it's hard to tell without code but anyways i suggest giving it another go
you'll also learn a thing or two about minecraft's protocol
which is useful to know imo
yeah probbly
why , i wanted to use WorkLoad for animiation , is a friend of mine , use it for his armorstand animiation and its pretty fast
It's useful to assess your usecase. Maybe it's justifiable for older versions of the game, but in the newer versions, armorstands have been improved significantly. They are also less resource intensive when you use packets. There's also other workarounds to prevent massive amounts of code calls.
If you are using this for lootbox animations, then try and figure out your numbers. Lets say 25 players open one at once. Then your animation takes around 300 armorstands per animation. That's an easy 7500 armorstands that just appeared. Theoretically the number could be a lot higher if more players opened them at the same time, but a simple solution is to limit how many can be opened at once. Maybe one lootbox can only be opened at a time, then limiting the maximum amount of armorstands to 300 at any given time.
If you went with that approach, you might not need to go down the rabbit hole of workload distribution and just stick with a simple bukkit runnable.
That's of course if you use real world entities. You could get away with more if you use packets, but I think you get the point.
π
thank you so much , but its lootboxes , like :
10 islands , each island have 3-4 lootbox , when you click on it , it drop a random item , and dissaper , and spawn again after a time that i set in config
everything is done and done , i just want to make sure that WorkLoad will be better for rotation
so the animation it rotate
every 1 tick
in 1 side , either left , or right
Ah, I see. Of course, it depends on what your approach is to lootboxes, as there are many, but my assumption was for lootboxes/crates that would be at spawn or one location.
In your case, you might still be able to work around the issue, but, again, it depends on what your setup is. Are your islands running on the same server, but in different worlds, or are they instanced?
its 1 world , its a skypvp game
you can look it up ,
Oh, skywars lootboxes.
well , until player click on it , and it will be removed
Are you treating the armorstands as the lootbox itself?
and spawn again
i can probbly make a check if there are no player's online , stop rotating
when players are online , start rotating but that won't fix it
so when armorstand spawn , start rotating , when player click on it , remove it from the Dqueue List or something?
only rotate if a player is in range?
Hmm, I'm trying to think of a way to work around the issue, but I'm currently wondering if workload distribution would even help in your case. If you are using entity armorstands, then it wouldn't matter if you split up the rotation tasks since the presence of the armorstand itself would be contributing to lag. Which in turn could make the TPS worse. And since workdistro depends on the tick itself, you might lose the smoothness of the animation.
@Override
public void onPluginMessageReceived(@NotNull String channel, @NotNull Player player, @NotNull byte[] message) {
ByteArrayDataInput in = ByteStreams.newDataInput(message);
String identifier = in.readUTF();
String data = in.readUTF();
System.out.println("Identifier: " + identifier);
System.out.println(data);
}
https://paste.md-5.net/mamuyuhexa.bash
but why?
$:32 is String identifier = in.readUTF();
so shall I read line?
what are you trying to read?
it would depend on what you are sending and what you want to do with it
but im sending nemo_support request
The error says you ran out of input
ok so i made the plugin and its in the plugins file but its not detecting it
wat do i do?
?paste latest.log
register it
Don't get me wrong, workload distribution is great and has it's place, but I'm not sure if it would bring any noticeable benefit in this case. It would help when the TPS is down, but if all you are doing is rotating armorsands, then you might have a case of diminishing returns. Rotating entities isn't intensive at all.
and use plugins logger, just doing getLogger()
when I read Plugin Message via readLine it also adds random characters like this one: β
any clues why?
I also got greece Omega and Beta
because packets are not just text. they contain bytes
you need to read each part of teh packet as it was constructed
well Im writing 2x
and also Reading 2x from the packet
there is a lag spike (in some ticks)
its not 100% smooth , i want it be smoother ..
What's your current TPS?
Are you currently using the workdistro approach to rotate the armorstands in that video?
no , iam using the normal way , no workdistro aproach used
Can you share your current code? I'd like to test it myself.
i wanted to make it go up / down / sideways , but that will make allot of lag , so i decided to make it only go one way [rotate]
I got this now: β¬
the default rotation speed is :
0.14
Hmm, there is also the possibility that the stuttering comes from your PC.
Here's my results.
so i have a question about using packets for rotation , so i need to send the rotate packet , every 1 tick? would'nt that [sending to many packets to players] ?
oh you are running , delay 20 * 5 , 5 seconds?
Ehh, not exactly. The rotation packets are small. Plus if the server wants/needs to send packets it will. The real issue occurs when it's the otherway around.
I mean, yes, you will be sending more packets to the player, but it's proportional to the amount of armorstands spawned.
anyone knows gradle plugins for obfuscation?
and period 1 tick?
Yea, the delay is just a delay before it starts executing the code. The period is one tick, meaning that code runs every tick.
Just for testing purposes. I didn't want it immediately running at startup.
y u wanna obfuscate
i think the stutter you see might be client sided (FPS), not lagging the server (TPS)
theres nothing you could do about that then
it will be better for players with a better pc who are not running a test server
just spawn more armorstands for players with a better pc so that they will lag equally
hey sorry for the late reply, but could you give me some examples of said command frameworks or how this is implemented
Guys, who knows how I can get a list of available enchantments for a specific item? (default)
For example, for a pickaxe: SILK_TOUCH, LOOT_BONUS_BLOCKS, DIG_SPEED and DURABILITY
Because only on them can the pickaxe be enchanted
its pretty smooth how xd?
does anyone know how to refresh / update the whole scoreboard?
seems like its client render lag, but like maybe this is at the point where it was just spawned? If so your gpu hasn't had time to optimize it and then it smooths out
Is there a way to load player head textures faster in chest guis?
I now have enchantments written in the config by categories, such as "sword", "pickaxe", "spade", but I would like to simplify it all in order to remove categories
When I change a skull meta owner player, it takes about 2-3 seconds to load the head when I display in a chest.
Textures are pulled from Mojang servers
declaration: package: org.bukkit.enchantments, class: Enchantment
So prepare teh head before you need to display it
never said it was FPS lag, said it was render lag which isn't quite the same
in other words, the GPU displayed or rendered what it got immediately but hasn't had time to optimize to smooth it out. Doesn't mean the Frames per second drops
an example I can give that is a perfect analogy is if you were looking at an object and it started to suddenly move and continued moving. At first it would seem out of focus but as you stared at it your eyes were better at re-focusing. But you didn't stop seeing because that happened
uhh ive come accros a popular one recently but i forgot the name, could be brigadier
oh thanks for explaining , but do you think packets will be better for rotation armorstand?
most likely as it would reduce the server having to do anything since it is mostly client side anyways
the only disadvantage is that the server stops tracking it so if you need the server to track its state or what have you, then you have to handle that appropriately
[lootbox spawn , player click on it , it drop items , lootbox despawn , lootbox spawn after a cetrin time]
and lootbox keep rotate ..
thanks
do you think i will need packets for this?
need? no, is it recommended? maybe. only you can really decide which is best
does anyone know how to refresh / update the whole scoreboard?
How can I load a skull with texture, and then reuse the texture without having to reload it every time I open an inventory? How would I store it
guys why didn't work?
`# made by sussolino#6969
command /tempban [player]
trigger:
create a new gui with virtual chest inventory with 3 rows named "JuiceStaff"
format slot 10 of player with red concrete named "&eCheating" with lore "" to close then run [make player execute command "/litebans:tempban %arg-1% 14d Cheating"]
format slot 11 of player with red concrete named "&eBug Abuse" with lore "" to close then run [make player execute command "/litebans:tempban %arg-1% 7d Bug Abuse"]
format slot 12 of player with red concrete named "&eTruffa" with lore "" to close then run [make player execute command "/litebans:tempban %arg-1% 7d Truffa"]
format slot 13 of player with red concrete named "&eBan Evading" with lore "" to close then run [make player execute command "/litebans:ban %arg-1% Ban Evading"]
format slot 14 of player with red concrete named "&aMinaccia" with lore "" to close then run [make player execute command "/litebans:tempban %arg-1% 30d Minaccia"]
format slot 15 of player with yellow concrete "&eAltro.." with lore "" to close then run [make player execute command "/litebans:ban %arg-1% %arg 2%"]
format slot 16 of player with black concrete named "&aDDoS" with lore "" to close then run [make player execute command "/litebans:banip %arg-1% DDoS"]
format slot 17 of player with red wool named "&aEsci" with lore "" to close`
Go skript discord for that question.
It looks very similar yea.
It's like a weird hybrid of actual code and pseudo code.
I have ByteArrayDataInput which reads from array of bytes
Is there a way to do something like?:
while(byteArrayDataInput.hasNext()){
stringBuilder.append(byteArrayDataInput.readUTF());
}
i mean usually for array u define the size before the elements
someone should make shakespeare language
Any ideas for a concurrent List? I need to be able to use the add remove iterator get without getting a ConcurrentModificationException
also list.sort
iterate and use iter.remove() to modify
store to be removed and remove after loop
or use a copyOnWrite list
an iterator would not fit it
then lock access behind some synchronisation.
If you want it safe you have to either iterate or lock access
or CopyOnWriteArrayList
its not heavy lifting, but can become expensive if you do a LOT of add/remove
well
it is a crates plugin
so I expect at least 50 players opening 64 keys at once
thats not much
declaration: module: java.base, package: java.util.concurrent, class: ConcurrentLinkedDeque
I need a List
but I need a List
Why?
specially for List#sort
declaration: module: java.base, package: java.util.concurrent, class: ConcurrentLinkedDeque
or copyOnWrite. Both you can sort
learn to work with other API stuff instead of just assuming you need a list
a list will not work for what you are wanting because it isn't concurrent
but a list is typically not strictly required in MC either
problem with copyonwrite is that it is inefficient as you scale
nope, but it would need to change constantly it sounds like
that method is expensive on the modification portion
but super optimal for reading
Anyone knows a way to obfuscate a jar like what this guy did?
Its so hard to deobfuscate, I dont need something exactly like that but something close to it i guess
It sounds to me like he's only going to modify when a chest is opened.
actually I just need to read
it also directly supports his requirement of sort
would be cool if anyone cared to check this
imma sleep now, so ill check answers tmrw!
gn
Iβm interested aswell.
if I use List#toArray, will it throw a ConcurrentModification exception?
I dont think so
cool but
if more then one thread attempts to access the list, it will throw a CME
it just sounds like you don't want to learn anything else
now I think I just need it to be thread-safe only when reading the list
I remember having a similar issue back in the day. If I remember right, this was due because I did remove an element to the list while doing something else so the list. So the fix was to either iterate through an iterator of it or duplicate the list and work with the dupe.
so if that is the case that you don't want to be bothered learning something, made no sense to come here for help when you are already dead set on using something that isn't designed for what you are wanting
it just wastes peoples time to try and help you when you are just denying all the various solutions that do indeed work.
you do realize you can have an array list still? Each thread can have its own array list that is backed by one of those api methods
in this manner, you are free to use your list like you are wanting but still benefiting from the concurrent api methods
but this is just a waste of resources over some arbitrary requirement
anyways, with that I am out
Hello,
Im kinda stuck how to sync virtual inventory with player inventory. I just want only few slots from inventory to be visible in GUI.
Can I somehow loop true inventory ex. every tick or something like that?
Thanks for help.
why would you do it every tick?
if you have a virtual inventory, its a matter of copying the contents from one to the other when the player opens their inventory listening to the playeropeninventoryevent
and then, to ensure they mess nothing up, listen for the inventoryclick and interact events
in all that, there was no looping required
I was looking for an openinventory event, I don't know how I looked, but I couldn't find it π Now I find that.
Can I somehow get witch action is done? Mby that cloud help me out?
I need monitor changes and then change second inventory to match the first one.
InventoryOpenEvent?
I already found it, I must have been blind or idk π
In Location, are the doubles counted as block? Like double y = 1.5 then it would be counted as one block and half?
Ok thx
I have this to rotate the entities
The problem is that I want to spread the entities like this
Where do I change this?
this is one way of thinking of it, but not exactly accurate
but if that is how you want to view it go for it I suppose
you want to make them face the block?
while having them rotating around?
yea
my code already do this
but all entities are together
like this
I want them to have a equal space between them
I know I need to change the angle for each entity
but I dont know exactly how to do it
Okay
So
Your total angle will be 360 / entityCount
feel free to convert between deg
You can add some variation
like +-2%
or an initial angle
If you want it to look more natural
my beautiful image
with no explaination
did it in radians since the java sine and cosine function use rads
Radians how it should be fuck the degrees
yeah I agree
just think people are more familiar with degrees
π gradians
Annoying I have to link spigot accounts to get embed perms
damn boosting doesn't work either
Lol
Hello guys, i have a problem i'm using i want to have a cooldown on a item but idk how to do it ? please i need some help
Make one yourself is pretty much the only option you could use the set cooldown but it does it for all of that material type
im on spigot 1.8.8
Lol good luck
Too old! (Click the link to get the exact time)
soon kids gon be playing 1.8 that weren't even born when it was made
mad
any idea how to make world gen using nbt structure files?
facts
declaration: package: org.bukkit, class: Bukkit
I tried that, but it generates a void world?
tried what
Have you still not got that working? The issue is with your nbt file.
I generated a new one
you are taking the snapshot at teh wrong place.
have you checked the file to see if it contains anything resembling yoru structure?
It produced a stack trace
will this piece of code kill the player if they touch sand?:
@EventHandler
public static void OnPlayerMove(PlayerMoveEvent pm){
Player player = pm.getPlayer();
int x = player.getLocation().getBlockX();
int y = player.getLocation().getBlockY();
int z = player.getLocation().getBlockZ();
Material block = player.getWorld().getBlockAt(x, y-1, z).getType();
if(block == Material.SAND){
player.setHealth(0);
}```
cant tell anything from that error. It looks like a crash not an error
hmm
IT did stop my server
can't apply potion effect to living entity
Yes, but it's bad code
couldnβt you just subtract 1 from y and check the location
i think location has subtract method no?
if (player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.SAND)```
that's way better, i followed a tutorial so it wasn
the best of code
i'm also new
so thanks :)!
e.getTo().getBlock().getType() == Material.SAND
close, you have to get teh block below
Same
Also e.getTo() can be null (I believe, without looking) so is inferior
Are tehre any ways to change armor durability damage builds like this (https://minecraft.fandom.com/wiki/Armor) within a plugin? i rly need to fix sharpness 10+ items f*cking armor
yeah obv, but. iwant it to still fairly work like vanilla (mechanic 4 hp = 1 armor point) but just not as mch yk
if i setDamage to like 1 and i spam you then your armor also instantly breaks
?paste
did you try to restart while chunks were being generated?
no
I just spawned in
then it crashed
?stash
what do i do here exactly?
that was for me
o
this is confusing at org.spigotmc.RestartCommand.restart(RestartCommand.java:40)
me?
server hung
would it theoretically be save to send 2k particle packets per second π€
I doubt you have the bandwidth to send 2kper player
localhost should handle it but not over a network
Yeah I'm just trying to see if there's a way to visualize my abstract shape algorithm
your client will not be happy but as a test it shoudl be ok
time to buy the new threadripper cpus to test this out
single core performance more important
i want people to be able to register their own effects with my plugin, but where would i start with doing that? i need to get the methods of the class when someone registers their effect class which im not sure how to do (couldnt find anything online)
hm
I mean both are important
the algorithm runs multi-threaded
and we can send packets async
yours might
i didn't think about that
I was thinking more about rendering the 2k particles
If you mean by using your API, then you'd need an abstract Effect class which players would extend. Then when they call the function to register with your plugin, you know it has the Effect type so you already have the methods available
you shouldn't need their actual implementation
Hmm I'm thinking on how I can improve this
Is there any paper or article about converting an abstract region into the smallest possible set of cuboids π€
}``` how would i get the methods from clazz though? i cant just use clazz.run()
It really sounds like a machine learning moment but there could be a way
type T must be non reifiable in relation to the method run()
omg thanks
If you actually want to use .run you'd need an instance not a class
(i.e. use T, not Class<T>)
I have tons of classes that use an instance of my main class. Normally I use use a constructor to get an instance of the main class but I feel like is there a better way. Is there a better way then using a constructor for lots of classes?
thats just dumb
There are generally two ways, dependency injecting (the one you are using), or getting singleton instance
I heard some people use an interface for passing it to multiple classes but Ive never seen someone use that
There is builtin spigot method for getting instance of main class
yeah
using the Bukkit class
i think you call getServer() and then getPlugin()
im not too sure tho
Nah, it's JavaPlugin#getPlugin
There is really no reason why it's better
Lot of people don't approve that here because it can really easily lead to static abuse
I see
Can someone explain what static abuse is? I used to overuse static methods but now I rarely use it
not sure if I am underusing it now
You should Google what static var/function means
static abuse has no real definition. Just don't use static where you shouldn't be using static
If something has no state or is a constant, declare it static
ok yeah I am definitely under using it then
is the plugin not a constant tho?
i dont see why its frowned upon to use a singleton
i find it much easier
to each there own there has been many debates on this on the forums somewhere but i cbf to find them lol
classMap.put(clazz.getEffect(), clazz);
}```
```public HashMap<String, T> classMap = new HashMap<>();``` ```Required type:
T
Provided:
T``` <-- from ```classMap.put(clazz.getEffect(), clazz);```
public hashmap π wtf
anyways if your going to do something like this you should probably just add the T generic to the entire class
i did
it made me π’
it made me isn't an excuse for a horrible design pattern
if it works it works
where do you see there an design pattern
why not public, just curious
I was simply able to inferance by saying "it made me" tells a huge story about the design of the project itself
while there are a lot I don't know the specifics of its clear that there isn't great design
oh i thought there was a reason for hashmaps specifically π
no thats the reason for any class field
yaya
the whole point of putting it in the class in the first place is so you can be explicit with the uses for the field itself
use the getters
prolly not even getter for hashmap no?
just straight do this do that
well for collections i would go one more step and not explicit return the collection itself
yayaya
What
either you want T, or a subclass of T extending Effect. but if you have a classmap, you probably want to pass in a class anyways
You probably should be learning more basic stuff generics can be complex
That or spend time reading up on generics
Before using them
how do i convert this into a jar
compile it?
how
ok so like
Take the folder the stuffs in
Compress it
Then use a converter to convert it to jar
oh you are not developer
Om
Am
Bm
Cm
bacailly i got a buildbattle plugin but it will disable it self if it detects that its running on a version of spigot taht it dosent support
C major
π
π
you need IDE
Thats the magic of google
why don't you just install correct version
idk what thing it supports
but ik it will work fine
i just deleted the line of code
that disables it
all the guides on compling it r confusimg
Theres a thing called google yk that right?
The essential tools for any Java developer, including a Java IDE, a Git client, XML Editor, Maven and Gradle integration
yes thats what i hav
You did something else. I just download, extract and use.
Create your project first
here is what you do: download this first instead https://www.jetbrains.com/idea/
I use eclipse because my computer is not good. π₯²
@fluid river
Xd
Man you srs gotta open up google bro
It literally takes 2 seconds to get the answer
π€
Nah bro, more than 2 seconds.
πππ
π
bruh.jar.src.rar tf happening over there
i named that
π€¨
THE SOLUTIONS ON GOOGLE DONT WORK
why not
What error are you getting
have you checked if theres a version of the plugin already that works with the spigot version you want