#help-development
1 messages · Page 1144 of 1
ok..
if you aren't satisified with their support you can charge back
how
go through paypal
I'm not going to walk you through how to use paypal they have plenty articles on how to dispute purchases
ok
not bad but I would have better variable names
is there a way to set player speed without changing client-side fov?
Perhaps an attribute if I had to guess
its what im using
not too sure if that changes fov
maybe possible with shaders
Yeah tbf I don't think that's a very easy fix
if i give player velocity potion effect but i modify the packet so it doesn't send that, client is gonna move at normal speed right?
I feel like that'd end up in a kick of the player
well maybe not if the speed is valid on server side
Idk try that, sounds like it could work
okay thanks
...is that not what https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#setWalkSpeed(float) does?
declaration: package: org.bukkit.entity, interface: Player
doesn't that change player fox?
well did you try it
ok
I assumed he did kek
yeah me too cus you said the attribute and isnt that what this method changes
Idk the internals but I would imagine so yeah
it should be the same in paper, but im pretty sure thats what i was using and it worked fine
I can't find the damn packet
there's a change of fov and then it instantly goes to normal fov, is that fixable or smth?
maybe theres a very hacky workaround but it probably isnt worth messing with
damn ok
actually i doubt it
it doesnt have to be perfect tho, i also have a habit of trying to fix the smallest things instead of focusing on the larger task at hand
okay
afaik it uses the attribute
doubt, shaders allow you to calculate the FOV but not the delta, and you can't set them. There might be some hacky way to have hardcoded FOV with some renderer but definitely not easy
You can just tell your players to disable FOV effects ig
Just multiply the vector maby
thats not how that works
?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!
I need a plugin dev but can’t type in spigot
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Doesn't meet the requirements
Contact a developer offering services instead
How can i save players cash data? In yml file ?
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
Cache not cash
It could be cash 🙂
Does anyone know how to make a velocity command?
Alrighty, thanks. Working on trying to create a plugin for my proxy.
whats the best way to go about only letting a player break player placed blocks
keep a list of player placed blocks tied to each world?
and check every block break
or is there like metadata I could add or something
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
but it might be worth it to just use the chunk data directly
as you basically just store a boolean for the block
unfortunately and I hate to say it I'm running 1.8.8
yikes
we all hate to hear it
idk anything about 1.8
there is probably nbt stuff you can do
what do you mean by use the chunk data?
chunk has pdc in 1.14
i see
is there a method to get server mspt?
double mspt = average(MinecraftServer.getServer().h) * 1.0E-6D;
private double average(long[] longs) {
long i = 0L;
for (long l : longs) {
i += l;
}
return i / (double) longs.length;
}
This is going to work only if you have access to nms
MinecraftServer.getServer() is a thing?
not sure about newer versions, but it works in 1.8
1.8 💀
?1.8
Too old! (Click the link to get the exact time)
older than me
Discord: 🗿
im joking discord
thank you
no way mspt sits at 2.5
that can't be right
at this point y'all need to explicitly state in every question that you're on a decade old version for some reason
it always goes like
question
answer
"actually I'm on 1.8"
the funny thing is that this version is so old even the API is not fully backwards compatible
all in the name of pvp (it can be recreated with one method to change attack cooldown)
anyway as long as this is below 50 then it's fine?
then client has to log in with 1.8
and you can't use new features because you will anyway have players with 1.8 version
that's... the point I'm making
surely spigot plus minecraft run at higher than 1 mspt
exactly, my project base version is on 1.8 and I had to mess with maven modules to make it work on 1.21+ so don't ever use 1.8 again ❌
20 ticks per second gives each tick 50 ms, it should hopefully always be below it
It being at 1 mspt is good
I mean like money
1.8 still the goat
1.8 sucks
this is going well
so uh
is there a way to manually unload a chunk
I think this might be keeping chunks alive somehow
true, isnt there like a way to check some clientside options?
oh wait this is way more cursed than I thought, supposedly this was before it even loaded those chunks
how did that happen
what the heck are you doing
does spigot have a way to view the configuration of a crafter
i'm getting into this problem
:[27,31] cannot find symbol
[ERROR] symbol: class GuildMessageChannel
[ERROR] location: class [name]
while trying to install the dv8tion
is there a soloution ?
private void registerRecipes() {
Map<Integer, ItemStack> ingredients = new HashMap<>();
ingredients.put(10, new ItemStack(Material.IRON_INGOT, 2)); // 2 Iron Ingots
ingredients.put(11, new ItemStack(Material.IRON_NUGGET, 1)); // 1 Iron Nugget
ingredients.put(12, CustomItemManager.getCustomItem("super_gold_nugget")); // Super Gold Nuggets
ItemStack result = CustomItemManager.getCustomItem("iron_gold_sword"); // Get the custom item with NBT
CustomRecipe recipe = new CustomRecipe(ingredients, result);
recipes.put("iron_gold_sword", recipe); // Use a unique key for the recipe
}
im currenlly coding a custom ui for crafting and 'super_gold_nugget' is a var declaed inanother class to be a gold nugget with special lore/nbt so how do i get it to check for multiple of these items in the crafting recipe
yeah you can, I once wrote code to properly unload chunks, worlds keep a few hundred chunks in memory once unloaded
The client settings packet exists but doesn't include FOV or GUI scale
You can force FOV with core shaders
You cannot however detect what FOV people are using on the server
^^
and calculate it
Anyone have an idea on this?
I'm not sure I understand the question
So basicly
You can see in the other ingredients it checks for an amount
How do I do that for the last one
Make a copy and set the amount?
?
I don’t understand what you mean by make a copy
Retrieve the itemstack you get from your custom function and put it in a variable. Then just put it multiple times in the map itself
as for copying, you can make an itemstack from another with new ItemStack(theItemToCopy)
Not sure what putting it multiple times in the map comes from
but other than that it checks out
they want to use it multiple times in the same recipe
Nothing would prevent them from doing so in the code above?
oh wait i completely misunderstood the question
I mean you could be right
The question is a bit vague on what the actual problem is
I think they want to make a recipe with multiple different custom items
Nono
Let me tey explain
then i'm confused xD
Re explain
Unrelated
i'm trying to run buildtools to get the 1.21.1 jar and i get an error
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project spigot-api: Fatal error compiling: error: release version 17 not supported -> [Help 1]
Even though i'm running java 21
building 1.20.1 works just fine however
You need to use a JDK to build Spigot
You're currently using the JRE
ok so the code is supposed to create a recipe in a custom ui for an item, it uses up 2 regula iron ingots, 1 regular iron nugget and then 3 custom gold nuggets, how do i make it so the code can have the right amount of the nuggets
Assuming you're on Ubuntu it should be:
apt install openjdk-21-jdk
(or another vendor if you prefer ofc)
openjdk is fine
but that's quite odd given i've been making plugins for a while and having no issues
guess i got confused with opênjdk being named well... openjdk
What about the code makes it not possible to have the right amount of nuggets
But fair enough
Yeah it is a bit confusing
They really should specify clearly if it's just the jre
but generally you can just check if the javac command exists or not
this gives off an error
Make the new item stack and set the amount after
missing a closed parenthesis
like?
item = smth
item.setAmount
^
I guess eclipse brings his own jdk.....
Zypper... damn you running SUSE?
yup
Never seen anybody run it lmao
i run solely because of btrfs
otherwise i can run KDE plasma on any distro, just need to look up a command every once in a while
Just picked the first i knew used it ¯_(ツ)_/¯
and so far, it runs, so i'm happy as it is x)
Fedora also uses BRTFS, in fact that is what I'm running on right now.
I'm a simple man of simple needs
Would just lose 3.5 years of arch btw'ing
xDDD
fair
Okay tbf a lot of my dots is on my GH so I wouldn't lose thaaaat much
Correct. Additionally eclipse uses the eclipse compiler which doesn't require a JDK to begin with
my dwm and st builds are prob modt important
that might explain the random error upon compiling which is well... random
and just deleting the target folder magically fixes it
Well these errors you are only likely to see if you have complicated or f-ed up generics
However Eclipse will have no bearing on running Buildtools
you are running BT under java 17 as your error states
nono, in this case i want to have access to the old mob-specific shaders you get in spectator
you can cause the cient to trigger it with faking a mob and spectating it with packets
and that's the caveat
packets
Well, BT is running on whatever version - that is not of relevance. The question is what version maven is using - which corresponds to %JAVA_HOME%
Use export instead
i tried this and now it takes any amount of the super gold nuggets\
export | grep java or somethin
That is... odd
you forgot to copy the itemstack
That can cause issues
?
Copy the itemstack with the ItemStack(ItemStack) constructor
also show us how you're removing items
(if it doesn't help)
I guess it's one of those J21 releases that don't support J17?
Or you are using a JRE where a JDK would be required, but idk the naming conventions of suse (under fedora you'd want the -devel suffix instead).
This is my question to understand something. Couldn't it do .clone()?
i had a jre x)
That works too
idk why distros don't distribute JDKs by default.
ItemStack implements cloneable??
yes
Class ItemStack
java.lang.Object
org.bukkit.inventory.ItemStackAll Implemented Interfaces:
Cloneable, ConfigurationSerializable, Translatable
what is suse?
I guess it's there for … whatever reason
what do i put in the constroctor tho
A Linux distro
just saw it thanks
so the CustomItemManager.getCustomItem("super_gold_nugget" ?
yes
so this?
ItemStack (ItemStack CustomItemManager.getCustomItem("super_gold_nugget");
or am i missing smth
That or the clone method
@blazing ocean reminds me of your code
this line gives an erorr
what did I do
Just make it valid Java code first
Not clone your ItemStacks
Method call expected
and its missing a closing parenthesis
yeah
so i put item before it?
yes
Because it's "only" for developers. Same thing why there is imagemagick and imagemagick-devel I assume. The latter includes the C header files.
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
ouch, not even an assignment operator
Looking for a plugin dev anyone able to help?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
That's so silly
imagemagick is so good!
how do I write a string
string
thanks bby
s t r i n g
You can instanciate a string from its bytes!
new String(new byte[]{0x00})
StandardCharsets.UTF_8
dammit
jk
guys I want to write a string but I want to store it as a long
ooooh, you meant Unsafe#allocateInstance?
Now I'm blind 😭
Unsafe 🔫
relocating a class's bytecode with ASM
Unsafe#setMemory got you covered here
ayyy
I mean, that is kinda my purpose
I mean, i suppose it is to be expected from the user with a literal IDE PFP
dual boot incoming
nope, just Suse
whar??
i will stay away from windows and mac for as long as i can (except for studies because program compat)
I want to keep playing sometimes
SUSE isn't exactly the best desktop distro
I use arch btw
I play on linux anyways
I have a mac, a windows and several linux VMs
Install gentoo
same
arch I already used it with i3
i3 is ew
Nah I'm good
no clue what that is
I tried to actually, in a VM
Tiling Window manager
I like GNOME unironically heh
i3 isn't that great I admit
; -;)
based af
But then I also only used i3 for only a few hours
meanwhile...
Do i need to manually put it in my m2 folder or smth?
dwm is not similar to i3?
it's a dynamic window manager
whatever that means
i take it i need both then
if you depend on spigot you grt the API too
You have several layouts, e.g. tile, float, monocle, stack
yeah i do, i just want acess to all the packet classes, which apparently no longer requires net.minecraft.thebaneofmyexistencthatchangeseveryversion thanks to the mojang mappings
real
what does 'dynamic' means on that?
@quaint mantle
dynamic here iirc means "ass"
ohh sorry
no you
No, it means "look at me, I'm so pretty! Huehuehuehue"
Tf is dat
idk
archinstall
I'll take it i need to manually put it in the maven folder
Well, it's for writing memory outside the heap - probably quite useless for the most of us
i mean this is my rice
no you need to run build tools with the --remapped flag
thats so cool
yeah i just did
then it should be in your local maven repo
Meanwhile, my "rice"
prettier than rads setup
d e f a u l t
how....
Do you always pinpoint the exact issue on the spot
not in my heart
your heart is dead 
not in your heart
jspecify hater
dumb ass triage
trueeee
jspecify? Isn't that the new null annotation lib?
And I was even on my phone 
😭
how do i get that
maybe a debian?
its just gnome xD
^^ That's just Gnome
unriced mind you, you can still rice GNOME to some stupid degree, but that is not my cup of tea
ah i see, looks cool tho
You know that feeling when you have a friend who knows a lot of theory and practice at midle level, but for some reason writes code worse than junior and is always in a hurry to write code?
idk how fix it
i tired refactor his code
😭
You guys have friends?
How to remove the cooldown of picking up experience orbs
Dont
-_-
-
_ _
Handle all orb pickup logic yourself
epic
_ _
_ _
yooo??
what the hell
that didnt work
um i am trying to creatae a plugin using maven
but
nvm idk how or why but it worked
scoreboard teams
how do you do it...and.. will it work when they have luckperms plugin? can it destroy it?
theres only one way to find out
probably not
hm I think I might've just had a big brain idea
so my world gen is really slow to paste the blocks
so how about I just don't
and queue them
so that they only paste the first time a chunk loads
functionally instant pasting
slower chunk loading but
eh
who cares
You set the name tag visibility option
:[16,26] package com.mojang.authlib does not exist
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myplugin</groupId>
<artifactId>MyFirstPlugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>MyFirstPlugin</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
</project>
why does it say com.mojang.authlib not exits or something
doen't spigot add it bydefult
no
and you don't need it either
you can use the perfectly functional profile api
i am trying to spawn armor tand with custom playe'rs head texture
good
Ooh
then SkullMeta.setProfile or something
and uhh you can do PlayerProfile.setTextures or whatever
i don't undersstaand PlayerProfile.setTextures part
i mean
nvm i think i got it let mt try
private ItemStack getCustomTextureHead(String texture) {
ItemStack skull = new ItemStack(Material.PLAYER_HEAD, 1);
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
UUID uuid = UUID.randomUUID().toString();
Bukkit.createPlayerProfile(uuid).setTextures(texture);
skull.setItemMeta(skullMeta);
return skull;
}
i got da proile but.... how can i set its texture to head or get profile's head?
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
err i am using oldder version
The API you're trying to use doesn't exist on older versions than 1.18
.1
so the method you sent does not exists in older version or the method Emily said does not exists?
If you're using legacy versions you don't get the newest features you'll have to use GameProfile. Because you aren't on latest you're very much on your own
If you update to latest you'll get lots of new api that's extremely beneficial
couln't find
hey there, is there a api for spigotmc.org resources to query different plugins programmatically?
needing that for a update function! 😄
that link was for @spring nacelle
my bad
aslong as you have the id of it
oh cool! tysm
um it ssaid resource not ound
add that link as a repo to your pom
ok
i did it, it works, but i sent someone this plugin and he says that it doesnt work, is it possible that some other plugin changed it?
if they have another plugin that uses scoreboards/teams it will break yours
is it possible to make it so it unbreakable (xd)
Let's say that I want to, for example, build packet events as a .jar, but with all of its packages having a prefix to avoid conflicts
I'm talking about creating a jar of the library here (and not creating a plugin of my own with prefixed the packages of the library)
is this possible?
i mean to make it so it works still
How would this be possible with Gradle?
I imported an old project from a VCS.
When attempting to navigate the code, it states there's no declaration to go to although it exists. How can I fix this?
let it index
prob try to build or just gradle refresh
Worst case scenario it's some wonky dependency you're missing
It appears the gradle integration was never added to the vcs. How do I add gradle to a previous existing project?
My previous PC broke so I have to rely on what I uploaded to the vcs
How would I implement a social media verification system, would springboot socials be a viable option, and would it be possible to code a plugin without using a website. Anyone know of any API's or free websites, or is it impossible
to start with what do you mean with a social media verification system
what does it do and how should it work
Probably something like using google or some other provider
then yeah you could host some form of api in ur plugin weather thats with spring or something id say is easier like javalin
when does the jish social media get created
dislike disagree
in the modern sense its nowhere near comparable to other social medias imho
Social media are interactive technologies that facilitate the creation, sharing and aggregation of content (such as ideas, interests, and other forms of expression) amongst virtual communities and networks.
Get definitioned
Discord 100% counts
I mean per that definition pretty much everything done digitally is a social media 🤷♂️. Kinda broad but whatevs
like you can end up with funny idea of academic databases technically being social media
Did you guys know you could do this?
List<int> test = new ArrayList<int>();
change int for Integer
I'm not getting an error for that line of code
then?
I just found it interesting
Pointless generic def on the initializing
you definitely can't do that
I haven't tried compiling yet but my IDE is not screaming at me
that's because the IDE just does static analysis, compiling it won't work
in a not-so-far future when project valhalla is done, it may be possible, but right now it isn't
Aw
it doesn't work you're right
Surprised the IDE does not catch that though
you can't
Bit late to the party
a certain other IDE does catch that
You mean - ECLIPSE?
i don't even know what they're using, but any mediocre ide does lmao
inb4 vscode
ik this might be a lil stupid but whatever I have a plugin with the lore of the item in the yaml but I want it to have line breaks
here Is the yaml file as of rn and what i wanna do with it
itemLore: "Line 1 , Line 2 , Line 3"
over here im just trying to have multiple lines so it shows up that way in the item lore
how would I do this in the yaml
use a list
lore:
- 'abc'
- 'def'
- 'xyz'
OR
lore: ['abc', 'def', xyz']
you can just split the string if you want it to be a single line, or use a list like shown above
Well, I'd wager a bet that they are using an IDE from the future where primitives in generics is fully supported … well, jk - I don't.
alr thanks
array-style lists in yaml 🤮
JSON-style elements in yaml make a lot of sense for single-element stuff
I'm using Intellij
intellij most certainly warns you
they probably need to invalidate caches
sometimes intellij just forgets its supposed to do anything and just acts as a downgrade from notepad
hey, don't you dare talk bad about notepad...
does anyone know whats the best way to optimize scoreboard creation?
How can I check if a Goal has been completed? do I need to calculate speed / distance and double verify if it has done the 'moveTo' ? unsure how to handle it best?
hey guys im really at a loss for how to implement saving and loading itemstacks from a sqlite database using bukkitobjectinput/outputstream
i know how to use databases, but i cant seem to find info about input and output streams and putting those into and out of a database
how are you attempting to do it right now?
it's as simple as serializing it to a string
wait really?
honestly i havent started i have no idea how to work with bytes or input/output streams
ive only ever done like primitives into a db
and out
💀
I mean if you're gonna put it in a database you should use a blob
no need to b64 it
thats what i was tryna do but idk how 💀 im a bit dumb :ropfl:
🤣
im not gonna lie i have no clue what that is sorry XD
whats the process like for converting an itemstack to bytes, st oring in db, and converting back? i th ink im just a bit unclear on the steps honestly haha
if you look at the gist i sent it does exactly that
bet will do
if you want just the bytes ignore the Base64Coder stuff
interesting i think i might be able to pull something together
ill let u guys know how it goes
btw who coded that? was that u? its epic lol
I did ages ago, but I'm 99% sure i just copied it off some old forum post
it's just basic bukkit stream stuff
i need to learn more about streams and bytes and stuff. idk where to look though to find the core theory behind it
Hey guys, how are you?
I'm starting in the programming field for a few months now and would like to find clients on Discord. Could someone help me?
Where could I be finding people to work with?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
if you have only been coding for a few months, you SHOULD NOT be working for someone especially charging them
work on your own projects and learn, because it takes minimum a year or two before you should start making production code
Get a portfolio or something. release a few free good plugins, get some feedback, update them. You wouldn't hire a plumber who saw a few youtube videos to do your plumbing because he did his own plumbing.
yo @drowsy helm your code was really helpful thanks. do you know any good resources to learn about input streams n stuff? i really want to get a deeper understanding of how it works haha
nws
uuh there was a tutorial thing on it let me find it
can't find it, but if you want to learn how it works look at Java's ObjectOutputStream
the bukkit one is just a wrapper of it, same concept though
thanks!
BukkitObjectOutputStream 💀
xd how would u do it
im open to ideas
does anyone know whats the best way to optimize scoreboard creation?
also @drowsy helm got it working 🔥
thanks again so much
it's the de facto way of serializing an item stack
like any other way is just wrong
is there a way to prevent certain people from getting a death message?
Im currently having an issue where I want plugins to be able to see the death message but not the player's (im replacing the death message). The only way I have found to prevent the message from being sent twice in a row is by either making the death message null, or by turning off the send death messages game rule and turning it back on. However, this doesn't work with plugin compatibility since the plugin I am attempting to be comptaible with checks if the game rule is active and will prevent the message from being sent (plugin im refering to is EssentialsX discord and its been a pain in my butt)
i think it was PlayerDeathEvent#setDeathMessage
Or smth like dat
yeah i just tried gson and it doesnt work. so far bukkitobjectoutputstream is the only way that has worked for me
I dont remember if it was deprecated
wdym plugins see message?
plugins don't listen for death message, js listen for pdeathevent
it is that to change the death message, however, as outlined in the message I don't want to change the message. I want to make it so certain players cant see it, similar to the chat event where you can remove the players from the recipient list
u could loop through players in the server and only send it to certain players
ig that would be possible js with packets, i don't know other way or msth
smth*
thats the way I currently do it, but it will send the message twice since its a custom image and then minecrafts default.
just gamerule disable deathmessages
yes as also outlined in the message the specific plugin I was refering to was EssentialsX Discord which listens to the PlayerDeathEvent and gets the death message from it, hence listening for death messages)
idk what its called but theres a gamerule for that
did that as well, but then the plugin EssentialsX Discord wont register it, also outlined in the message
rip 😦
Yeah, im stuck between a rock and a hard place lmao
Lol
well ig u could do it with packets
but it's to hard to implement so don't do it if it isn't very important
if you just want to intercept a death message it's pretty easy with packet events
but if u have to detect the death messages of other plugins and detect if they match with smth and that
i mean it's easy to intercept it , yea, but if essX discord sends another it's totally other thing
I've never worked with packets but I may look into it. I try to avoid using packets since it messes with compatibility a little and makes everything all complicated, but I might not have any other option
essX discord just scans the message to send to a discord chat, im more worried about multi version compatibility
u have to use nms of each version ur server is compatible with
too hard to be good
yeah, all this is for one user lmao so I might not add but feel like it would be nice for them :/
Edited:
I might just try to send a custom death message if they have a functional API for it on essX
in Spigot, yes
but it is well-known as broken specially for ItemStacks since ItemMeta serialization used to break with version upgrades
whats the way you would do it?
well, in Spigot it isn't merged yet, but once it is I would use the ByteSerializable API which adds the ItemStack#serializeAsBytes method
this way the data can be passed off to DFU when necessary
if you want a human-readable format, then there needs to be a bit more tinkering but it isn't impossible either, it involves using the NMS codec to export it as JSON
oh isnt that a paper method?
indeed
so my databases are gonna break each update using the input/output streams?
it is going to be a method in Spigot soon™️, see:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/1047/overview
to be fair, I am not aware if the version upgrade flaw was eventually fixed or not at some point, but seeing it is still being discouraged by people, I can't comfortably recommend it
that's fair. i'll let you know if i have any issues. hopefully they drop that update soon
for it to be fixed, the format that BOOS outputs needs to have some kind of version identifier and pass it onto DFU and do the necessary upgrades
does anyone know whats the best way to optimize scoreboard creation?
and what's more efficient? send packets of entities (like decorative pets that are armor stands) and particles or actually spawning them?
hey btw on this note, when this does eventually release, does that mean im just gonna have to swap out the lines of code. itll still be a blob in the database right? so it shouldnt be TOO hard to fix. ill just have to manually re-add all the data
wait actually manually re-adding all the data does sound like a LOT to fix
🤣
you'd have to re-assign all the data since they don't share a format but yeah, basically
Does anyone know how I can disable/minimise the Mob damage effect that shows black hearts
you mean the wither effect?
No, I can provide a picture in dms if u would like
I mean, that's the only potion effect that makes black hearts as far I'm aware lol
I have dmed you a picture of it.
this is what they meant for context
what is even that effect, I don't play newer MC versions so I do not recognize it
I found a solution but I'm not smart enough to know what to do, anyone understand this;
"Correct, it is indeed possible with ProtocolLib. All you have to do is listen for https://wiki.vg/Protocol#Particle_2 on a highpriority packetListener and cancel out the packets that contain your particle type."
does anyone know whats the best way to optimize scoreboard creation?
and what's more efficient? send packets of entities (like decorative pets that are armor stands) and particles or actually spawning them?
Make the pets display entities and spawn them
That's a good balance between easy and performance
do you guys ever code something and you get to the point where it's so complicated htat you have no clue whats going on
xD
Everyone has done so at some point
im trying to get better at writing easy to digest comments but its hard sometimes when you dont even understand everything cause its so complicated XD. i feel like i need to go back after the fact and process what ive done and make changes/write comments
A good goal is to structure the code in a way that it doesn't need comments
That's not always possible ofc
Eh, I tend to disagree with this take
it leads to the idea that comments are secondary when they're not, any mildly complex system will have to semantics which methods and classes agree on but cannot be described on the signature alone
I'm not saying you shouldn't use any comments
How do I damage someone ignoring all damage reductions? (Like armor)
doesn't the damage method already do that
No
Proper documentation will always be necessary for larger and complex systems
if not, setHealth
Sethealth ignores absorption hearts. I was making .damage() with custom damage cause as void but I think that would ignore totems.
just make sure to check absorption hearts then?
- $damage()
- in the event binary search the actual damage you need
- profit
SetHealth doesnt have damage causing entity
Its not good
just set the damage source then
besides, damage method doesn't either, does it
nevermind, it does
You can provide damagesource now
Or whatever it was called
It lets you can add location, type and entity
yeah im actually finding commenting before i code what a section will do is helpful
cause itk eeps me on track and stops me a bit from overthinking
and staring at a wall of code without comments is defo really brain-frying for me
🍤
Actually, might damagesource as potion work?
It doesnt get affected by armor right?
Or like
MAGIC
Ig
something like this may work
public static void damage(Damageable damaged, double amount, DamageSource source) {
if (!(damaged instanceof Attributable attr)) return; // shouldn't ever not be the case but free cast so...
var event = new EntityDamageEvent(damaged, DamageCause.CUSTOM, source, amount);
damaged.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) return;
damaged.setLastDamageCause(event);
var maxHealth = attr.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() + damaged.getAbsorptionAmount();
damaged.setHealth(maxHealth - amount);
}
I don't know the ramifications here so use at your own risk lol
Hello, (correct me if I am wrong) but I don't think there is way of knowing if a sound is being played to a player, because there is a delay between player.playSound(...) and when it actually plays to the player there a delay and this delay comes from the client loading the audio ... does PacketPlayOutNamedSoundEffect fires when playing or when starting loading ?
playSound immediately sends that packet
whatever delay occurs afterwards is outside of the servers control
Yes, but i mean does the client sends a packet to say "i am playing" when he is ready to play
Don't use system path dependencies
Use mvn install on the other project
whats that
The maven command to install it to your local maven repo
After you've done that add it as a regular dependency
i go into LaserStaff and execute maven install? And remove that pom thing and only add it to the dependencies via intellij
huh
but uve just told me to delete the thing in the pom
this
<dependency>
<groupId>me.mondlw.laserstaff</groupId>
<artifactId>laserstaff</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${laserstaff.dir}/LaserStaff-1.0.jar</systemPath>
</dependency>
so remove the systempath thing and what to write instead?
Add it as a regular dependency
- install LaserStaff
- remove systemPath and rename scope to what?
- How to add it as a dependency
using the dependency information specified in the laserstaff project pom
scope should probably be provided
this is in the LaserStaff
<groupId>mondlw</groupId>
<artifactId>LaserStaff</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
this right?
<dependency>
<groupId>mondlw</groupId>
<artifactId>LaserStaff</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
It doesn't make me happy to say it but it seems not possible, because the client isn't sending such packets and the only packet sent by the server is PacketPlayOutCustomSoundEffect once the sound is played with playSound ( ...) 😦
and again, deleted a whole bunch of random stuff that doesnt make sense to me, with the same error still there
Send the new error
probably because its not important if a sound plays or not to the server
same old one
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources (default-resources) on project laserservermanager-1-21: filtering H:\Lukas\MC\Altstadt\LaserServerManager-1.21\src\main\resources\LaserStaff-1.0.jar to H:\Lukas\MC\Altstadt\LaserServerManager-1.21\target\classes\LaserStaff-1.0.jar failed with MalformedInputException: Input length = 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException```
Do you have the LaserStaff jar in your resources folder??
ye
That would be why
delete?
is Material[][][] for storing a 3d array of objects cooked?
guys how can I upload a image on here?
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
I tried to retrieve B location from A
A Location is literally random. (it could be -, + [So This is the hard point])
how can I get B location ?
thank you
With that little information, you don't
hmm then is there another way?
probably would help if you explain what it is you're trying to do
Yes, explaik what this is about. B could be anywhere in the universe
Actually, Im trying to create a guild plugin,
So A is main guild building and the B is kinda farm area
So there's could be existed the distance so I tried to retrieve B by its distance but as you know, the A location could be - or + so Yeah I'm confusing
There's no possible way to get a precise location using just a distance from another location
It could be anywhere within that outer radius
what if A locations are assigned? then it could be getting B location by its distance?
You need a vector to get a second location not just distance
oh, both must be assigned hmm got it thank you guys
I still have no clue what's going on but as long as you fix it good enough
Dont need Location to do it? just need A vector?
Location and vector
oh
you need 1 location and a Vector
A location is a point in space, a vector is a direction
The Vector tells how far and in what direction
ahh
A vector is essentially a direction plus a distance.
Its like saying "the farm area is 150 blocks northeast of the guild building"
Oh yeah and magnitude
oh I completely understood
(technically speaking, locations are also vectors but with an added world, yaw, and pitch)
ahh then the Location is expansion of Vector right?
yup
ahh
its just 3 numbers, xyz
so a vector from guild to farm would be composed of how much you need to change each number by to arrive at the farm
so if guild is at 100 50 100
and farm at 120 50 200
your vector from guild to farm would be
120 - 100 => 20
50 - 50 => 0
200 - 100 => 100
so 20 0 100
so get location by its distance is just nonsense
yeah exactly
if im east of you 100 blocks or west, you'd have no way tell
depends what "distance" represents
basically you're trying to get from your house to the store with the knowledge that the store is 1km away
Between A And B
it doesn't work, right
but if i tell you, move 20 blocks towards x, 0 towards y, and 100 towards z, you have no way to get it wrong
If distance in yoru case is a double, it can;t be done. If distance is a Vector it can
yeah 'cause just with distance doesn't know where it is exactly
thanks guys now I think I know how to make it as possible
^^
Well, if you visit every location around your house that is exactly 1km away then you will eventually find it
Yeah in theory that works but just like it would take you ages of walking around looking for it, it'd take forever to loop through all of those possible locations
And it's only even possible at all assuming there's a way to check the location is indeed the correct one
I have a problem with my SkinChanger plugin. If i try to set the skin, other players can see it, the player itself cannot: This is the code: ```java
package dev.itzyami.manager;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import net.minecraft.server.v1_8_R3.*;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.UUID;
public class SkinManager {
public static void changeSkin(Player player) {
GameProfile profile = ((CraftPlayer) player).getHandle().getProfile();
PlayerConnection connection = ((CraftPlayer) player).getHandle().playerConnection;
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer)player).getHandle()));
profile.getProperties().removeAll("textures");
profile.getProperties().put("textures", getSkin());
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, ((CraftPlayer)player).getHandle()));
}
private static Property getSkin() {
return new Property("textures", "ewogICJ0aW1lc3RhbXAiIDogMTcyNzc3Nzk4ODY5NywKICAicHJvZmlsZUlkIiA6ICI5N2VmNDYyMzdhNGY0ZTQxYWY2ZTljYjg2MTdmNzc2OSIsCiAgInByb2ZpbGVOYW1lIiA6ICJZdWthcmlLYXplIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2Q4YjJmYzVlOGQxZTkyZTFhMDE5NGJmY2QwMmY1OGJlYWUxOTM3YWViZDRjODQ2NjgxMTIyNDJmNmI2ODc4OGUiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==", "CZ3ryW08UMYvUsmW1spFEdoF+1+5hEmTeAHok+ZvshaL7s8GLPaI7yJayh/rDcG8s2dZh2QdwOsXVOfb50RTRWJVlFlDwYGbappm1EpaGEoLBOv2qZI+BGG0XZ3P74IevgTsNg+gTRmHXglprv/UMMne7xFK3h6s8TbzOACoe6HCTPmkzoOz8i1bR7u83Kk8Gy+OU47QAPgTFQBbh+6IIiO7b9e/wkj3ZhiPTeJKmASAIe2/8dCA8+ciF8Y4920D2USPBM2qh7WTeaY79znigpvBIb/i1qfK5fZDg3gVYPSC2o0VvDIZqtlNwXEcwfMbz97MALMUD44W9jGpz/pPicc3iiG3Yor7iIqKFLttCsjWCy+mCkEIeUzcOmtQZsKH9xWGteGXnhWJqkqNLoD7OwKCVQBeaMQSGyG+CTetQTrD980vlTcapfm5ai+fURCEiFEiv25H/qtAPvaGwqDKDGQLTsvN7aB/vc6OMXJGL7idm/BVhzSd4qjJGmh4y67Kd9CBGQ13Jg7ubhTRcOxhNgpdw88pbepZOdapYLo3zyyQLpQeASXWQUIBFkvVBeB+BWUbZrjlNHM/yemq053O5yJZjYgzEhMLO8CzlZk0cDdnaz3cYaZWpvBfO/SkL8VNwcQBoAzpHkt4rbFUYiS6H9r+PWdHqjworCOZ4201ljs=");
}```
getSkin() is for testing purposes
[17:14:51 ERROR]: Error occurred while enabling MyFirstPlugin 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 "com.myplugin.MyFirstPlugin.getCommand(String)" is null
at com.myplugin.MyFirstPlugin.onEnable(MyFirstPlugin.java:13) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.15.2.jar:git-Paper-393]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.15.2.jar:git-Paper-393]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.15.2.jar:git-Paper-393]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:472) ~[patched_1.15.2.jar:git-Paper-393]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:386) ~[patched_1.15.2.jar:git-Paper-393]
at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:488) ~[patched_1.15.2.jar:git-Paper-393]
at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.15.2.jar:git-Paper-393]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:909) ~[patched_1.15.2.jar:git-Paper-393]
at java.lang.Thread.run(Thread.java:840) [?:?]
command is missing from your plugin.yml
VsCode to programm plugins is crazy
i dont like doin easy stsuff
Some stuff isn't about easy, some stuff is about not suffering
why you not using neovim
wrong
Nvim is actually quite handy
how are you liking my config btw
Very nice
:D
Can someone help me out?
can't put variable in switch ?
you can only switch on constants
bruuh
my constant is like : "§5§lTelekinesis §7• §8Automatically place items directly into your inventory" this
and i have lot of other constants like that
dont compare with a name
@Override
public void handleThrow(UUID playerId, ThrowTechnique technique, Disc disc) {
Player player = Bukkit.getPlayer(playerId);
if (player == null) {
return;
}
Location throwLoc = player.getLocation();
Vector direction = player.getEyeLocation().getDirection().normalize();
int discSpeed = disc.getSpeed();
DiscType discType = disc.getType();
switch (discType) {
case DRIVER -> {
switch (technique) {
case BACKHAND -> {}
case FOREHAND -> {}
case ROLLER -> {}
case FLEX -> {}
// More techniques...
}
}
case MID_RANGE -> {}
case PUTTER -> {}
}
I feel like this is just stupid, the nesting of switches, I am not sure what else I could do for determination of the throw technique... in this style I'd have to write out the algos for flight paths in each case of the technique switch which means I'd have to do the same for mid and putters. Perhaps delegating this operation(s) to a handleThrowBasedOnTechnique method? I'm not so sure any ideas are welcome... There are only ever 3 disc types so I really am not even sure if the disc type switch is necessary
thats not a constant, but thats an item name
and those should not be used for comparing if an item is equal
no item name, it's a lore
i need it for add custom enchant you know
i don't know that
?pdc
Pdc is pretty easy
i'm not english haha i don't know what is this exactly
A guide
i don't understand all english x)
why not have the methods on the enum?
this is fine
i can use custom tag for custom enchant for resume ?
to summarize* sorry
Too many disc params to do this imo, each disc has four ints, speed, glide, turn, and fade I also hate working with enums kek but maybe that's better I'll play around
Should be known that each number has a different effect on the way the disc flies
hummm i didn't know that tyy
your Disc should have a function to get thrown
then you can atleast get rid of this switch here
and then in each disc type you would handle your throw differently
actually yeah I like htat
and maybe have utility functions on how some techniques are thrown normally that can then be used and modified by the discs throw function
use the fact that everything is an object to its advantage
Yes indeed
Im thinking this might be difficult as later on there are player attributes that will also change the way the throw looks, some context: The technique has an effect on how the disc flies obviously, player attributes would be things like power, accuracy, form/ability to throw a specific technique, etc
I'm also trying to keep the code somewhat reusable
I think the handle throw method in each disc is a good start for this though so I'm gonna go work on that
yeah
and then see where you can write more stabdalone pieces for the techniques and whatever
I am lost
Gradle can be a bit of a pain to use
could you hold my hand through the process?
Are you using Groovy or Kotlin
kotlin
yeah idk then I use Groovy
Bruh
why did it work now? LOL
you siad it wont work because its.. umm minecraft vanilla command or something lke that
Tf
Because it's valid code
Dispatch command should work for any command
it didnt work before
Idk who said it wouldn't work with a minecraft command but they're just wrong
Probably a bug on your end
Or a server bug that was patched
weirddddd
But yeah dispatchCommand can run any command
It's not just bukkit commands that be idiotic design. Bukkit has a lot of that but that's even beyond bukkit xD
?paste ur build.gradle
yikes dont shade packetevent
that too
you can totally shade packetevents
yes its better not to
you can but its not recommended
sure
but like shading it will still work
so idk qhat the actual issue is here
i meant to say ideally dont shade packevents
once they paste their build.gradle we can figure out why its not shading
I'm just doing this for the testing
(but I will shade it, just later on)
I checked some craftbukkit code and there was seemingly no delegating to brigadier
well I am trying to come up with a system that allows for the integration between all pe instances
because all commands are on the command map
put your build.gradle.kts on a paste and we can help you with why it isnt shading
oh I see
paper sex
no-
you take the jar from the wrong task
take it from shadow
interesting destination
Bukkit is such a mess
shadow doesnt modify the output of jar it has its own output
hmm
I guess I see the issue
but I can't set the dest dir in shadow
from(tasks.shadowJar) will fix it
having a separate copy task is the way to go
you are just taking the jar from the wrong task
then like this?
from(tasks.shadowJar)
thats the classifier shadow adds
set archiveClassifier to an empty string in shadowJar config
Tf is an eap
Aren't you supposed to like, agree to it or something
once you open it
PAPER SEX
why is it called paper sex
because it's fucking paper
Good point
SEX!!
can someone explain to me how Material.getMaterial works
cause either minecraft misteriously removed carrots
or im stupid
"Cause: java.lang.IllegalArgumentException: carrot is not a valid material"
or literally ANY other material i tried
Material material = Material.getMaterial(materialId);
oh didnt know i have to
That method is case sensitive
alr
It's mentioned in the javadoc :P
I like the idea that Minecraft just removed carrots more
I had to disambiguade
And already had one without the three-letter suffix
Registry moment
Pretty sure it just redirects to the registry method now
Not sure
Yes pretty sure but not sure
Ahaha imagine If we switched to ItemType
That'd be wild
Hey that has a registry too
is there a specific reason effects applied to the player during the EntityResurrectEvent are just whiped from exsistence
What effects are you adding
?paste
potion effects
strenght, speed
tried multiple
i mean i found a workaround
hm odd
but still weird
Did you delay by a tick?
ah
Going throughan endportal also removes effects iirc
fr?
exit end portal counts as a respawn but idk if they handle that specially
i went through the end portal both ways and i still have my potion in 1.21.1
this is why underscores exist
ummm permissions
ok i dont need
that
but i want
hah
permissions should be values, not keys
but they are keys 😔
but i cant with dot
why not
because then its hierarchy
so?
and then replace it with dots?