#help-development
1 messages ยท Page 613 of 1
https://docs.advntr.dev/minimessage/format.html#selector
This is so sick
I never knew minimessage had this
I have no idea about addons. Generally what i know to be a addon means it needs something else to work. If its it own plugin it should work otherwise idk. I dont pay attention to plugins more so from other sites
I was always confused by this, vanilla /tp command teleports passengers as well
So this must be a bukkit/spigot quirk, right ?
It does the dismount trick
Really ?
I feel like there would then be some visual disconnect between the entities in that case.
Just a general question - if you guys were to autoscale minecraft instances, how would you go about doing it? Certain % of the maximum playercount? Have an extra instance free? etc.
How would you guys negate PlayerItemDamageEvent? I want to negate the damage being taken from a pick when it mines a specific block. I would just negate it within BlockBreakEvent, but I want it to account for Unbreaking. If Unbreaking procs, I don't believe PlayerItemDamageEvent triggers, so I'm thinking I need to handle that event, and somehow check if a condition is met before I cancel the event (since I'm only cancelling the event if a specific requirement is met).
Specifically, how can I tell the PlayerItemDamageEvent the context of BlockBreakEvent, such as what block was broken?
What do you mean by "negate" ?
Cancel ? Or change the durability damage value.
When BlockBreakEvent triggers, under certain conditions, 100 points of damage is added to the pick. When this triggers, I need to cancel the PlayerItemDamageEvent when it triggers next, since I already added the damage I wanted. This will negate the unbreaking effect, since regardless of if it triggers or not, my damage is still added (and I won't have other damage offsetting my 100 points of damage from the PlayerItemDamageEvent)
So, I want to cancel the event.
Assuming the order of the events fired is always the same, you could just give the player a flag and check if the player has that flag in the next PlayerItemDamageEvent.
Not the most elegant solution, but it is one that should work.
If I understood your request correctly.
I hate thatttt
If unbreaking doesn't trigger the PlayerItemDamageEvent, I can't gurantee that the next PlayerItemDamageEvent will be from mining the specific block right?
Is there an easy way to time out the flag? That would be janky, but should work.
@vivid cave you gotta be abusing the discord api and sending the api post requests for "typing"
right??
like holyyy
it reminds me of soemone in general
Right, in that case just store the current tick or something. The events should not happen outside of a specific tick.
god
they were typing for like 8 hours
yeah
bumpity bump bump
Haha thanks for your extended answer.
To be fair I was mostly kidding/venting.
I know what an API is for and totally understand its motivation.
However I don't always agree with the convenience part.
It seems not to bother people to add a whole dependency sometimes just for a couple of lines of code, because they couldn't bother to head into more technical stuff than what they are used to.
In my experience, the more dependencies you have the less maintainable your project is. Because you have to wait for their update cycles, if you have a bug well sometimes all you will be able to do is "post an issue on their repo", and last but not least many libraries are ruthless to their users: deprecating / removing features how well they want uhm uhm paper, refactoring core features because "it wasn't modern / standard practise enough blablabla".
In reality I consider a dependency as a loss of control over your software. As the name suggests, you depend on third parties. Sometimes it's for the best, but I feel that nowadays people will just consider the small time gain over everything else. And imo it's the very reason why browsing the internet has become a hellish place. From shopping websites to qol apps, I feel we've never been more exposed to bugs, inconsistencies and overall poor user experience.
Yes
oh real
What attribute do players have to set flags? Other than scoreboard tags, I'm not seeing a way in the api to do this, unless I'm misunderstanding.
?pdc
but maybe meta might be enough, but I don't really know what it is meant to be used for
Thanks, I'll give a read
Any way to get the current tick of the server? Reading around and getting mixed answers that don't seem to work well.
I guess you can use the current world time instead of server tick.
Should be effectively the same.
I agree, the only dependency I have is to use a fucking anvil gui without nms xD
FullTime should work yeah?
I think so
Ok cool
I would have to look in the code. But generally the server doesnt teleport entities and does the method i described in how to make it smooth. In other words it kills the entity and spawns a duplicate at the destination. This is how it works for portals anyways
So wouldnt surprise me if the vanilla tp command worked similarly to the portals in regards to entities
Hence you dont notice the disconnect
is it possible to get the hardness value?
Yes
and how?
declaration: package: org.bukkit, enum: Material
Thanks
They are in fact not the same. World time resets. Server tick doesnt until it hits the max and resets
Which will take a long time because if i am not mistaken the server tick is backed by a long
Yes, but for they are trying to do, the number itself does not matter, what matters is that it is a "tick" number.
Also the World#fullTime is long as well.
I meant the time for the world loops around
Oh ye that time
That should not be fullTime tho
Well not sure what they need, but one of the times does not progress past a certain point and just resets back to 0 lol
If it doesnt matter for them then i guess just go with the time as that is more efficient
Its a trade off, as we usually say it, there are no zero cost abstractions
PlainTextComponentSerializer.plainText().serialize(yourComponentHere) will I lose color codes
rat bags
colour codes ?
Hey, in BlockPlaceEvent what does the bool "canBuild" track? I couldn't find anything more descriptive than it being a bool
components don't have colour codes
hwex code
if you are including ยงa or the likes in your components, you are doing something wrong
ah
Well, yea
conclure was correct
is there a way to keep that
serialize to json instead ?
yea
you'd have to pick some format that is capable of representing a component
be that legacy text, json, mini message
or even better, is there a way to set the tablist name of a player to something with color codes in
Probably better off using minimessage if they using paper
player.playerListName(yourComponentHere); ?
can Bukkit.getPlayer(String name) get the player from the unique id?
no
no, there is another method for that
declaration: package: org.bukkit, class: Bukkit
^ with UUID.fromString(String)
thanks, will have to redo it
Does anyone have any idea on how would I play a "trace" particle for an arrow?
I currently have this
scheduler.runTaskTimer((task) -> {
if (fastArrow.isDead()) {
task.cancel();
return;
}
if (fastArrow.isConstantVelocity()) {
fastArrow.setVelocity(fastArrow.getConstantVelocity());
}
minecraftEntity.tick();
if (fastArrow.showParticles()) {
if (isVisible.get()) isVisible.set(false); //Set to false if still true
World bukkitWorld = fastArrow.getWorld();
Location bukkitLocation = fastArrow.getLocation();
bukkitWorld.spawnParticle(Particle.CRIT, bukkitLocation, 10, 0.15, 0.15, 0.15, 0);
bukkitWorld.spawnParticle(Particle.EGG_CRACK, bukkitLocation, 2, 0, 0, 0, 0);
}
}, 0, 1);
The problem is when the arrow is too fast, for example a velocity multiplied by 30, the particle gets displayed each 15-10 blocks aproximately, not "constantly". Is there any workaround I could do?
you'd have to do what the client does: interpolate the position of the arrow yourself
How would I do that?
โจ math โจ
What is the best way to keep fallingblocks into fallingblocks state? I dont want my falling blocks to turn into solid blocks when close to the ground. (I know I can keep it away from the ground but I want to walk around like a block). I tried to cancel EntityChangeBlockEvent but this makes the block disapear because it doesnt create the solid block but does remove the falling block. Does someone know a good way to help me out?
What version are you on ?
1.20.1
If you can, use display entities
Talk me a little through that one please?
Does this only show the entitie to me? or also everybody else?
open google, and type in "Minecraft Block Display Entity"
It is an entity that can show block state models
Ohh, thats good to know. Im going to try some with that. Thank you!
I love converting ppl from armorstands or falling sand to the superior display entities.
Didnt know this existed. This also feels like a better solution instead of the fallingsand armorstand solution
Yeah, it is much more performant as the model shows only the front face (unlike falling sand that shows the backside as well for some reason)
You have only one entity that barely ticks server side
Was added in like 1.19.3
I dont see any way to set its velocity, is it only possible to keep teleporting the display block or is there a way to make it more smoothly?
Oh for movement tho...
It has one tick interpolation so teleporting it will look janky
The solution for that usually is: make it ride a different entity (armor stand) if you want to move it smoothly
But you might want to check the interpolation feature the display entities have.
Ahhh, ill take some time to look into this. Is it possible to make it ride an armor stand because if i check the javadocs, i dont see armor stand as vehicle
And the addpassengers function tells me that if it cant ride the object, it will just return false and do nothign
yes, you can make any entity ride any entity (except marker entities, those are a bit special)
the Vehicle interface is used only for minecarts iirc (maybe boats) vanilla intended rideable entities
the API for that was never really finished as well XD
Ahhhh, i see
Do you still use the API to make an entity ride an armor stand or do you create your own way (asking so I know I need to check out how to do this later)
setPassenger
the addPassengers should work
add ๐
feel free to tag me in that case
GL
Thank you for the help!
Could even use particles too
Hope it's okay to ask math related questions here
I'm trying to make a circle of particles that appears in front of player, and it should rotate (so the circle is in a plane whose normal vector is player look direction)
Managed to make circle follow player's yaw and pitch, but I have no idea how to "combine" these two rotations, this is the code ```java
Location origin = event.getPlayer().getEyeLocation().clone();
for (int degree = 0; degree < 360; degree+=6) {
double radians = Math.toRadians(degree);
double x = Math.cos(radians) * R; // radius
double z = Math.sin(radians) * R;
Vector v1 = new Vector(0, 0, 6);
Vector v2 = new Vector(x, -z, 0);
Vector v3 = v1.clone().add(v2);
rotateAroundAxisY(v3, Math.toRadians(-yaw));
// for pitch, v1, v2, v3 are same, and:
// rotateAroundAxisX(V3, Math.toRadians(pitch));
spawnParticle(origin.clone().add(v3))//this is just a wrapper```
By rotate you just mean the colour changes?
not a solution but:
don't create new vectors every loop, create them before and then just v.set(...)
Also, no idea why you're cloning v1 when you don't use the original v1 for anything later
overall: create less objects whenever you can, otherwise the memory will die
I think they mean rotating the circle
I'm just confused what that means
like rotate just one circle in both yaw and pitch
Because a rotated circle is just a circle
rotate in other axes
well yes XD, but the direction the circle is facing is different
like the circle all ways faces the player
I understand the code is terrible right now ๐, but optimizations are for later
Imagine a vector that is coming from the player's eye direction
Then, imagine a plane that vector is perpendicular to (i.e. it's piercing that plane)
That plane is "facing" the player and the circle is on that plane
that's what I meant by rotating
It can be any other shape really
Looks like it always faced the player in the gif lol
yes, but the circles are rotating on separate axis
They don't know how to rotate on both axis at the same time
there were two circles he wants only one
Correct
also I apologize if this isn't really the best place to ask - asking in the math community and mentioning Minecraft would imo be even weirder
I've seen someone here flexing their ability to shutdown PC with new "jni"
You're fine lol
Eh, I'm trying to be nice
entity.setDisplayName("name")
entity.setDisplayNameVisible(true)
can you not just use Vector#rotateAroundX, Vector#rotateAroundY and Vector#rotateAroundZ to transform each particle
Hey guys I want to build something like a little Cache. I need to store vars and Lists as long as the Server is online..If the server gets restarted they should be wiped...I had a static class which I always tried to read of...But this isnt a good use case. Any sugesstions?
What api do I have to use to get org.bukkit.craftbukkit import?
use spigot
I'm using it
you see, rotating around Y is easy (it's just yaw), however after that, it's not aligned with X and Z axes, and if I applied only X rotation then it works just in one 3d quadrant (if that doesn't make sense: it works only for some of all the possible yaw/pitch combinations)
do you mean I should apply rotations both around X and around Z axes?
(the vectors I'd be rotating are from player's eyes towards the points on a circle)
you also need builtools run
yes
Ok thanks, so when it's finished building I just add the craftbukkit in a build path?
what
wait
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
๐
This is already in maven reposity
How can I spawn a Villager without Collision and not moving?
Disable the AI
how can i throw random fireball to a location?
how?
Does this work in 1.8.8
nope SetAI does not exist
rip 1.8.8
need that for a pvp gamemode
?howoldis1.8today
cant use newer versions ig
Or can I code my plugin with newer versions and still use 1.8 pvp?
?1.8
Too old! (Click the link to get the exact time)
OldCombatMechanics
there might me plugins for that i think
OldCombatMechanics does that
oh yea ok
So thats how Hypixel builds plugins in newer versions and run old mechanics?
hypixel has their own server software they've developed over time to support new features
no probably custom
hypixel runs a 1.7 (i think?) modified core and then they support versions up to 1.20
or 1.8 but even so it's modified
custom yeah
I just want to write a minigame plugin for my 1.8 server but everytime I want to build something everybody hates it because its 1.8 Spigot
hypixel kb is also not 1.8 kb lol
Well yeah it's like 8 years old
i'm currently doing a 1.8 commission and there's a reason why i'm charging 1.5x more than my normal price no im not
1.8's api is horrendous and very hard to work with
smart XD
only 1.5? lol
So you guys suggest I upgrade to 1.120 and then run ViaVersions and this OldCombat Plugin?
1.14.4 or higher imo
for pdc and other cool stuff
pdc?
?pdc
?pdc
lol
1.19.3 and higher for cool display entities :)
good point
1.20.1 for Spigot updates and support
i wouldn't even bother supporting 1.8 clients on a 1.20 server, vice versa, it's bad
well yeah the newer the version, the easier to work with
a lot thanks to increase in proper documentation
compare docs in 1.8 and 1.20
spoiler, there are basically no docs in 1.8 lol
you can still code in 1.8
but it's masochism
But there is one issue with the newer versions...They all eat so many resources
Well hardware got better since 1.8
aren't newer versions better optimised too
yeah sure but I want to save as much as I can
might be. They do also have more features and therefore more checks
they eat more yeah but if optimisation hadn't improved since 1.8, they'd probably eat twice as much
true
EmbedBuilder is jda?
or what is it
yes
DiscordSRV
Uh what do you guys think about Folia?
its cool
well if that's the case you would use a stripped down server software like minestom
make sure that Color is java.awt.Color
it doesn't improve performance itself
it just makes things more multithreaded
hard to code against ๐ฆ
But inst multithreaded better for performance?
wdym?
i mean exactly that
like you have to make sure of stuff
the server already can use a good amount of threads
multiple thread means you need to check thread safety and things like that
which would be the best performance server software I should code with?
i mean
paper probably
if your CPU is missing the cores to properly use folia, you will at best achive paper performanec
at worst, you'll slow yourself down due to context switching
So just use paper?
yes
spigot discord server recommending paper
isn't minestom usually used if you just wanna code and run a minigame?
final Random rand = new Random();
Location location = commandSender.getLocation();
final double angle = rand.nextDouble() * 360.0;
final double xDrop = location.getX() + 1 * 40 * Math.cos(Math.toRadians(angle));
final double zDrop = location.getZ() + 1 * 40 * Math.sin(Math.toRadians(angle));
final double yDrop = location.getY() + ThreadLocalRandom.current().nextDouble(2.0, 4.0);
final Location particle = new Location(location.getWorld(), xDrop, yDrop, zDrop);
Fireball fireball = commandSender.getWorld().spawn(particle, Fireball.class);
fireball.setShooter(commandSender);
im trying to make a random fireball shoots like a meteor but the fireball shoots and continues how can i make it drop on the ground like a meteor (im not that good in math lol)
if
well he said he wants to code a minigame
minestom is a different tool for a very different job
well
depends on what the mini game is about honestly
There is a paper 1.20 but not protocollib...Its for 1.19 max
that's true
use dev builds
^ PL has dev builds out for 1.20
but there are plugins like multiverse too
I mean, if you need plugins minestom is definitely the wrong pick
Minestom works if you have a one server one minigame instance setup
then 1.19
maby I will try to build a cloud later

hey, does anybody know if there's an event for Block.setType(Material)?
I mean you can always rewrite then
there is not
API calls rarely trigger events
unless specified by the javadocs
when you call Block.setType just call a custom event you make yourself
Why could the information about methods and functions when mousing over them disappear? Recently I had them
what ide do you use
IJ
have you tried restarting
yes
What packet should i use to show a fake helmet to other players?
theres an equipment packet
what spigot version?
yeah, the problem is that it's not my plugin that is calling it xd
i guess it's time for a pr
no
a PR exposing an event when a plugin modifies a block sounds not fun
org.bukkit.Color.LIME
ask the plugin that is, for some reason, modifying the block you seem to care about to expose an event
in the code
write org.bukkit.Color.LIME instead of Color.LIME
full qualifying name
Hey guys I want to build something like a little Cache. I need to store vars and Lists as long as the Application is online..If the application gets restarted they should be wiped...I had a static class which I always tried to read of those vars..But this isnt a good use case. Any sugesstions how I should build my Cache? My use case is a Minecraft Minigame and I store things like a Var which tells me they are in the waiting lobby phase and not ingame for example
why do you need java.awt.Color though
just use a list
an embed?
I tried using it but it isn't working, it equips and shows the armor only to the player not to who is looking to the player. I need to show the fake armor only to who is looking at the player not the player
so not Spigot?
someone?
LIGHT_GREEN
send the packet to the player you want to be able to see the armor
show some code
which the best minestorm or spigot and what the difference ?
so basically send the packet to the viewer not the player equiping the armor
minestom is barebones for you to implement server mechanics yourself while spigot does most of the things for you
hey how get entity in world in another server?
awt.Color and bukkit.Color are not interchangeable, You must use the correct one for your application.
multi-server plugin
spigot is better if you are just starting but minestom can be used if you need a specialized server
Is what im doing, but it isn't working
just translate alternate color codes
send some code
CraftPlayer craftPlayer = (CraftPlayer) player;
CraftPlayer craftViewer = (CraftPlayer) viewer;
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(helmet);
PacketPlayOutEntityEquipment equipmentPacket = new PacketPlayOutEntityEquipment(craftPlayer.getEntityId(), 3, nmsItemStack);
craftViewer.getHandle().playerConnection.sendPacket(equipmentPacket);
}```
If no one has helped you by the time i get home i will take a look at it. For as much time you have spent here you should look into getting verified and joining the blue name army 
!verify
Usage: !verify <forums username>
i just don't feel like to verify lol
but i know i can verify myself

This code will spawn a fireball somewhere near world spawn and always fly in teh same direction
ye
I am getting a error tho
yes, but i need to shot it directly to the ground, for an enchant
isn't slot 4 helment for 1.8?
or am i tripping
then set teh pitch of the Location
One too much: ")" ?
to -90
yaw? to 0?
It's 3, but that isn't the problem, why it isn't working
yaw doesn;t matter
fireballs work with motion, that ignores pitch and yaw
is default 0
If i remove 1 ")" it says ',' or ')' expected
let me test it
show the whole line...
this was the packet for 1.8
sendVagtkillEmbed(victim, deathMessage, ":skull:**__Vagt kill__**:skull:", deathMessage, victim, true, ChatColor.translateAlternateColorCodes('&', "&a");
seems to not work
then apply a velocity
sendVagtkillEmbed(victim, deathMessage, ":skull:**__Vagt kill__**:skull:", deathMessage, victim, true, ChatColor.translateAlternateColorCodes('&', "&a"));
setVelocity(new Vector(0,-1,0))
You need to set the velocity with the appropriate vector
err -1
-1
to move down
Elgarl knows listen to them lol
ChatColor.translateAlternateColorCodes is deprecated
I have a question is bungee api capable of requesting to get all the entities of a certain world in a certain server
what is the new thing?
What ๐
No
demm
Not unless you have a plugin on both to feed such info using plugin message channel
something to ask is a vanilla bug or the fireball goes in a curve?
depends on its velocity
send the whole sendVagtkillEmbed pls ?
too many ppl here now, don't know who to respond to xd
Threads would be better
i just set to what you said and it does a curve
yeah
say it easier)
At least it it progress from before
I didn't know it was ever deprecated, what version are you in?
it can;t "curve" with a -1 y vector
yes
1.20.1
so long as x and z are zero
Impossible I'm using 1.20.1 too ๐ค
seems strange they arent
if it is the big fireball, then it can't curve at all, they ignore gravity
||iirc||
this not good version
best this 1.16.5
it is not
?paste the method
you can remove setting the pitch as you are using velocity, but the rest of the code looks fine
String coloredString = org.bukkit.ChatColor.translateAlternateColorCodes('&', "&a123");```
that is deprecated?
on paper yes.
if ur trying to send the ChatColor thing
your using spigot or paper?
Oh I'm on spigot
don't pass the bukkit color to the method
?whereami
xd
its kinda strange but continuos to do it, probably is the dropY
^ yea best to head to paper discord for those questions
Love those vids
XD
change to the large fireball class and see if thats the same
Use MiniMessage on paper instead @umbral ridge
Adventure should have a serializer there
yes nothing probably velocity, with the dropY?
that's for @worthy moat
Ah didn't scroll far enough. Sorry!
Velocity is fine. from teh code you have posted it shoudl be impossible to have any kind of arc as teh vector is pointing straight down
Somehow it works with 3 to, and i found out that i used the wrong player in the viewer option
What color does the embed builder method take ?
arc only happens when its fired horizontally (effect of gravity and drag)
i can't even record it because lunar is not recognized
when i first made it was fire horizontally and even now it does
use the spawn method which accepts a consumer, so you can alter the fireball before it spawns
Ok so:
get the bukkit colors rgb, there is a method for it somewhere
create new awt.Color from that rgb and pass that
I think that is what you're trying to do
?
same
Fireball fireball = commandSender.getWorld().spawn(particle, Fireball.class, ball -> {
ball.setShooter(commandSender);
ball.setDirection(new Vector(0,-1,0));
ball.setIsIncendiary(false); } );```
nothing changed again
sounds impossible
are you doing anything else to the fireball, any other events that could interfere ?
no other than the location nothing else
the location?
wait
on fireball
its fast as fuck
who tf
I bet this came out of Mojank's decision but still...
but its heading to the ground not like \ but like |
so -0.5
so change the vector a bit
add a TINY amount to x and z of vector to alter it's angle
trying changing it but same result
Is possible to stop the server from sending some packets to online players?
new Vector(0.01, -0.5, 0)
Cancel them with protocollib
Without protocolib? Using nms
Well you can make your own netty injector technically
same heading | from where it spawns
you are changing the vector in setDirection ?
spigot (bukkit) Color has asRGB()
awt color is just new Color(rgb)
yes?
Works
Configurate (configurate-gson) adds signed files (.RSA, .SF, etc) to my jar, and I have to remove them every time manually, is there a way to make it not add those files?
heading like this \
if you want it always the same direction thats fine
now something to ask? to make at impact detect them and give the block to the players inventory?
if you want it random then use + or - 0.5 in x and z
ok thanks and how can i do that with a random in a list?
random in a list?
Maven shade has an exclude option
Also interesting font
ok..
can you send the whole class with the method and then the whole class where you want to call the method ?
(omit any sensitive data)
new intellij ui
yes to take the value randomly from -0.5 to +0.5
Ctrl+f rsa
I tried, but it gives me errors in 3.4.1, I downgraded to 3.1.0 and I still can't compile, one sec
shout out to poppins
Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project kitpvp: Error creating shaded jar: null on 3.1.0
๐
What errors does 3.4 give
also, once again explain what you want to do
Share errors and pom
its not
it is on paper
get on with the times lol
cool but this is spigot
Now it works fine, ty md_5
we know
we already went thru this
?whereami
Not again guys
i coded against both, not that much of a difference except that components are everywhere
I would not call "fixing bugs mojang has NOT fixed for community reasons and refusing to give an option to disable the fix" great
ok then it's not great
real
so why are we talking about it
tradition
If I had a nickel for every time someone asked about a paper deprecation
Iโd have a lot of nickels
https://www.google.com/search?client=firefox-b-d&q=color+pickxer
new Color(0xRRGGBB)
the RRGGBB is after the #
im alergic to nickel @young knoll
I thought you were doing something with spigot colors as well
Is there a way to shorten this?
use a main command and add subcommands to it
otherwise no
That sucks
you can make some wrapper for it but pointless
how do i register 2 classes to the same command but different args so like /gen list is 1 class and /gen give is another class but they are the same command
yes
you COULD use reflection but i dont recommend that
to register a whole package
probably should have explained a bit more lol
replace the RRGGBB with the HEX the site gives you
so it becomes 0x2E8B57
Hey, small question. Anyone knows:
((CraftPlayer) p).getHandle().playerConnection.sendPacket(packet);
in 1.20.1?
Then it's best to put it in a method in main JavaPlugin class to keep onEnable() shorter? I guess
how do i register 2 classes to the same command but different args so like /gen list is 1 class and /gen give is another class but they are the same command
Ahh, thank you so much
((CraftPlayer) player).getHandle().connection
it's been two minutes, wait a bit before asking again
you only register /gen. the rest are args
i think he means like when registering it in the onEnable
i think i have it. It is:
((CraftPlayer)player).getHandle().c.a(packet);
yeah but if he has another class with different args
?nms
args do not matter, you ONLY register the command
ok in his situation lets say he has 2 classes, ListGenerator and GiveGenerator, and they both implement CommandExecutor
use mappings
how do you register it then
that is up to them how they want to implement the args
if they want to use different classes for them then they can
they woudl be two completely different commands
yeah i have something like this
you only register teh BASE command, args are upto you how you want to handle them
be it a switch or an if/else
yes
follow the link, you are not using mojang mappings
sorry for the ping but how can i do it without list like some java function?
what list ?
I don't recall you having any list
learn to use Random and pick an int 0 to 1
random can pick even negatives number?
It can if you subtract
random == true ? 0.5: -0.5
random.nextDouble(upperBound) - number
using random as a boolean
so you keep the same angle
it will probably look odd if you use an actual variable value between -0.5 and +0.5
I mean.. meteors fall from all kinds of angles, not only 45ยฐ
probably.. never seen one
they do, but they are also in a swarm all flying the same direction and angle
probably shouldn't be better to take a random position near the player to aim the ground?
it all depends what exactly you are trying to do
im trying to make a mining enchant when the fireball hits the ground that zone will be mined
so you are targeting a specific place when you do this?
not a specific place
just randomly so the player can have the impression of a meteor shower
if you are launching multiple at the same time then use the same angle for each one
i just done the thing i asked, one last thing there's an event when a fireball gets to the ground?
ProjectileHitEvent
ok thanks
wouldn't that be
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityExplodeEvent.html
?
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
fireball is a projectile, bnut either coudl work
if she wants all teh blocks when it explodes
then explode
if she only wants when it hits, then Hit
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
you got the almost same line 7 times
Color color = getCorrectColor(victim);
sendEmbed(victim, deathMessage, ..., color);
private Color getCorrectColor(Victim victim) {
// ...
}
alex literally gave you code
you seem to lack basic knowledge about OOP
hence ?learnjava
?
this is 100% the same code, 7 times! o0
it should return the correct color for whichever highest rank victim has
i thought that was obvious
if you ever see the same line twice, you're probably doing something very bad
you have redundant argument in method
you never use Player player
and also its always "victim" when you call that method
Same as alex, i would highly suggest you to learn fundamentals first
We've been telling them that for weeks now
God i love just reading this channel
Pretty sure itโs for language translations
If PermissionsEx still work, should I consider using LuckPerms or any other permissions plugin? If so, why
PermissionsEX is outdated, thats all.
Yeah.. But it still works yeah? No other issues?
So it's still ok to use it in 1.20.1?
^ for code yeah
I'm using it yeah I was just thinking if I should switch to LuckPerms, to put it on the server
It seems rather complicated though, I'm used to permissionsEx, i've been using it like.. always
use whatever backend permission plugin you prefer
Is there much difference in config files?
quite a bit
You don't really touch the config in LuckPerms
You do everything via command or web interface
I used to be a huge pex fan but after learning LP Id never look back. LP Has way more features and is 100x easier to use
I see, thanks
Yeah, I heard luckPerms does have nametags implemented?
Other than the api, lp wins everywhere
Or did I read wrong
it shouldn't. Not the job of a permission plugin
Ok thanks
because you only use 1 else if
a) that should be a method b) use else if, if youa rent gonna make a method
only the top if will only send 1 of them
the rest are all seperate ifs so dont care what the result of prior is
yeah
but you should learn java and make it a method
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
if you want every embed for every permission they have they shoudl ALL be if statements and no returns
no else
Is possible to get a player from his entityId?
if online yes
How?
Im using protocollib
i'm trying to make a potion with effects (to display in a gui) and this code seems to not add the effects successfully:
val allEffects = ItemStack(Material.POTION)
val potionMeta = allEffects.itemMeta as PotionMeta
for (effect in kit.getPotionEffects()) {
println(effect)
potionMeta.addCustomEffect(effect, true)
}
println(potionMeta.customEffects)
allEffects.itemMeta = potionMeta
console output:
[19:34:38 INFO]: JUMP:(107374182t-x1)
[19:34:38 INFO]: [JUMP:(107374182t-x1)]
so it seems like the effects were indeed added but they are not on the item
you know nothing about java's syntax but you refuse to check out ?learnjava, well then I cannot help you
Is allEffects.itemMeta = potionMeta equivalent to calling setItemMeta()? Or is it just setting the field?
Kotlin syntax annoys me lol
that depends on whether the field is visible lmao
Anyways, the reason it's not working is because you're adding a custom effect. You'll probably want to add a base effect
if the field is accessible, then it sets the field. i not, it calls setItemMeta
idk how it knows which one is the setter
Yes
but what if i want to add multiple effects?
You can do that with custom effects but you just need at least one base effect
set
its potion data iirc
Correct
it only takes PotionEffectType though
what if i want to specify the duration & amplifier?
setBasePotionData()
use potion data
afaik it only shows the available effects if there's a base
it appears there's no potiondata in 1.8?
Oh dear. PotionMeta has changed a lot between 1.8 and 1.20
I don't even remember how to go about it
you do it by updatin
~~ i'm torturing myself but i don't have the balls to say that i am voluntarily coding this particular plugin for 1.8 so i make excuses like "commissions"~~
rage quit the comission
it doesn't seem that useful ๐ฆ i cannot specify the duration/amplifier, and i am limited to PotionType
Not sure if 50% would be enough solatium
Yeah, level 2 is amplified, extended is duration
Though there are methods for these
new Potion(PotionType.SPEED, 2).extend().apply(itemStack);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.addCustomEffect(...);
itemStack.setItemMeta(itemMeta);```
I think that should work
But this is 1.8, I honestly don't fucking know lol
Better yet you can create an ItemStack directly from that if you want
ItemStack itemStack = new Potion(PotionType.SPEED, 2).extend().toItemStack(1);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.addCustomEffect(...);
itemStack.setItemMeta(itemMeta);```
indeed level 2 is amplified, but what if I want level 100 with duration 7 hours? adding a PotionEffect with PotionMeta#addCustomEffect allows to do that, but creating a Potion does not
but if I understand correctly, the first effect must be a legal base effect and everything else is up to my imagination and can be added with PotionMeta?
Right
well that's painful
lol
maybe there's a way to hide the duration of the potion effects?
or even better, is there a way to find the translation keys for those effects and use them for lore?
I created an api and integrated it into my plugin by adding:
<dependency>
<groupId>me.kyren223</groupId>
<artifactId>Kapi</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
My issue is when I put in the server the jar file I get an error of some class files fro the kapi api missing
What settings do I change so the .jar api will be included in the plugin jar (so I don't have to add another jar as dependency)
Oh alright thanks, I added that scope tag because it didn't work (but accidentally copied the original lol)
the provided scope is only for something that is either provided by something another maven dep or a server software
seems like there is none, i'll just use english fuck it
Both regenerateChunk and refreshChunk are Deprecated so what is correct way to regenerate chunk?
You kind of can't
just overrite chunk data with custom world generator?
refreshChunk() is more for client synchronization but it's iffy, so not relevant here. But the reason it's deprecated is because the world generation has changed so much that it's in a state where you can't really reliably regenerate a chunk and expect it to match 1:1 to what it was before
You might get structures or cave carvers in your chunk that weren't there before
You can use it. It will work. It just cannot guarantee 1:1 from world gen
Terrain will probably be mostly fine
I just want to play and learn custom world generation so I need some method to
regenerate all chunks in selected region
Oh, then yeah that's probably fine
You can ignore the deprecation warning there then
ok
Don't worry about refreshChunk() though. That's probably not what you want
hey, does anybody know how to remove the music disc - 5 line?
I tried with hide attributes but it doesn't seem to work
As I remeber it's client side
oh
How can i overwrite an already sent packet using protocollib?
Is there a way to send a player to a minecraft server (not bungee and no proxy) only by the IP and Port of the server?
not without a proxy
if you are on a server behind a proxy and you want to send to an external IP it's possible
you'd need to write a bungee plugin to register a server
whats bunge . rs
?paste ur full pom
Im a little confused, for the function void setInterpolationDuration(int duration) it says "Sets the interpolation duration of this display." but what does this mean? is just the duration the Display will be seen by players or?
How long it will take for the display entity to interpolate from its current transformation to the new one
Ohh like that, but i assume if i have no transformation i do not have to set this function?
correct
Ah thanks for the information!
I just pulled from github and my intelliJ isn't working correctly
none of my spigot shit works and it said there were problems with an SDK but idk what to do, any help would be great
Open project settings and set your SDK
the actual error message would be very helpful
That too
If Iโm creating a player NPC and I want it to react when I click it, should I create an NPC class and check for a custom event inside the class? Does this seem like a good structure?
hmmm org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.2
api-version: "1.20"
Surround with ""
api-version: 1.20
.
"1.20"
its just like that
use "1.20" and not 1.20
oh did they fix that?
Put โ around it in the yml
by eradicating the concept of a float out of existance
there is no error message
basically my intelliJ doesn't recognise any spigot things but it still compiles
could have just enforced people properly writing yaml ๐ญ
I already set the SDKs but the problem remains
if it still compiles, do File -> Invalidate caches
?quoteyaml 
the 1.20 update broke a lot of stuff
from my experience, it broke nothing
getting a ton of java.lang.NullPointerException
lmao
wheras in 1.19 i got none
I've had no issues either
and i havent change any code
npe = bad error handling on your part
^
agreed
higgs boson
i dont think you can post that
favorited ๐
also is that a whip or a worm ๐ชฑ
a hwhip
An alpaca
alpacas are great
i love when my pom.xml has a stroke and shows an error about a dependency that isnt there
that's smithers
higgs boson
Is there a way to make Armorstand not collid with the grond? I have an armor stand that is moving with the player to create like a block following the player. But now the block is floating 1.5 blocks above ground because im using an armorstand to make the block move smooth. But now the armor stand cant drop lower than the ground.
If tried to use armorStand.setCollidable(false); but that didnt work
guys i created a gui but i want the items that go into it when i close it are saved
and what is the issue?
To me or Lilpatch?
because for each item added it adds a point
just use a BlockDisplay instead
they don't have any collisions
and they don't tick, so less lag
I am using BlockDisplay but im also using an armorstand to cleanly move the blockdisplay around
Or is it possible to move around blockdisplay with #.setVector()?
What do you mean btw with "they dont tick" does that mean it won't sync with minecraft ticks so less actions?
hi
Ahh like that, Yeah im already using those but I want to move the BlockDisplay around very smoothly and thats where i am using armorstands for. Or is using armorstands over complicated and can I set the velocity of BlockDisplay instead? (keep in mind I dont want to use #.teleport() because it will make it look very laggy)
anyone can help me
What's the issue
Do they also have #.setVelocity()?
because for each item added it adds a point
They do, I have no idea if it works though
I see it has teh function, ill just try it now and see if it happens
Sadly the DisplayBlock doesnt move with #.setVelocity(). Do you have any other idea how to move it smoothly?
unless it throws a MethodNotSupportedException I'd even consider this a bug. Should be at least mentioned in the docs
You can move it smoothly via transformations and interpolation
But isnt that only to change the look of the block or can you also use this to move it to the players location?
I just want it to constantly stay on the player, like the player is the block
So it smoothly follows the player and keeps going to the players feet (Trying to change a player into a block)
What do you mean with Stack it on the player?
Right now im thinking about setting displayblocks Translation to players location
Do you also mean that?
Or is there a way to make it stick on the player like #.addPassenger()?
And i see that translation requires some advanced math, do you know how to just put it at the feet?
Wait a vector? I see someone do this transformation.getLeftRotation() .set(new AxisAngle4f(angle, (float) axis.getX(), (float) axis.getY(), (float) axis.getZ()));
This is Spigot so it will be a Bukkit Vector
Rotation is not translation
hey, im trying to send a messagfe to the player that allows them to click on it and be refferred to a link. I know this is doable in vanilla, so i assumed there would be a way of doing it with a plugin, and ive been trying around quite a bit with the Components api, and also tried to find some articles about it but for example https://www.spigotmc.org/wiki/the-chat-component-api/ provides me with deprecated classes or just code that isnt functional anymore because some classes have become abstract
Wait could you help me out with a small code example on changing its Translation()? i already got the transformation with entity.gettranslation() but now im not sure what to do to change it?
I know, im sorry for asking raw code instead of figuring out but im a little lost with this one
Transformation transform = entity.getTransformation()
transform.setTranslation(new Vector(0, -2, 0))
entity.setTransformation(transform)
Somethin like that
Yea there is no settranslation
its probably mutable
I can do transform.getTranslation().set()
Let me try that
It requires a Vector3fc
transformation.getTranslation().set(new Vector3f(0, -2, 0));```
I tried this but doesn't move it down sadly
probably due to quaterions. Its easier to use joml vec3f than bukkits Vector
Oh wait
forgot something
forgot to set it
Ah yes, this works perfectly! Thank you so much guys
Now i dont need to keep running an Task that will keep it moving every tick and everthing
@smoky anchor With your help and @eternal oxide and @young knoll , I manage to make a block move very smoothly beneat the player and makes it looks like the player is changed into a block. Thank you so much guys!
Is there any other note block lib other than noteblockapi? I guess not?
What's wrong with NoteBlockAPI?
Nothing, just asking
doesn't it work just like you want if you simply send them the link in the chat
i managed to get it working, but that wouldnt work because i want a message which refers to a url and not a url in the chat
how can i make an event. If a row was added to the mysql table, then execute the method.
no simple way, best to poll the db
I think it will load the server, if done through the scheduler and constantly check
are you a surgeon
i know a surgeon
I am a code surgeon
nerd comedy
i am a surgeon, dr. epicebic
:baclofen:
what is milf hunter
I did not quite understand. Ie it turns out that when my plugin creates plaseholders using the placeholder api, then it is automatically sent to the wiki?
?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!
no, you have to pr it to them
ehh?
basically, i created a plugin and i called the commands in the file and i also called it in the plugin.yml file, but when i try it in game it doesnt work
so im confused as to why the commands dont work
show the code
you have to add the placeholders
but itโs not clear to me if everything goes to the wiki why the plugin itself is needed in the assembly
it doesnt go to the wiki
alright do i send the plugin.yml file too
the wiki has 0 idea your plugin even exists
main class, command class and plugin.yml
and any errors
i'm studying placeholder api and i don't understand how contact with another is created from my plugin
im doing it all in the main class
i didnt make multiple classes
lol
also no errors
what
ok
i cant send any message it just says error try again later and a file pops up
?paste it
you dont tell the plugint o do commands
call getCommand("name").setExecutor(this)
Hi,
I'm trying to modify a display block entity. but I don't know how to do it have you some example ?
Modify what and when
so
i do getCommand("commandname").setExecutor(this) ?
if your command is called commandname yes
can you give me an example im following a youtube tutorial
it doesnt show this
its 10 years old
Shouldn't have changed
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ok but i still need an example
literally that code
getCommand("test").setExecutor(this)
setting the executor to "this" is pointless
it's by default set to the plugin's instance
hey if my placeholder not load in wiki so for what need this page? https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders
I'm trying to modify a display block entity to display a half of a block I spawn it with that : spawnEntity(pointer, EntityType.BLOCK_DISPLAY);
but it just spawn the entity and I don't know how to set the block to be displayed
they dont auto add to the wiki
nothing is automatically added there, you have to add it
Use the spawn method that takes a consumer and modify the entity in it
Does that mean he has to be there?
read
can you share me an example ?๐
@remote swallow like this?
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
getCommand("timer").setExecutor(this);
getCommand("ItemTimer").setExecutor(this);
getCommand("createhole").setExecutor(this);
}
sure, but you should handle each command in a seperate class
How do you check if player went in a 2D location or is in it? (Location pos1, Location pos2) on PlayerMoveEvent - I guess that's the only way to check quickly - figured it out
world.spawn(loc, BlockDisplay.class, (blockDisplay) -> { // do stuff });
declaration: package: org.bukkit, interface: RegionAccessor
ok ill check the documentation later
so this will make my commands run right
lets test it
i'd use a boundingbox
oh 2d location? well just some tiny math
@remote swallow im getting an error
[19:33:28 ERROR]: Error occurred while enabling VoidTimerPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.thehole.voidtimerplugin.VoidTimerPlugin.getCommand(String)" is null
at org.thehole.voidtimerplugin.VoidTimerPlugin.onEnable(VoidTimerPlugin.java:35) ~[VoidTimerPlugin.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-68]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-68]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
you didnt register your command in plugin.yml
the commands arent in pluign.yml
I did it the good old fashioned way comparing the x and y variables, but tell me how you'd do it
why it gives me sql exeption? if i load it on another server db is connecting correctly
name: VoidTimerPlugin
version: '${project.version}'
main: org.thehole.voidtimerplugin.VoidTimerPlugin
api-version: '1.20'
commands:
timer:
description: abc123
usage: /timer {seconds}
ItemTimer:
description: nbc123
usage: /itemtimer [material] [seconds]
createhole:
description: abc123
usage: /createhole
i did
yeah basically the same, but I'd create a class for that, e.g.
public class Region2D {
int minX, maxX, minZ, maxZ;
public boolean isInside(int x, int z) { ... }
}
Ah... That's what im writing right now lol
and then you can keep an instance of your region, and later just do ```java
if(myRegion.isInside(0,100)) { ...
yea
but i did ignorecase
thanks!
the api doesnt care
that makes no sense