#help-development
1 messages Ā· Page 685 of 1
For lower versions just use like spigot 1.17 and it will support anything above 1.17
yeah but
but
How can I avoid a block being scheduled for removal twice
Maybe I could store a hash of all the top positions due for removal
Something like a Map<RelativePosition, Byte> ticksLeft
Should I develop on the minimum version I want it to support?
and if it is just ignore
Exactly
Thanks <3
if the min is 1.17 develop on 1.17
if the min is 1.8 pray to god that you change your mind
And is there a standart for this? Which version do you think a plugin I release should support as a minimum?
someone join #bot-commands pls
I would, but idk cars or geography :D
I usually do up to 3 versions back
Though for the time being I am just sticking with 1.17.1
Minecraft trivia when?
Thanks <3
How can i get a Pair with a enumitemslot in it and check the the itemslot for after modifing the itemstack in the pair? Using protocollib packetlistener
I get a warning like this, is this normal? https://i.imgur.com/FPiOthl.png
Does anyone know how I could fix this issue? I understand that both of the files are compiled on different java versions, but at the same time I don't want to change my project java version from 8
yep, it's normal
You didn't do what I told you to
You need to set api-version to 1.13 in the plugin.yml
Oh, okey. I changed the spigot version.
spigot version should be the lowest you want to support
?whereami
doesn't matter
that's because NMS is obviously compiled for java 17 too
yeah I know
use jdk 17+
can you read?
I can, you cannot read
I never told you to change the project java version
only to use another JDK to compile
JDK 17 is able to use source/target of 8 just fine
damn you got me there
are you using IJ and maven? If so just do File -> project settings -> SDK -> 17
and in pom you can leave target/source at 8
then it should work fine
if you also use the maven-shade-plugin, that must be updated to at least version 3.5.0
nope, I'm using the IntelliJ artifact compiler
I am not sure if that even supports using different source/target and JDK
maven is too slow
and neither am IIII
Hello, I want to add a custom blocks using Spigot when the type of the oak slab is double and waterlogged. How can I make this in my resource pack ?
probably that's not possible, I'd just use maven instead
(gradle btw also cannot do that as paper-userdev requires toolchains in gradle)
so I guess your only option to compile for java 8 while still accessing java 17 classes is to use maven
which you would normally do anyway because otherwise how'd you use mojang maps
I just use reflections
obfuscated mappings can't be properly used, not only because the names are nonsense, but e.g. because method names and their return types are clashing, e.g. if you extend entity classes
you'll get a message about "return type of x() clashes with EntityInsentient x()"
and don't really use the raw mojang api that is not packet-related
reflections? but all the method and field names change in every version
it'll be a() in 1.20.1 and c() in 1.19.4 and e() in 1.19.3 e.g.
yeah I don't really use raw mojang classes
I get it by return type and parameters used
public static Method getMethodByReturnType(Class<?> instance, Class<?> returnType, Class<?>... parameterTypes) {
for (Method method : instance.getMethods()) {
if (method.getReturnType() == returnType && AlixUtils.equalsArrayCheck(parameterTypes, method.getParameterTypes()))
return method;
}
throw new ExceptionInInitializerError(new NoSuchMethodException("No valid method returning: " + returnType + " in " + instance));
}
like this
how does one even create a .jar in IJ without maven or gradle
i dont see any "build artifacts" anywhere
Attributes for entities can only be given using NMS?
yeah well
cuz you gotta create em first
create what first
ah ok. yeah it seems like IJ doesn't support specifying -target or -source for artifact configs
maybe you can manually append it to the build config, idk
yeah I didn't really find any info on that
well, I guess I don
't really need paper that much
as said, maven is the easiest option
maven has more boilerplate
it builds too slow for me, maybe one day I'll find the ideal solution to this problem
gradle once daemon starts builds in sub second
you can also enable additional caching
for config
gradle doesn't support using a different source and target setting than the actual JDK being used when using toolchains
and gradle seems difficult
also that /\
this still doesn't create any .jar for me at all
ok so I found out how to it using IJ's very limited build artifacts system
you need to build first
and then select the target classes
if you're generating jars the way i used to
Run -> Edit COnfigurations -> add -source 8 -target 8 as options, but keep SDK at 17
Build > Builder Artifacts
this produces a .jar with java 8 class files
btw maven is not slower than IJ unless you run "clean" all the time
wait, is this per-class?
no
hmm I very much am doing something wrong here
cuz I still get the same error
of this
project structure must be like this
language level 8, sdk 17
if that doesn't work, just use maven. this would have fixed the issue already half an hour ago š
Alternatively if you dont use paperweight but only the normal api jar gradle should also allow using different source and target levels than the JDK (just dont use toolchains, they force using the -release flag on javac)
Is there a way to find out the amount of armor a player has?
yoo it compiled, thanks man
Np
there is
double armor = p.getAttribute(Attribute.GENERIC_ARMOR).getValue();
at least according to the spigot forum, no idea if this is influenced by armor
nope
pretty sure that this only returns the "base" armor an entity has
Hi question probably not that common but im making a plugin where you can get livestream from twitch and dispalyed in to maps the only issues ffmpeg can use rtmp that on twitch and most provider is closed by stream key, thereās an alternative to this and get live stream via rtmp without keys? (I want to use rtmp because it is the simplest to implement or another way to implement is by making the streamer add is key but that can be a security concern for streamers)
the attribute?
Yeah
does it also work for specific armor attributes?
I compared the code and realized that I used getBaseValue
but just with getValue
it's working
like armor items?
It's working with changing player's armor using attribute
Hello, i'm trying to build my plugin trough a GitHub Workflow with Maven but he show me that error (10 times)
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project etercube: Compilation failure: Compilation failure:
Error: /home/runner/work/EterAuth/EterAuth/src/fr/arcade/eterauth/bungee/DataBase.java:[4,23] cannot find symbol
Error: symbol: class BungeeCord
Error: location: package net.md_5.bungee```
Do you have any idea what the problem is?
where is the class BungeeCord even from? it's not part of Bungeecord api
It's just paper being annoying
you must declare an api-version in plugin.yml
full line
I think my friend messed up the dev :p
?ima
how would that even compile locally?
there is no class called BungeeCord in that package
declaration: package: net.md_5.bungee
only class there is "Util"
yeah, he told me that he build his plugins with spigot and bungeecord.jar from jenkins š
well you gotta add the same dependencies to maven that your friend is using locally
exactly
but having both spigot and bungee in one .jar? what's the purpose
also spigot especially doesnt have a class called bungeecord
is he importing the bungeecord server .jar as dependency? o0
what does he use the BungeeCord class for?
it's an auth plugin, so to change server and things like that
i don't know :p
bungeecord-proxy is not maintened since 2020 in my memories
I'm going to ask him to remake the plugin.
Anyway, thanks for your advice, have a nice day :)
that means you gotta build it yourself and mvn install it
why can I not rename folders in winscp in the directory tree š„²
hmmm
Is there a reliable way to detect that a player killed another player?
cuz like
Player#getKiller could be from way before
and getting the last damage cause also doesn't help as someone could've like pushed them off a cliff
the death message would still contain those players' names as one was the cause of death for the other
oh, wait, is the Player#getKiller set to null if the player dies without receiving any hits?
It will return a killer based on vanilla rules and returns null if the has been no killer
or the last attack was too long ago.
Basically if it's in the kill message, it'll return the player lol
Hello. I want to launch the player from his location to another exact location (so that he always will land there when launched).
I haven't found anything in that direction which works. I want the player to always launch in a nice arch no matter what the destination location is.
I tried subtracting the two location vectors, but then the player will get a velocity in a direct path to the destination location and the launch force doesn't fit.
Does someone know a way to achieve this?
There was a combat tracker within nms
I wonder if it's possible to access its data in bukkit
We have a lot of that stuff being exposed with the damage causes
Just a PR in limbo atm
Yeah but I'd like to access the entire combat entry history
I know a minigame server that had a pvp game with full combat history when you died
Well... yeah... they can track that themselves
Nah it was hyperspecific
I sincerely doubt that
You just don't have to. You can accomplish the same thing with just a handful of lines of code and a damage event listener
How to get the amount of armor an item adds?
uhh
You don't
But if you really care
LEATHER_HELMET: 1
LEATHER_CHESTPLATE: 3
LEATHER_LEGGINGS: 2
LEATHER_BOOTS: 1
CHAINMAIL_HELMET: 1
CHAINMAIL_CHESTPLATE: 5
CHAINMAIL_LEGGINGS: 4
CHAINMAIL_BOOTS: 1
IRON_HELMET: 2
IRON_CHESTPLATE: 6
IRON_LEGGINGS: 5
IRON_BOOTS: 2
GOLDEN_HELMET: 2
GOLDEN_CHESTPLATE: 5
GOLDEN_LEGGINGS: 3
GOLDEN_BOOTS: 1
DIAMOND_HELMET: 3
DIAMOND_CHESTPLATE: 8
DIAMOND_LEGGINGS: 6
DIAMOND_BOOTS: 3
TURTLE_HELMET: 2
doesn't armor have an armor value?
Missing netherrite but idc
Do attributes not contain the default modifiers on items?
They might
In this case I did this for a customer that wanted to tweak armor
Which is why I have a config for this
I would get the attributes of the ItemMeta. You just need to keep armor toughness in mind.
move if you can
renaming is just moving as a different name
makes sense
So I updated to the 1.20 NMS today after some difficulties and I'm seeing that here has changed a lot of Stuff. It now wants DataValue instead of DataItem as it was in the 1.19.2. Is there now a other, better way to do that (I want to change the entity temporarily to something else) or should I try to port it to DataValue?
https://paste.md-5.net/jemutotixu.cs
oh yeah i know
i just did this
it's like... armor debuff?
or nerf
Yeah no I just checked, it doesn't work
the Player#getKiller I mean
it's null whenever the death reason is different from physical kill (like throwing someone off a cliff)
correct
this is intentionally as the killer was (example) fall damage
then how can I get the indirect killer?
Is there a way to find out the amount of a player's armor without considering attributes like only from armor besides checking every armor item?
why not attributes?
you can store the last person to hit the player with entity damage by entity event
so there isn't a built-in method?
you just need to be careful to stop storing the last person to hit them after death though
no
easy enough
oh nevermind
I figured out how to make it easier
Would it be possible to teleport a player into a dif server without making them do the loading world screen?
server or world?
if server i donāt think so due to the nature of proxies
Server ex hub -> mini game
Yeah I was curious if there was a certain packet that caused that screen
i know you can with teleporting world to world, but server may be different, you can check out this resource though and see if anything they do may help you https://www.spigotmc.org/resources/worldchangescreenremover.54297/#
Check what addBalance is returning
Interesting
Does that return true or false
love the code
Haha i didnāt make it! iāve just used it before, serves only as a reference š
And how hard the author goes out of their way to not make a data class
though I think it was coded in net beans, looks like tabs > spaces
Letās keep in mind
Itās last commit was 4 years ago
Maybe they was just learning how to code
let's keep in mind that zombie_striker has had a premium plugin for sale for years and was an active member in the bukkit forums
Never mind!!
MagicPacketHolder
7smile7 getting mad
ahh the public variables
Thats not a data class. This is a blatant attempt to sabotage his own plugin.
Ohh i forgot that thanks
This is a troll i think
it's zombie_striker, previous author of QualityArmory(Vehicles)
old community member
I wouldn't say it's a troll
But this has crackhead energy
I can imagine a drunk zombie_striker downing 5 red bulls after a night at the bar and writing a plugin in an hour
gold
hack level
Good morning, I created a login system, and I would like to know if it is possible to disable the world cache, since it is a temporary world. I looked in the documentation and couldn't find it. For example, useful position, hunger
Uhh
Great question
You can delete the player's file
No clue if World#setAutoSave influences player data or not
But iirc player data is separate
interesting
// spigot
can't wait for the day that entity movement bugs are fixed
Had to actually put effort in a commission today because apparently primed tnt can phase through blocks
thatās a minecraft feature !!
Fr
yeah but
Pull requests welcome
Preferably into Spigot though. Those seem like things Spigot should adjust, not CraftBukkit
I don't think I'm ever signing that CLA
I guess your alternative is to complain eternally, so that's a valid option as well
my alternative is to charge more and impl a shitty fix
how can i spawn a blockdisplay which is white concrete?
Win win
It could be a much cleaner fix if it were in the server directly š
ehh
I have a history of "quick" and dirty fixes
Spawn the display entity, call setBlock() on it with a white concrete BlockData
Like that one time I had over 600 lines of nms to make entities collide with client-sided blocks
and how can i call this method?
Time to learn ASM
I've also used unsafe to inject my own command map because spigot doesn't fire events if I call dispatchCommand directly
Namedly ServerCommandEvent or whatever it was
I was talking with someone here about doing a PR for that
i would spawn a entity like this player.getWorld().spawnEntity(player.getLocation(), EntityType.BLOCK_DISPLAY);
Or just spawn() so you can get the instance type, but yes
yOu can cast the result
Yeah but why cast when you can get a generic type? :)
Ideally EntityType would be a weird class with generics for this one method
It will be soon
Compat-safe
Commodore is getting a big update :^)
but where can i then call the method setBlock()?
I wonder how many lines of code luckperms is running on
With the Entity instance that that method returns
Or you can use the consumer
Did not quite understand
world.spawn(BlockDisplay.class, location, entity -> {
entity.setBlock(Material.WHITE_CONCRETE.createBlockData());
});```
Argument order of that method might be wrong. I always forget location & class
setblock isnt working...
entity.setBlock?
Well what does it tell you
oh nvm
declaration: package: org.bukkit.entity, interface: BlockDisplay
I mean you can call it blockDisplay if you want lol. I just figured entity was shorter
112k
easy goal
To be fair it's also abstracted to shit so it can support other platforms
I'm at 8k right now and all I do is load like 3 values from a database on player join
implementing it on a platform is an easy task tho, platform hooks are minimal
I'll probably reach 12k when I'm done with this command system
I know but you often have to write code that is somewhat similar to what platform APIs already provide
but it isnt working...
its crazy how someone with almost 10 years of experience can code this bad
it just doesnt have this method
Your IDE is broken or something
the better question is, does it actually compile. lol
Right :P
maybe its because i dont use build tools?
does the eject function kicks all players riding on the player
Is it normal to only be able to reference a dependency's methods inside an event handler?
no
how can i do this with player.getWorld().spawnEntity(player.getLocation(), EntityType.BLOCK_DISPLAY); ?
Invalidate cache and restart?
spawnEntity() returns an Entity instance so just assign it to a variable and cast to BlockDisplay
BlockDisplay entity = (BlockDisplay) world.spawnEntity(location, EntityType.BLOCK_DISPLAY);
oh
eh I wouldn't recommend that
you have the arguments swappefd
location comes first, entity class second
I am probably doing something wrong, but the only time I can use methods from the dependency I imported is when there's an annotation like @Override or @EventHandler
and where can i pass in the blockdata?
You are probably trying to run code in a class body
entity.setBlock()
Same as before
You should really take a moment to understand some of the basics of Java
ah true
Methods that return values, instance methods, etc.
These are things you need to seriously have a good grasp of
Am I supposed to run it outside of the class body?
I thought all the code was supposed to go inside
"thought"
Nothing runs in a class body. You just define methods and variables there.
Its just a blueprint of which you create instances later on.
Is it possible to make space gravity (actually lack of gravity) in latest spigot?
that actually works like 0 g
like exactly the same
i've tried combining levitation 255 and slow falling but that way player can still move forward or backward, just not up and down
And can't use elytra which is a major setback
write custom elytra physics
So I need to define a method in the class body to run methods from the dependency?
Or a variable
I'm confused how you think programs work
Something has to call it in order for it to run
? how can u do that? I'm not familiar with latest spigot mechanics. I mostly worked with 1.8.8
You can ignore him. Stupid idea
:/
"I want to visit Paris one day"
"lol just build your own airplane"
Maybe this is a part of Java I have never touched, but I have always put the code inside of the class brackets.
does any1 know what this component from intellij is called by chance?
when adding a passanger to a player, do multiple passangers stack on each other?
im sure he just tried to troll me anyway
Well, yeah. It does. But there's a structure to a class. You can't execute methods just at the top level of a class. You have to do something with it
public class Foo {
runSomeMethod();
}```
This is not valid
nah I've actually worked on custom elytra fizzics
it was crunchy
but worked fine
was just a scheduler
anyone pls
No, you can only have one passenger on a player
And so an eventhandler is an example of doing something with it?
If you want multiple passengers you need to add a passenger to the passenger
are you setting custom velocities with a scheduler while player is gliding or something?
yep
An event handler is a method, yes. Bukkit will invoke that method (through "magic")
Was surprisingly smooth
btw is that a constructor i forgor
its been long
Just make sure to make a speed cap and write nice curves
Is what a constructor?
why is this then
yeah but idk if that'd work with no gravity (using potion effect levitation 255 and slow falling)
Because some entities have multiple passengers
setPassenger is 1.8 stuff
e.g. boats
that yellow thing we used to see on the main method
Right, when boats were allowed two passengers
I wonder what 1.11 added
That probably explains my confusion. I have always put the EventHandlers inside the class that defines the methods used.
I was just trying to check that the import worked, and I guess I have never run into this issue before.
Yeah, event handlers are going to be a strange concept if you're just starting to learn a programming language. Though at the end of the day all you have to understand is that something will eventually call your event handler method
It's just not your own code calling it. It's CraftBukkit
If the code you're writing is top-level, nothing can call it so it won't run - or in the case of most languages, it won't compile
pro tip: don't ask some of us for help if you're a beginner, we'll overengineer our solutions and confuse you with all kinds of patterns
pink name = avoid
:p
haha
Alright, thanks!
Yeah, I have had that experience with some of the pink name people. I send a code snippet and then they are too busy roasting the rest of my program to answer the question.
we're picky
is there someone good with vectors?
Vectors aren't hard
I got these 2 links bookmarked
Sign up with brilliant and get 20% off your annual subscription: https://brilliant.org/ZachStar/
STEMerch Store: https://stemerch.com/
Support the Channel: https://www.patreon.com/zachstar
PayPal(one time donation): https://www.paypal.me/ZachStarYT
āŗFollow me
Instagram: https://www.instagram.com/zachstar/
Twitter: https://twitter.com/ImZachSta...
love vectors
hate math
Yeah, that's what they made the math package for š
if i eject passanger on bottom will it eject everyone or only the first
alright.
Vector launchVector = someLocation.getDirection().normalize().multiply(force);
if force is something like 1 to 10 (smaller values), the player gets launched in the right direction (direction of someLocation).
but if force is a high value like 100, somehow the direction isnt right anymore, it changes
@opal juniper @echo basalt @strong parcel
why is that?
Something tells me it has to do with floating point innacuracies being scaled up to a number so big they become apparent
Launching an entity with a vector as big as that will always cause problems
Sometimes due to chunk loading
server might teleport you back etc
And it never really looks nice
Hallo š.
How do i create a folder (with boosted yaml library)? I can only find about files. Is that just with regular spigot/paper yaml?
I'm new to developing plugins. Don't blame if it's super obvious
why don't you just create dir with pure java ?
really? you might be right but the float errors are very small
Well you're going from a big vector to a normalized vector
and back to a big vector
The innacuracies stack up
I didn't really think of that. I guess there's no reason to even make one with boosted yaml
but thanks
Yeah I said that yesterday
Also keep in mind that in the protocol, yaw and pitch are converted to bytes
and are done in increments
1.4Āŗ increments
It's weird
i suppose, yeah
to @echo basalt that message is
i mean you can try and combine the calculations but idk if that will help much
using integers doesnt work either
well you are making the error worse
time to test a goofy ahh plugin I made in 5 minutes
I wonder if there's a mod that lets me hotswap game versions without actually having to re-open the launcher
that would be scuff
do conventions say to use small or big letters for explicit floats, doubles and longs
1d vs 1D
Hey, I'm trying to undrerstand wht criteria i am not meeting to submit my preimum plugin? I believe to have all requirements met according to here https://www.spigotmc.org/threads/premium-resource-guidelines.31667/ my profile is here: https://www.spigotmc.org/members/z1haze.7626/
sorry if im not in the right place, ill delete if needed
Got 2fa on?
yeah i just did it today after i read that req
Just gotta fix interpolation
will take a while to kick in
So just be patient
alright
make more smooth (real)
how can I destroy a block?
depends what you mean by destroy
setting its material to air is usually enough
ah true im so lost haha
is it possible to know if the player moved his head through bungeecord?
i know bungeecord reads all packets and i know how to inject into netty
im stuck on here:
https://media.discordapp.net/attachments/1131926831759638640/1143590563459899542/image.png
What do you mewn by moved his head? Do you mean teleport between servers?
no just a normal headrotation packet
Then find the packet, i assume you need to use bytes to denote the packet
Most likely you have to use minecraft protocol to find the data you need
Thats the part which i cant
I don't remember the site, protocol something
wiki vg
There you go
is it possible to use some lib to do it or is it jus not
Protocolize
how can I add a tag to an entity in spigot?
a entity tag...
/kill @e[tag=idk] so that i can use this command
oh is it called a scoreboard tag?
I want to make it so that every 5 seconds the player has 1 heart restored, but so that if he takes damage, the timer for 5 seconds is reset, is it possible?
yes.
and player.getScoreboardTags().contains("name")
hmmm
you can set up a runnable system, giving each player their own time stamp and the runnable can do the math in order to see if the player needs a new heart given, and then in an entity damage event you can set the time needed for a new heart +5s
So the only way is to save cooldown in the plugin config?
why would you need to save the cooldown in a config?
i donāt think itās worth persisting 5 seconds..
yeah, but where could i store time stamp?
pdc
Depends on if they want it to be persistent or not š¤·āāļø
highly doubt it, based on it only being 5 seconds
Yeah I didn't read that part :/
oh I didn't understand how it works very well, do you happen to have a short hashmap tutorial?
sure,
Baeldung is a great resource for future reference ^^
is it something like an array/list?
oh thx
itās a similar idea, but instead you store miltiple key-values
where you key is the playerās uuid and the value is a long (unix time stamp)
something like [[Player, Key], [AnPlayer, AnKey]]?
oh
it's like objects in JS
Yeah, exactly
{UUID: Key}
but more like Player=Key
Yeah
yup
like json or js objects
exactly like json
I've noticed some attributes can be set directly using Player and some not.
Is there a difference between them I'm not aware of, or are they just 'exposed' since they're more commonly modified?
oh yes
some attributes only go on items or armor and some onto players
im intending on modifying the attack speed attribute of the player to not accidentally leave 'residue' on items
mhm
so im trying to work out how to edit attributes properly rn
i didnt meant the display thing
right.. that resources goes over covers how to use them in general, youāll need to@modify it to what you want
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
hm I'm staring down the numbers and it looks like they got floating point issues
is there an explanation on how that calculation works internally?
i want the final value of the attribute to temporarily become 1.6
i mean it pretty much is
can i just add a +/- number to the attribute
just round it down to a few decimals
well yes but floating precision error turns it into 1.5999999999
you don't compare floating values directly anyways
not the point
yes or no - can i just add a purely numeric modifier to attributes
well my plan was
double modifier = 1.6 - value
Hi, I would like to create a plugin that when you receive an effect says which plugin gave you the effect. Because there is a plugin that gives me the effect of wikness and mpm I can figure out what it is.
Who can help me?
listen to EntityPotionEffectEvent, check if the cause is PLUGIN, walk through the stacktrace until you find a class that's neither from your classloader nor the bukkit one, then use JavaPlugin#getProvidingPlugin(thatClazz)
hm actually this is concerning
this implies the modifier needs to be kept in memory and there's no easy way to reset it
do i need to cache the modifiers i apply?
Can you tell me a code example?
how would i improve this?:
public static String formatNumber(double num) {
int index = 0;
while (num >= 1000 && index < (FORMAT_THINGS.length - 1)) {
num /= 1000;
index++;
}
return String.format("%.2f", num) + FORMAT_THINGS[index];
}``` was thinking of just doing a StringBuilder but that wont improve it by much
10ms ain't bad but
what about space waste?
also have tried:
return String.format("%.2f%s", num, FORMAT_THINGS[index]);```
@EventHandler
public void onPotion(EntityPotionEffectEvent event) {
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
for(StackTraceElement element : stack) {
String clazzName = element.getClassName();
try {
Class<?> clazz = Class.forName(clazzName);
try {
Plugin plugin = JavaPlugin.getProvidingPlugin(clazz);
System.out.println(plugin.getName() + " added a potion effect to an entity");
} catch (IllegalArgumentException ignored) {
// Class does not belong to any JavaPlugin
}
} catch (ReflectiveOperationException ignored) {
// General exception from Class.forName(...)
}
}
}
idk if that works
tnx
switching items doesnt by chance reset the generic attack speed modifiers does it?
no
it is my plugin. It does not work.
return the name of the plugin
yeah, you'd have to filter out your plugin
cause the first stack trace element is going to be your plugin since its your listener
How do I filter it?
if plugin = my plugin, continue
ok
obviously you gotta filter out your own plugin
could also just start not at the first stack trace element
i thought you would at least TRY to understand the code I sent instead of blindly copy pasting it
is there a way to get all online servers in a bungeecord network
ProxyServer#getServers()
The code write all plugin do it, do not return;
I did, that's why I thought it worked.
print out the whole stacktrace instead, then send it
thx
anyone know a formular to calculate a players missing health? I suck at math but i dont get how this can possibly return 20
double missingHealth = p.getMaxHealth() - p.getHealth();
what does p.getHealth return
From 0 to getMaxHealth()
yes
then this should return 0
but it doesnt
it returns 20
Nah, show your full code
oh nvm i think i got it nvm
i used the method twice and the second one had a /2 at the end for some reason
i think because i wanted to round it or somethin? idk
i was to tired to think probally
Lol
Entity entity = player.getWorld().spawnEntity(location, EntityType.); How can I spawn a bamboo raft with this?
https://blog.jeff-media.com/use-consumers-when-spawning-custom-entities/
and spawn a boat with the type bamboo
When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. Iāll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...
world.spawn(someLocation, Boat.class, boat -> {
boat.setBoatType(Boat.Type.BAMBOO);
}
mb
thanks
a or b?
A)
if(modifier != null) {
modifier.remove();
modifier = null;}
modifier = new Modifier();
B)
if(modifier != null) {
modifier.remove();}
modifier = new Modifier();
at this point there should be no other references to it
you aint getting 'normal' out of me lol
if(modifier) modifier.remove() there ya go
wait that only works in lua
dammit
no
its throwing an error
is using runTaskTimer very bad for optimization?
no
So is it about the same as a cyclic command block in terms of optimization?
I'm not understanding this...
player.sendMessage("Speed: "+player.getAttribute(Attribute.GENERIC_ATTACK_SPEED).getValue());
I'm manipluating this attribute to be 1.6d, but why do axes still have their long recharge time? Do i need to bind it to the item?
just try to run it as sparse as possible
don't just use tick when you can use every 20 sec
why clazz
why not just class
class is a keyword
you can't have variables with keywords, at least in ides
ofc something like "eventClass" would be an allowed name but it's quite common to always use clazz, e.g. eventClazz instead
yeah i know
i once got a warning by staff because my obfuscator also called a class "do" (because it used the normal aa, ab, ac, etc naming)
since then I switched to $ + keyword naming
e.g. my methods are called $case()
i see
Tbh that sounds like a mistake
Not the intention of the rules anyway
IAmAFord said "do is a keyword and hence not allowed" so I just changed it
not a big deal
to be honest it doesn't affect readability
it was "if", not "do", my bad lol
i then messaged allatori and they now made the "aa, ab, ..." mode not use keywords anymore lol
Kinda surprised the obfuscator didn't already do that.
well usually it's not a problem if a class is called "if"
interesting that you can just message them and have stuff actually done
yeah they even made a custom version for me once
i asked them to add an option to change to which class the string decryption method gets added since it just used a random class and sometimes, that used to be my WorldGuardHandler class that must ofc not be loaded if WorldGuard is not installed
oh I see the custom version they made was for sth different
with proguard you're kind of on your own
yeah but proguard is free, isnt it?
i was spectical about allatori at first because their website looks like 1999 but the customer service is great and they added every single of my suggestions / fixed all my bug reports within 1-2 days
Still looks more modern then zelix
yes lol
you can't really fault devs for making bad website pages
yeah I also just bought themes for my websites
if I would have to make them myself they'd look like 1999 too
did some testing, it's not a visual glitch on the axes. for some reason the attribute just gets flat out ignored
anyone know why?
Is it possible to make an Overlay for a player like powdered snow or barrier
like if player in the snow biome he has overlay like from powdered snow
p sure the player actually starts shivering n stuff
The nice way of doing this is to just send a packet
but what about barrier overlay?
yeah that's the warning distance of the world border
That's the world border overlay. For when you're too far away outside of the barrier.
the vignette intensity has to do with the distance you are compared to the warning distance
I think it's referred to as warning distance.
So if the warning distance is 5, and you're 2 blocks away, it's 60%
yeah but is it possible to display it artificially?
With packets, yes.
packets?
Hey, im trying to build and im recieving these errors ```2023-08-22T21:38:34.221+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Error occurred during initialization of VM
2023-08-22T21:38:34.221+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not reserve enough space for 2097152KB object heap
Has anyone got any clue how to fix this, I have over 5gb ram available right now so im a little confused
The way the client and server communicate
player.getInventory().getItemInMainHand().getItemMeta().addAttributeModifier(
Attribute.GENERIC_ATTACK_SPEED,
new AttributeModifier("GGP",1.6 - player.getAttribute(Attribute.GENERIC_ATTACK_SPEED).getValue(), AttributeModifier.Operation.ADD_NUMBER));
This is slightly modified code, but it should still work? Why is the modifier not getting applied?
I'm running the code while holding said wooden axe
GetItemMeta returns a copy that needs to be .setItemMeta
^
im only seeing 1 issue
keep in mind that setting an attribute wipes away existing ones
where it says my attack speed is 1.6 but its in actuality closer to 0.7?
well im doing this nonsense cuz setting player Generic_attack_speed doesnt do squat
see here
it prints out my speed is 1.6
but when i actually attack it recharges with normal = slow speed
Not sure if that method takes into account items
it does
it registers 'weapons' and 'tools' if you print out the components for the player attribute
depending on whats in your hand
it just doesnt accept any input
or well, ignores it
i hate nms
same, but with mojang maps it's halfway usable
not anymore
is there a way to get bungeecord servers status without using bungeecord
the connection variable in 1.20 is now private
what do you need it for?
in the serverplayer class
packet listener
i tried the reflection method
then you have to getDeclaredFields(), loop over that until you find one of type ServerGamePacketListenerimpl
wait
There's a public method
can creative mode mess with attributes?
thats ALSO not it, im losing my mind
which class exactly do you need? the Connection or the ServerGamePacketListenerImpl?
servergamepacketlistenerimpl is public
connection isnt
which is what i need
well then do
Class<ServerGamePacketListenerImpl> clazz = ServerGamePacketListenerImpl.class;
Connection connection = null;
for(Field field : clazz.getDeclaredFields()) {
if(field.getType.getClass() == Connection.class) {
connection = field.get(myServerGamePacketListenerImpl);
reflection is so unreliable man
oh dont forget to set it accessible
but yeah if you get the field through its type, you don't have to worry about the obfuscated name
public Connection getConnection(){
Field field = ((CraftPlayer) player).getHandle().connection.getClass().getDeclaredField("f"); // connection
field.setAccessible(true);
return (Connection) field.get(((CraftPlayer) player).getHandle().connection);
}```
this is what i did
Which part of there's a public method was unclear
there is none for Connection?
^
there is a field to get the ServerGamePacketListenerImpl on ServerPlayer (called connection, it's public))
but Connection is another class (extending the SImpleChannelInboundHandler) and there is no method to get that
see here, field "connection" https://nms.screamingsandals.org/1.20.1/net/minecraft/server/network/ServerGamePacketListenerImpl.html
the only way to get the "Connection" object is to get it from the private field "connection" in ServerGamePacketListenerImpl
why'd they change it tho
because mojang doesnt care whether you need it š„²
yes ofc lol
i barely know anything about this
NMS is the original minecraft code
and remapped is the slightly more stable version created by spigot
why is the obfuscated mapping called spigot and the good one mojang?
i dont think it is?
oh i cant read english
its the mojang mappings remapped
its called remapped-mojang
there is obfuscated, spigot mappings (not good), and mojang mappings (good)
spigot only changes the names of classes now, and not new ones
wait theres three?
that's not correct.
Obfuscated mapping is the REAL obfuscated mappings, with classes called aa, ab, ac.
Spigot uses spigot mappings, which uses the obfuscated method and field names, but its own class names.
there's way more than 3, other projects use others
which one of the remapped ones does --remapped spit out then?
and mojang?
the good one everyone likes
but its own class names.
but not for new classes, new classes use mojang's mappings
see here:
- MOjang mapped name: what mojang uses in their own code
- Obfuscated name "aig" - that's what the vanilla server calls it
- Spigot - that's how spigot called this class
if you use mojang maps in your plugin, then first the class name gets translated from mojang > obfuscated and then from obfuscated to spigot mappings, IIRC
although the only difference between spigot and obfuscated nowadays is class names
before 1.17, spigot also renamed methods and fields (sometimes), since 1.17 it does not do that anymore (in favor of mojang maps)
i feel like you're chatgpt the way you bring up massive amounts of information in seconds
š„²
he writes a blog
hes used to this
also on the earlier topic...
i really dont want to have to mess with item metadata if i dont have to. I just cant figure out why the final value of the attribute is ignored and replaced with a different one somehow? 1.6 -> 0.7
Do clients have client side interpolation with items? (e.g. if I set the location of a stone block item entity will it smoothly transition to the set location or does it just teleport)
i think stuff just teleports
yeah that's correct
e.g. Spigot: EntityZombie, Mojang: Zombie
but for Camel (1.20), it's both Camel
Items/Entities just teleport. The only things that interpolate are Display Entities.
my beloved display entities ā¤ļø
best addition in the history of additions, maybe ever
How would I make it so it smoothly transitions to another location?
Like how if you throw a water in a flowing water stream it just flows down.
Trying to create a sort of "conveyor belt".
chat signing is theb est addition
we all wanted it
and mojang delivered
and number 2 are armorstands
mfnalex wiki when
install mediawiki š„²
the spigot wiki is pain because of bbcode - and people flood the discussions with their own personal problems instead of simply discussing the article
I'm not too sure about that. I think that's done with velocity, but it might be something else that controls that type of movement.
looks like wikipedia
it is wikipedia
When i want to sell plugin on spigotmc can i make obf with my own obfuscator?
the list of obfuscators allowed are listed in the rules on the website. other obfuscators require approval
Docusaurus is great
especially for programming related stuff
No other obfuscator, whether public or private may be used on resources uploaded to this site. To inquire about adding an obfuscator to the above list, please contact staff and provide a sample plugin.
Why is that?
is it really worth it?
Well obfsucators from this list are all easy cracked by anyone who can use google
yours will also get cracked
because "the decompiled code must be somewhat legible by staff"
as mentioned in the general rules: https://www.spigotmc.org/wiki/spigot-rules/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
will you write all the articles :p
point 4.1.6
so is nms
I didn't code project for a month so a day after release it will be available at black spigot for free
Obfuscation isnāt the thing preventing thatā¦
bad news, obfuscation wont make your plugin uncrackable
and DRM isnt allowed
so have fun
Yea it is XD I'll show u something
no its not
maybeeee š
public class ItemInterpolationTask extends BukkitRunnable {
private final Item item;
private final Location targetLocation;
private final int steps;
private int step = 0;
public ItemInterpolationTask(Item item, Location targetLocation, int steps) {
this.item = item;
this.targetLocation = targetLocation;
this.steps = steps;
}
@Override
public void run() {
step++;
double progress = (double) step / steps;
double x = item.getLocation().getX() + (targetLocation.getX() - item.getLocation().getX()) * progress;
double y = item.getLocation().getY() + (targetLocation.getY() - item.getLocation().getY()) * progress;
double z = item.getLocation().getZ() + (targetLocation.getZ() - item.getLocation().getZ()) * progress;
item.teleport(new Location(item.getWorld(), x, y, z));
if (step >= steps) {
cancel();
}
}
}
```You think this would handle interpolation of the item smoothly? With steps being the "smoothness" of movement.
you dont need the full deobufscated code to remove a part of DRM
also @green plaza im assuming you will use obfuscation + some form of drm
Lmao
u cant even decompile this shit
obfuscation is pretty pointless - and I say that as someone who paid for obfuscators twice
send me the jar
no need to, you look at the byte code
so you cant publish to spigot
Open source + premium support is the better model
staff need to be able to read it
^
Why
Ofc i'll send u
to see that you're not doing total shit in your plugin
you know, premium plugins require approval
check for malware, check for drm, etc
Pay for compiled jar on spigot, open source, only offer support on discord or whatever to those who pay
if theyre not gonna fix my bugs then whats the point
i do it like that, but the distributed .jar is still obfsucated kek
obfuscation is good at hiding bad code
lets be honest most premium plugins have shit code
So it should work like that that staff compile your project from src and post it and verify from src.
because why care if noone sees it
idk they must have at least a minimum standard of code quality to get approved in the first place
you dont need that, just post checksums
i do that
Posting on spigotmc premium projects is basicly allowing someone to crack it and post it 2 days later on black spigot
then dont publish anything
keep it to yourself
if you are scared of publishing something
(This is why you do paid support, canāt āstealā that)
you can easily write an email to tmp-support@spigotmc.org and ask to get your custom obfuscator approved. Otherwise, it's simply not approved, and discussing WHY with us doesn't help because we didn't make the rules
you cant stop it, your plugin will get cracked sooner or later
yeah because you didnt read the rules
I have sent you both articles that both mention this and also included a quote where it's mentioned
@green plaza but why obfuscate when someone can just repost the obfuscated jar?
makes no sense
here's AGAIN the links:
https://www.spigotmc.org/threads/approved-obfuscators.420746/
https://www.spigotmc.org/wiki/spigot-rules/ rule 4.1.6
Belive me or not its not going to be. I don't belive anyone here is able to crack it
you will be suprised
He can not
whats stopping that person
Words before disaster.
every one of them say the same thing
why not? you do realize that DRM is only partly allowed right? your .jar must work straight "as is" after downloading it, without any additional setup or internet connection - which is btw, also mentioned in the rules
No one is secured but using more complicated and advanced techniques to secure the code drasticly decrease amount of ppl that can crack it
Is that a challenge
I'd bet Optic or Frost could do it in less than an hour.
wdym by secure the code
i bet even I could do it
So no one can crack it. Do everything to secure it
Security through obscurity is a myth.
your plugin has to work offline you know that?
the more effort you put into obfuscation, the more people will see it as challenge to make you look stupid
It does
I' even plan to pay for cracking it
yeah then your attempts of making it uncrackable are pointless
anyone can just firewall any drm you got
or straight up remove it
how much?
im interested
make that a competition
lets see who does it first
but deposit money to staff so we know you dont scam us
Depends but from hundreds to thousends
yeah you can open a thread in spigot forums and send your .jar there, then ask people to crack whatever there is to get cracked
how do we know that you are not going to scam us
I don't rly give a fuck what u know or u don't
a minute ago you wanted to offer them thousands of dollars and now you don't want to distribute a .jar? then how would someone crack it if you don't send the .jar? is your method of preventing cracks that you simply not upload anything? because if so, then yeah, that'll work
there are many reasons not to trust you
first is you trying to hide your code
thats shady
brb smoking
Anything u buy from internet is trying to hide its source code. From games to applications so u can not make copy of it and sell it
no
You smoke? I thought you just drank? .-.
Not true. Yes, there are a large amount of programs do that, but there are just as many open source programs out there.
some games are an exception
There are bilions ppl here except u
cool i dont care
Proprietary software has its place, granted I don't think its great in all scenarios
the rest of the world doesnt matter to me besides my family and friends
Nah i only smoke (cigarettes)
Okay mine is not open source so why do u even compare it to opean source XD
@green plaza do you know whats the license of bukkit api / spigot api
Idk never thought of this
Well uhh, you're not going to like it then. lol
spoiler: its not on your side
just turn a blind eye and pretend you didn't see it :P
i wish i could do that for taxes
GNU GENERAL PUBLIC LICENSE
and just not pay them
Is that it?
yes version 3 (or later)
Yeah that would be very handy lol
Great bcs its not a plugin
So i don't think it apply for this license
Then you cannot sell it on spigot
You can only sell plugins on spigot
I can not sell engine on spigot?
š
Oh weired
mf is trying to sell mojangs code
Have you still not read the rules?
@green plaza is the fork for version 1.8
I sent them thrice
Yea ofc
let me go ahead and notify mojang about that
you know that its illegal to resell their code right
XDDD
Good evening, I'm using CombatLogX and I can't add the menu command. Can you help me?
Picture here #verified
you can be sued for that
ud have to use bbb to sell server jars probably
U stupid asf
theres a reason theres no public access to compiled spigot jars
i think you are
Are you 13 or sth
based on your knowledge
Great i have not a single code from mojang
20
really?
you built minecraft server from scratch?
Then behave like that and stop insulting people
A little bit
then does it have their code or not
can you prove it?
Itd be mojangs job to prove they used their code
Not the other way around
not hard to verify
if its a fork theres a ton of code
It only handle necesery things like ArmorStand, Players, Worlds, Blocks, locations, Items, Commands, Inventories
you forgot that their obfuscation is uncrackable /scnr
