#help-development
1 messages · Page 2005 of 1
It’s my irl/professional one. Easier for employers to find it. I do have a unique name, it’s not like “John smith”. Also it’s too late to change it lol
I guess I could change my username. It was first initial last name. I’ll also have to double check all my student projects on there.
Question, for getNearbyEntities. How does it order the returned entities? It doesn't mention it in the api.
So completely random?
Which is probably from lowest point to highest
Oh this will be fun.
You can always sort it
It’s a future me problem
You know what
How to check if a player is online or not
You could’ve googled this. Bukkit.getOnlinePlayers().contains(player)
Ok so
Here’s the solution I think I’ll go with. I’ll upload it temporarily to my main GitHub, while job searching to have it on my resume. Then repackage it and upload it for real to a new spigot account using my alts name, which I’ll also have under my first name. My old(main) Minecraft account will remain anonymous forever
oh lol
alr
Hey, I'm new to using NMS (this is my first time attempting to use it) and I imported the Spigot Server JAR from buildtools and I can't find the PacketPlayOutTitle class, was this removed in 1.18 or is the Spigot server jar missing stuff?
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Alrighty thanks
my last name is pretty cool
How would I create a while do loop in a plugin, that constantly runs?
?scheduling
For me.. or?
Yeah
well a while loop runs constantly already
it will run until it meets a condition to stop
I know, but I bascally want to do a check for a value
if its true
give everyone hunger for 5 seconds
The boolean already exists
If id just do it in a public class or not
If not what id do
oh you want the while loop to restart is essentially what you want then?
well ideally you would want the boolean to be public
Nope just create a loop general, can I place one anywhere without it effecting anything?
Also the boolean is public
yeah you can put it anywhere you want, recommend however that if its something that can be ran in another thread
best to do that
so that it doesn't affect the main thread
Obv, planning on making a folder called handlers, and making a class called HungerHandler
I mean a simple task checking a Boolean probably doesn’t make much different being async
Ah
Anyone able to take a look at this? I'm trying to save a world to the disk and then reload it from the Disk later on: https://www.spigotmc.org/threads/save-load-snapshot-of-world.549656/#post-4378069 but using WorldCreator doesn't seem to work
How can I check if a string is a player?
rn I'm doing if(playerName != Bukkit.getEntity(Player)) but idk if that will work
Bukkit#getPlayer(String name) note: if the player doesn't exist it returns null so handle accordingly
usually i do something as follows
if(Bukkit.getPlayer(name) == null){return;}
Player p = Bukkit.getPlayer(name);
Player target = Bukkit.getPlayer(playerName);
if(playerName != Bukkit.getEntity(Player)){
sender.sendMessage(ChatColor.RED+"Player does not exist.");
} else {
if(Bukkit.getOnlinePlayers().contains(target)){
Location location = target.getLocation();
sender.sendMessage(ChatColor.YELLOW+target.getName()+"'s "+ChatColor.GREEN+"location is "+ChatColor.RED+location);
}
}```
wait so if it's null then that means they dont exist right?
yes
if you don't handle the error you will get npe's thrown like crazy
Ew calling it twice
:p
:P
anyone know why this is returning null lol I'm so dumbfounded.
https://pastebin.com/W588vuby
[20:53:23] [Server thread/INFO]: positions.pool2.testsword
[20:53:23] [Server thread/INFO]: 2
[20:53:23] [Server thread/INFO]: positions.pool1.teststick
[20:53:23] [Server thread/INFO]: null
positions:
pool1:
teststicK: 1
pool2:
testsword: 2```
prints this even though the sections are filled in the config lol i'm thoroughly confused. I thought at first it had to do with the value being 0, but upon changing it still gives null 🤷♂️ i'm so confused lol
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
||the lack of consistency in your use of whitespace hurts my brain||
its the discord formatting
definitely not what I'm looking at
you also fucked up the formatting of your msg when you moved the code to a pastebin
what it looks fine on my screen lol
you say after you fix it
ahaha
I posted that message before you fixed it :)
uhuhuh not with my insanely high latency you didn't
I'm going to cry
I just realized my error I feel so stupid now lord
its always the yaml files I swear to god
teststicK vs teststick 😭
anyone know why im getting completely different results here?
not sure why you are using String.valueOf, should be able to just send it as is o.O
my ide screams at me if i dont
plus that doesnt rlly matter anyway. its the data its outputting that matters
Considering that your output is 0, have you tried debugging your getHealth method?
well
it hasnt thrown a sql exception
how would i debug it
send its data to console?
Yea. Just make some souts before each branch in logic to see if it's even being fired at all. Or to at least see what is being reached.
It looks like there's a method in Bukkit.getServer() to unload the world have you tried that? Bukkit might be detecting that the world is already loaded and using that
and we have our issue
if (rs.next()) {
health = rs.getDouble("HEALTH");
System.out.println(health);
return health;
}``` this isnt firing
Looking at your code again, it's because you are capitalizing "HEALTH" in your query. When in your previous one it's lowercase.
Rly? I thought table names were case sensitive.
they are
i think
idk
but its the exact same command for this one
just different wording for the tables
maybe i should check the tables itself
Well usually table names and values are lowercase. I think that's what was throwing me off.
How do I disenchant a potion in a itemMeta?
Probably a good idea.
You mean remove the enchantment glint? That's not possible without a resource pack.
that might be a little bit of an issue
Oh realy?
What about in 1.12.2
Yea, the glint on potions is hard coded. You need a resource pack to change that. Same thing with the enchanted books. Want different textures for that? Need a resource pack.
Damn.
Final question: How do I get the command sent with onCommand
like for example:
if the command was "/Test"
it return "Test"
Command#getName()
Instead of db querying each time on an health change I would put it on a hashmap and on a playerLeave just dump the hashmap value's into the db.
Command is one of the parameters passed with the CommandExecutor method so you can just use that instance of it.
Doesnt seem to register correctly
public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
command#getName()
return true;
}
Am I doing that correctly?
Oh boy
is used to denote instance methods
You don’t actually use # in the code
It’s .
oh
It’s always .
Notice how I used the capitalized name. Command#whateverMethod() vs command
considering that im still getting a value of 0.0 from gethealth i think something else is also wrong
Because that's generally how classes are named in java.
Did you change the column name or the code used to access it?
nothing is being sent to the table
and i have a function to generate the player in the table
Maybe do an insert
Yea, but did you update your column name? You found that was one issue.
table creation is correct
INSERT INTO ... on a player join event and on the health change UPDATE. Don't think you can update something that hasn't been inserted. Can be wrong on that
health should be correct
Ok, but did you clear that table after you changed the typo? Because otherwise you are using old data.
theres no data in the table and i changed the typo in the table itself
should i just completely wipe the table
How did you update the table?
update inserts if it isn't there
phpmyadmin
IIRC, this is the way you rename column names with mysql.
ALTER TABLE <TableName> RENAME COLUMN <ColumnName> TO <NewColumnName>;
Aight good to know thanks!
why do you have varchar set to 100 for UUID?
uuids are never that long, such a waste of space doing that
Hmm, I've heard of it, but never got around to to trying it. What exactly did it offer for changing the name?
There is a method in the JavaPlugin class called getDescription(). It has a bunch of methods that can get things from the plugin.yml
why are you using the ignore?
using ignore is probably the reason why you are never getting errors
do you even know what it does?
nope
tysm
any invalid data gets ignored instead of throwing an error, and any valid data still gets inserted
i followed a random tutorial cause i dont know s--- about mysql
well
i know how to use mysql just not how to do stuff like inserting and all that using sql commands
so this could very well be the reason you have mismatched stuff in your DB
But... that is myql...
when it should have errored you told it not to
for(String cmdName: getDescription().getCommands().keySet()){
getCommand(cmdName).setExecutor(new CommandEvent());
}
now its actually returning the correct value
horray for simplicity
That's not how that works.
wym?
needless to say
if (skygamez == idiot) {
return true;
}
and of course it returns true
thank yall
Well, it's weird to say the least. I doubt that you will be putting every single command that your plugin has into one class. Unless you have one command, then alright, but even then, you don't even need the for loop.
are there any ways to optimize a runnable that makes air to a solid block when player moves just like frost walker, it runs every 2 ticks.
seems like #setType too heavy
you need a runnable for this?
sounds like something you would just have in the move event listener
weird converter
and it gets canceled
amazing how one little thing makes the difference
yup
I recommend using more quality tutorials
at least ones that explain what it is they are doing
there is a very specific use case for using ignore
There are two steps for registering a command.
- Put it in the plugin.yml
- Use getCommand().setExecutor().
That's all you really need. You can of course set multiple commands to the same class, but you could always use the alias tag in the plugin.yml and then compare the label in your command class.
most people won't come across it
welp
What's the use case?
i probably should figure out how sql actually works
one of the specific use cases if you are trying to insert tuples
if the tuple contains the primary key it will error
instanceof you mean
😳
lol
for(String obj: Mphone.jp.getConfig().getStringList("Challenges")){
System.out.println(obj);
}
having SLIGHT trouble w/ something
How does one delete a plug-in that they made from spigot plugins website
report it, and in the message state you want it deleted
Looking for devs to help with a Minecraft project
?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/
Looking for a minecraft project to help with devs
define help
Yes
good definition
Thank you
red
Dead
hi
How can i check for a crit hit?
I’m not too sure there is a good method for that
Check if the player is in the air and has negative y velocity I guess
If player use module criticals in cheatclient its will not detect
I mean in minecraft sources you can cut boolean check for crit hits and every hit will be critical, without jump or anything like that
Is that really client side
Oh Mojang you silly
I thought those crit hacks just made you move up and down very slightly
And this is what we call mojank
Indeed
i call bullshit
the server decides if it's a crit in the attack process logic
it doesn't come from the packet
crit hacks do make you jump up and down slightly
looks like a lot of BS to do it
but if you did do it you should also make it so that it doesn't play all these crit animations if isCrit gets set to false
nope
Your mom is
LOL
God dammit md
That should be pinned
https://media.discordapp.net/attachments/894685572239593532/947235436491845692/unknown.png
How can i check for a criticals if on the clientside flags for crit hit was cutted and player dont need to jump for crit hit
your assumption is incorrect
Sorry for the repeated question, I didnt understand very well what you meant above, English is not my native language
the client has no control over setting something as a crit
if a hacked client is making you always crit then they are sending the server a very small jump
Have you ever work with mcp? I just cutted flags for crit hits and is that works, EntityPlayer class
im looking at the source code
the crit calculation happens on the server
I tested it on hypixel and everything worked well
Crit calculating on server side, but client side sends when crit happened
Then why can i use criticals on hypixel and it works?
it's possible hypixel does what we do and doesn't distinguish between a critical hit and a normal hit
but the client does not decide when a crit happens
you can make the client always show the animation
but that's a totally different thing
Prob you right, i'll test it a bit later, but when i played on cracked servers with anticheat that triggers on any cheat, i got banned for the first hit
here's how it happens:
the player tells the server "I am attacking this entity"
the server then looks at the player's velocity and decides if a critical hit has taken place
the server then tells all the players "hey, this was a critical hit"
nowhere in that chain can any client tell the server "this attack is a critical hit"
I’ve seen this server with like 50+ items each one with its own custom texture, but each one is actually a diamond hoe
How is this possible?
Recent versions have custommodeldata
resource packs
Otherwise maybe per durability texture
yeah but they’re all diamond hoes
yes
I don’t see any durability bar
you wouldn't
Custommodeldata then
newer versions let you map different item data to specific models
what does that mean
wdym by different models
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thanks
np
also is it possible to implement a custom item that other plugins can use?
depends on what you mean
Like my own ItemStack in which another plugin can give to players and stuff
you can make an API method to return a specifically configured ItemStack yes
ok maybe that’s not a good description, I’ll just say what I’m trying to do
Tools were the old way
You could have per durability textures on unbreakable items
Despite the fact that unbreakable items normally didn’t lose durability
I’m trying to make a custom item similar to alcohol, where if you drink it your "drunk percentage" goes up. The higher the percentage, the higher the weirdness for the player gets (random movements, nausea, vomitting soul sand). Of course all the "drunk" logic is going to be handled in my own plugin, however how would I be able to let other plugins give the alcohol item to players?
yes
@tender shard You'd like this one ^
How exactly would this work
write an API to give alcoholic items
Where would I write the API tho?
in your plugin
Can it just be any public method in my plugin?
pretty much
gotcha, I thought spigot would just do something weird
Alright thanks
@brave sparrow wait sorry one more thing
about the custom ItemStack
for example if another plugin wanted to go through a players inventory and check if an item is alcohol
are you only going to have one alcoholic item?
they won’t be able to do that if I only provide a method to give players the alcohol
Add a pdc tag to identify it
Well no, but all of them are going to function the same just with different names and textures
then use pdc like coll said
sorry what
?pd- oh
oh is there a thing for that?
thanks so much
which one?
alcohol plugin
That does exist
Hell yeah
huh, is it not possible anymore in the discord developer portal to show existing bot tokens?
it only shows me an option to reset the existing token
guess the movie this quote is from:
"I hate manure!"
anyone how to get an array of JsonObjects from a string using gson?
All I found on the internet uses JsonParser().parse(String) which is deprecated without any comments
what do you want the jsonobjects for?
I want to get a list of all my plugins from spiget
already found the solution: parse(String) is now static parseString(String)
I might have something
they could have at least added that to the javadocs instead of just saying it's deprecated lol
lol
do you have to use gson specifically ?
heres the code I used for getting Json stuff
I don't use gson as it isn't really necessary
indeed it can be, just I didn't need a large lib for this simple thing lol
yay it works 🙂
nice
https://pastebin.com/5dEgBPp6 whats the problem
recursion
what is this
I just added some plugins and it started crashes
the error is in which plugin?
how can I name client side entities using rgb
hey how can i control an entity's health
LivingEntity#setHealth(double)
no i mean if the entity's health got under 1.5 he wont be able to move again
but when im using entitydamage or entitydamagebyentity, it always works when someone hit the entity. When entity fells or got damage from lava its not working
How can i take the death location of someone
public void hideParticle(Item particleToHide, Player player) {
int[] particleID = {
particleToHide.getEntityId()
};
PacketContainer packet = manager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
packet.getIntegers().write(0, 1);
packet.getIntegerArrays().writeSafely(0, particleID);
try {
manager.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}```It says there is no Integer Field, but if I look at wiki.vg there is a VarInt Field, and if I'm not mistaken ProtocolLib treats Ints as the Varint. Version is 1.18.1
Guys how can i remove respawn screen
which one do you people think looks better?
with new line, or without?
the empty line? it's needed so that the spigotmc link is on the next line
without
first one
first one looks better
they both look weird
the first one wouldn't be too bad if that line with the plugin in bold was just like slightly lower?
the second one is alright if you like spaced out stuff
well discord does the formatting
I can only add a new line, or not, I can't control the size of it 😄
I see, then the first one would have to be my choice then
alrighty, everyone chose the first version so far so I guess I'll use that 🙂
how can i get list of a block on the world that player is in
you can't get all the blocks
there's 4294967295x4294967295x4294967295 in each world
How ill spawn a armor stand with block as helmet, with packets?
you have to loop through all the coordinates
and get the blocks at those locations
oh
hey im trying to tp the dead guy to his dead location and set his health to 0.5, set his walk speed 0, if someone heals him his walk speed will be 0.2F again and he will respawn.
public void onDie(PlayerDeathEvent e) {
if(e.getEntity().getPlayer().isDead()) {
Location x = e.getEntity().getPlayer().getLocation();
e.getEntity().getPlayer().teleport(x);
e.getEntity().getPlayer().setWalkSpeed(0);
e.getEntity().getPlayer().setHealth(0.5F);
}```
why are you teleporting him to his death location
and what is e.getEntity().getPlayer()
not a big plugin
the dead guy
why are you doing getPlayer()
because he wont be able to move and it bypasses respawn screen
getEntity() is returning a Player
yes thats what i need
the respawn screen goes away if you set the health to > 0, not if you teleport them
right, so get rid of the getPlayer()
its not working
he will be able to move, it only teleports him once
probably because of that first if statement
when he gets big damage he dies
yes
im trying to block it
so get rid of the if(e.getEntity().getPlayer().isDead())
and once again, just e.getEntity(), not e.getEntity().getPlayer()
id have to check that
id be willing to bet the event fires before they get dead
typically the event fires before the state actually changes
so they probably aren't dead
with loops
for loop
3 for loop, each one checks for a direction ( x, y, z )
like
for {
for {
for {
}
}
}
i did
private static final List<Location> blocks = new ArrayList<>();
public static void addBlocks(Player player) {
for (int x = -150; x <= 150; x++) {
for (int y = 50; y < 150; y++) {
for (int z = 0; z < 150; z++) {
locationList.add(new Location(player.getWorld(), x ,y, z));
}
}
}
blocks.forEach(System.out::println);
}```
it works perfect with this code but there is 1 more situation. When i kil the entity he teleports to his death location. And it bypasses respawn screen and set his walk speed and health to 0.5. But after that i dont know how to control when player's health got up to 10 and he moves again.
@quaint mantle just checked, they aren't dead when the event fires
once again, you don't need the teleport. they don't move unless they get to respawn, and if you heal them slightly on death event they never get the respawn screen
as for controlling it, you'll need to keep track of that player
either way, before it even gets marked the event fires
the event happens before anything else
Damn
finally I'll never forget to announce updates again
Any way i can look in sources of jar and rewrite it?
is there any thing exist like Bukkit.getServer().getTps() something like this?
for getting tps of server?
ugh spiget API sucks
sometimes it returns the new version, then a few minutes later it returns the old version again?!
only using reflection
or NMS
MinecraftServer has a field "recentTps" or similar
oh
it's a double[]
?paste
too little information to even hazard a guess
my java gets error
i dont know how to set path
i accidentally deleted path location
?bungeecord
problem on jre
How can you accidentely delete that
i was trying to set it
where i find 1.18.1 bungeecord api documentation ?
?jd-bc
thank you!!
this is the full list
you can copy it anywhere you like
how to add jre
I have just added some aliases to my bash_aliases to start different java versions
i really dont know what to do
when typing %PATH%
it says C:\Windows\system32' is not recognized as an internal or external command, operable program or batch file.
yeah well you're not supposed to just type %PATH%
it's not a command
you can do echo %PATH% to show what your %PATH% is currently set to
https://paste.md-5.net/delagegesi.shell im getting this error on jre
did you try to start a minecraft server?
yes
what plugins do you have installed?
no plugin
i was setting up the run file
and it said my java was old i updated and changed the path and this happened
did you get any hs_err_pid_XXX file?
yes
upload it somewhere pls
hm weird, I have no idea
[ERROR] .... Error occurred while enabling SetHomes v1.0 (Is it up to date?)
java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:831) ~[?:?]
at java.util.zip.ZipFile.getEntry(ZipFile.java:330) ~[?:?]
at java.util.jar.JarFile.getEntry(JarFile.java:518) ~[?:?]
at java.util.jar.JarFile.getJarEntry(JarFile.java:473) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:163) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:108) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
at me.rephrasing.sethomes.Core.registerCommands(Core.java:34) ~[sethomes-1.0.jar:?]
at me.rephrasing.sethomes.Core.onEnable(Core.java:21) ~[sethomes-1.0.jar:?]
this happened while trying to register a command
private void registerCommands() {
getCommand("sethome").setExecutor(new SetHomeCommand()); // line 34
}
// i called this method in the onEnable method
# plugin.yml
commands:
sethome:
usage: sets home
home:
usage: teleports to home
deletehome:
usage: deletes a home
zip file closed normally simply means that your .jar is corrupted
try building/uploading it again
i tried building it like 5 times and reuploading it
i tried restarting the server cause i thought the problem could be biletools loading it in an abnormal way but same exception happened
this might seem like the weirdest thing but
i removed all plugins and kept only mine then it worked
no errors
i have no idea why or how
can also be a class loading problem
maybe e.g. when you have a class with the same name as another plugin or similar, not sure exactly
okay i have a question tho
what is the best fork type to code plugins in?
bukkit
spigot
paper
what i mean by best is what would work on all of them with the least bugs?
alr ty
ikr lmao
hey any protocolib exprert ?
?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!
?howtoask
*expert
lmao
im asking before cause when i tell my pb i got so many retard like omg
Personal best moment
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!
?ask
yes wait
ask already
how to send PacketPlayerCustomPayload with protocolib there is no documentation
x)
yes or no?
thats not that common how did you know
wrote it myself already
x)
lemme get it out of my repo for you
thx ❤️
not as easy as sending custom oayload
what did you use ?
for bungee tho
should still work
for 1.13 up
for 1.12 and lower use Forge12 class
if u copy code, please leave credit
not i will not x)
;7
copy *
How are these done?
omg x)
No plugin can do that with models or texture packs?
there u got ur answer
hope it works
im not going to copy thats what y mean x)
fml:loginwrapper why did you choose that channel
is it not modid:channel
wait im dumb
thats a vanilla one
so i can communicate with forge
oh you need to send that packet to be able to send packet later?
oh
i undurstand
you think i want to know if client use forge right ?
no i want to send packet to forge client x)
do a test, Go to your .minecraft foder find server-resourcespacks and ALL files added .zip at the end of the name, Once this is done, open the files and try to find the one on this server and send me the file
there is no .minecraft in bedrock
hmm
If it really was bedrock it would have the icons on the side
if you are messing with bedrock then why are you here o.O
@wet breach its not me x)
I just took a screenshot of a screenshot
so you never played on the server that got that
No
I believe this server used custom font to display these holograms using resource pack
so you dont have anything on your .minecraft
Nope
@fervent gate https://www.youtube.com/watch?v=-9bjbL1dYAE
Since Minecraft 1.13 we have access to custom fonts. Since I have not seen much about it here a little video about it.
I want to show you everything you need to know and provide some ideas how you can use fonts creatively.
Resourcepack: https://dmanager.stevertus.com/pack/stevertus:custom-font
Reddit article: https://www.reddit.com/r/Minecraft...
And that ❌ is a custom item texture
This can be util for you
Custom fonts are great
Thats easy, even on java
It just takes time tho
I wouldn't have a clue on how to begin
Then just dont begin 😳
There’s some guides online
I used one to make this, it’s actually fairly easy once you understand it
Only time and dedications
Doesn’t really take that long
whats the specific sound name that sounds like an error when u press a button
or are there any repositories for mc sounds I can listen to
sounds like great idea
but lol I do have CMI, i guess i gotta check it thru commands for now
wait
with this code
if(as.getTargetBlockExact(1) != null && !as.getTargetBlockExact(1).isPassable()){
if(!as.isDead()){
as.remove();
if(player.getInventory().firstEmpty() != -1){
player.getInventory().addItem(itemManager.wand);
}
Cannot resolve method 'getTargetBlockExact' in 'ArmorStand'
error
how can I fix dis?
how can i detect the block break chain(like chorus fruit)
I have the following code but it doesn't work because BlockPhysicsEvent doesn't capture new block state
@EventHandler
public void onBlockPhysics(BlockPhysicsEvent e) {
// if the new block state is not air, just ignore
if (e.getBlock().getType() != Material.AIR) return;
// get nation/war at the location
Vec3i vec = new Vec3i(e.getBlock().getLocation());
Nation nation = nationRepository.findByRegion(vec).orElse(null);
if (nation == null) return;
War war = getWar(nation);
if (war == null && !repairing.containsKey(nation)) return;
// cancel event (if the nation is in war, repair that later)
e.setCancelled(true);
if (war != null) {
war.getRecoveryContext().add(new BlockRecovery(e.getBlock().getState()));
e.getBlock().setType(Material.AIR, false);
}
}
?paste
wanna tell us what error?
Cannot resolve method 'getTargetBlockExact' in 'ArmorStand'
ah, what version do you use?
spigot
ew, unsupported. did you check if the method exists in that version?
how can i detect chorus fruit broken by physics?
you mean when it pops when you break the lowest block?
yes
BlockPhysicsEvent gets fired even if the chorus fruit block isn't broken
i have to find another way
(Also i have to deal with beds/doors/etc)
didnt checked and would have to research further but im not home yet, but did you tried the ItemSpawnEvent since that should get called too?
ItemSpawnEvent doesn't provide any information about its source
declaration: package: org.bukkit.event.entity, class: ItemSpawnEvent
so you are telling me to cache BlockPhysicsEvent location, and if ItemSpawnEvent occurs within a tick at the cached location, cancel the ItemSpawnEvent?
?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/
how you implement it is up to you
i just gave the clue
Could you tell me how you would implement that?
because ItemSpawnEvent isn't related to BlockPhysicsEvent directly
I wonder how you would implement that
would have to look further into it then, but im still not home. can come back later to it, if i dont forget about it
ok thanks
is there an event for log stripping or do i have to check for playerinteractevent
So I'm looking to have it snow only in particular areas of the map at particular time (I want there to be a block radius within a player and have snow follow them). What would the best course of action be for this? Have the entire map (minigame map) as a snow biome via packets then use packets to trick the clients into thinking there's barrier blocks at the highest y level everywhere except the radius within the player? Any better ideas?
is there a fast way to check whether an artifact exists without having to run buildtools to build to entire jar. For example, java -jar BuildTools --rev 1.18.2 --remapped
for death event, is there a way to see who killed the person
or if the knocked them into the void
getKiller
despite the method name, it gets the last player that hurts the entity
might be null
what about if they hurt them like 10 mimnutes before
but what if it's unrelated to their death
what if they got hit by them then 4 minuntes later jumped off a cliff and missed an mlg
you should listen to death events to check the cause of their death
i have the death event
can anyone take a look at #help-server
if death event doesn't work then EntityDamageByEntityEvent
oki
1.18.2 remapped when
👀
how can i detect chorus fruit broken by physics?
BlockPhysicsEvent gets fired even if the chorus fruit block isn't broken
i have to find another way
(Also i have to deal with beds/doors/etc)
can anyone help me? it doesn't say okay
https://srcb.in/CBXMOHzBH3
what is isHealtScaled method?
i have no clue
guys i cant use getAmount on entityregainhealthevent
'runTaskTimer(org.bukkit.plugin.Plugin, long, long)' in 'org.bukkit.scheduler.BukkitRunnable' cannot be applied to '(events.Boomerang, long, long)'
?paste
the error is here
Can someone please explain me how the Spigot Configuration System works? (save, load, MemorySections, usw.)?
Best obfuscator?
None of them
Obfuscators are easily bypassable
Also, you're only allowed to use the obfuscators Spigot permits
Branchlock does good
(if you don't post your plugin on spigot forum)
Any competent reverse-engineer doesn't really have to deal with obfuscation either way.
Just disassemble :)
then md_5 doens't have to force people to use basic obfuscators
obfuscation really matters
No it does not
You give me a premium plugin, I can crack it in a day even with obfuscation
Obfuscation follows "security through obscurity"
Which is one of the weakest forms of security
ok but premium plugins are obfuscated under md_5's restrictions
And, yes he does
i mean under that restrictions i can do that too
Plugins must also be readable by staff to verify that they aren't malicious
you can sell plugins outside spigot forum so
you can use more strong obfuscators
add some sort of "class loading mechanisms"
Oh yeah this is also just a bad idea
If you mean smthn where like
It requests classes from a remote server
If that server ever goes down, that plugin becomes useless
no im talking about plugins that have encrypted real class files in their plugins
Player p = e.getEntity();
if(p.getHealth() < 5 && p.getHealth() > 0.5F) {
p.sendMessage("calisiyo");
p.setWalkSpeed(0.1F);
}
if(p.isDead()) {
p.setWalkSpeed(0);
p.setHealth(0.5F);
}
}```
make item unbreakable only if it is damageable
hey guys im trying to control the situation if the player's health got under 5 but its not working
Well the decryption is somewhere in the plugin too.
Probably in the classloader that loads said encrypted classes
i made a minecraft mod that decrypts itself using their HWID as a encryption/decryption key with ASM
nobody cracked that
HWID?
hardware id
So basically the mod is locked to a single system then? :)
yes
every player get different jar file that was built by a installer/remote server
I have a gut feeling that that is a terrible idea
that depends on purpose
imo all forms of DRM fall short
if you are an opensource contributor you might not have to obfuscate your premium plugin at all
Obfuscators are necessary
Where? lmao
only if your project is big enough and obfuscation/authentication sucks
So your DRM is only strong because not enough smart people are trying to break it?
yes
That isn't strength
that's enough, right?
it'll sure stop the vast majority
also it was strong enough at that moment because it was self-made obfuscators/authenticators and nobody knew how to crack
Again, security through obscurity
i've seen so many projects that have strong obfuscation but have only 1 authentication method that returns boolean
in that case obfuscation doens't matter
No form of obfuscation is strong, still
if they have to spend 30 days for a $20 software to crack, nobody's gonna crack it
and yet obscurity != security 😎
Obfuscation does one thing: Make it harder to read decompiled code
Looking at obfuscated assembly gives you a lot more to work with, as almost all obfuscators use "patterns"
AKA they take something, return an output with X kind of obfuscation
some obfuscation does more than that: class loading, authentication, class decryption, class loading order...
Oh and actually it's still pretty easy to reverse obfuscated names
some sort of drm is better than none
and as long as the drm is creative it's very difficult to trace
For example: A lot of good projects use OOP principles and patterns, these are noticeable.
I mean, if manual deobfuscation wasn't possible, we wouldn't be here today ;)
And, in the modern age, there exist some great tools for this too (i.e. Fabric's remapping toolchain)
I'd like to argue the opposite
why?
it definitely prevents the average joe from straight up selling your work for a discount
Outside of the Minecraft world, there is a lot of proprietary DRM software used to "protect" games from copyright infringement.
Said software is well-known for causing many problems.
Example: Denuvo
Most DRM is intrusive lol
Another example, one I find quite personal: EasyAntiCheat
EAC is not so much DRM
but, y'know, an anticheat
Still, it serves as a bit of a DRM as it stops pirated copies iirc
if they don't know what they are using sure it will happen
Aaaand it breaks most games on Linux
The DRM prevents players from playing the games offline, even if the game is single-player only. If a Denuvo-enabled game's DRM servers are down due to internet outage or a company going bankrupt, the game will become literally unplayable for anyone!
Sounds familiar ;)
that depends on type of DRM
(For the first week)
Any plugin with protection against people stealing it are fairly easy to crack depending on the amount of work
Hell, some games get cracked on their launch day
Eeexactly.
In my opinion, people should contribute their work to open-source and use a "pay for support" sort of model.
(just make obfuscator yourself)
McMMO does this and is a very popular plugin.
iirc Citizens 2 as well
you can sell artifacts of opensource plugins
e. g. Duels ArenaRegen, Citizens
Yeah this too
they are helped by nostalgia
A lot of server owners don't understand build tools
And will just pay to download artifacts
So, here we're relying on a common human trait:
Stupidity ✨
Although it can also just be kindness, if they want to support the dev
can't believe 14,700 ppl have paid $10 for that open-source plugin(maybe less because some ppl must have downloaded more than once)
TL;DR: DRM is dumb and can be broken easily given the right person.
imo people rely too much on obfuscation and such
Some people pay for obfuscators
(And then proceed to use said paid, unsupported obfuscator for Spigot)
(And then get rejected lol)
But whatever I won't stop someone from like, using ProGuard, as long as it doesn't take you a full day to set up
i like proguard
ProGuard is cool
i have this
Proguard is the obfuscation that is the easiest to crack
but i haven't managed to make it work with multiple projects/modules
if you really want to protect your project with proguard, at least you shouldn't make "public booealn authenticate()" method
And plugins are required, by GPL, to be licensed under GPL, which requires you to distribute source if requested
it's not illegal to not accept the request
it only means that they can remove it from the public places
Yeah but you don't want that, do you?
Does plugin really have to be GPL?
i don't think md5 or the resource staff cares
Yeah because Bukkit is licensed under GPL
afterall their license is much worse
If you use Bukkit, you must use GPL
but CraftBukkit is LGPL
complete ownership over anything you post
Either way you're still using Bukkit's code
Annnd I think the original copyright owners can relicense if they want + GPL takes priority over LGPL
This looks like the GPL
Oh that probably means it's dual-licensed or someone forgot to remove one
With dual-licensing you get to pick which license you want to follow
I might have to read Spigot contribution agreement to understand the license
and I forgot where to read
?cla
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
What the CLA does, is instead of licensing your code under [L]GPL, BSD, or whatever other licenses our projects may use, it licenses your code to us instead. This is a good thing, and in implementing it, we hope you will see the benefits behind our key reasons:```
That applies to PRs rather than plugins afaik
so they can license CraftBukkit under LGPL instead of GPL because of the Bukkit contributors gave their rights to Spigot
I still don't believe Bukkit plugins have to be GPL beause it's considered as "dynamic linking"
wait theres an actual source for craftbukkit thats still up to date
This repository doens't contians NMS packages so it's totally allowed, just like paper/purpur/etc
ahh
Imagine caring about this shiy
Probably stupid but is there a way to include a module to compile without actually depending on it
Extremely uninteresting and pointless for me at least
@tender shard did a blog post about GPL
how can i detect chorus fruit broken by physics?
BlockPhysicsEvent gets fired even if the chorus fruit block isn't broken
i have to find another way
(Also i have to deal with beds/doors/etc)
Can some one help me i don't now how titels work anymore beacus i need it to show up on the screen to the player when they join but it don't work tag me pls
Google your question before asking it:
https://www.google.com/
don't find somthing thats not wrong
Actually
i onely find plugins
declaration: package: org.bukkit.entity, interface: Player
@tender shard that isn't how it works, you should let him learn how to use google for basic searches
@eternal needle "How to send a title to a player spigot"
Google that.
If you don't understand what you see in there then ask here
Which is probably due to your lack of java if so but I bet you've already been told that so I guess you don't want to learn it
No spigot dev learned java itself, most of them learned it with spigot, and unsurprisingly all of us recommend not doing what we did / are doing
had put it in the wrong way
norway
Hello can someone tell me whats the best way to remove items from a player?
for example i have a shop where if you buy something it would take 1 of an item in your inventory
You can try mainhand only or scan the inventory contents
player.getInventory().removeItem(item);
if (player.getInventory().containsAtLeast(item, amount))
tried it
only removes specific
Ur shop using chest gui?
no
Sign?
yes
wdym specific?
for example a ItemStack(Material.ironIngot,1)
only looks for a itemstack with 1 quantity and removes that
if you have an item stack with 16 iron ingots it wouldnt take any
Loop the inventory contents if u want, haven't tried #removeItem but I guess u can check it out it may have overloaded methods ig
it worked with me
I moved my project to 1.18.1, and it states that ItemStack is deprecated.
send code maybe?
i might just be using it wrong
What do I use in replacement?
Are you using paper?
Spigot
It might just be the application im using however
API version: 1.18
Yea
hey when making custom crafting recipes how do you add custom materials?
Nice
thanks
Thats a mod thing usually.
Try making a mod instead possibly?
so it wont work on spigot
You could make a pre-exsisting item with custom metadata
or custom model
ohhh ok so if i just add the custom model data it will work?
and when you make a recipe make it so it checks for the custom metadata tags or whatever
you cannot create custom materials
Hi, I've this event and this code for canceling picking up a item in inventory, but there is a problem, when player pickups the item for first time, plugin cancels, in second time plugin does nothing, and 3th time cancels 4th does nothing and to the end ..., where is the problem ?
give it custom data and make the recipe check for custom data
what itemstack is that?
its a custom class, forgot that
item stack is 1 thing at all
ItemBuilder gets the name and lore ... from the config
and gives me a item stack
you know about private right?
huh
idk
time to buy new pc
ITS A 2 THOUSAND DOLLAR GAMING PC HOW
Sounds like cap
not cap ill send the specs
Did you buy a 1600 dollar case?
hell no
oh.
its cause it was generating the terrain n shit
its fine now
8 gb mem for a 2k dollar budget?
@quaint mantle is ur pc lower than me ?
check the screen shots
.
nope id rather buy an actual mc server
how can you open intelij on that
then deal with my cpu killing itself
impressive
disabling 80% of useless addons
my i3 laptop cant open lol
i have all the addons on lol
i can use intelJ fine
thats the weird thing
1.18.1 server however
kills my pc
for some reason
disable addons u don't know what is that or ur sure u don't need that
i refuse to believe this pc cost you 2k
i jus have to use my PC it iz good r5 3500x
wops. wrong reply
low spec programmer lol
lol
whats sad is that a 1.12.2 server was completely fine
yet this isnt
what logic is that
yes, i'm codding on a 1.8.8 plugin, server is 1.8.8 but minecraft is 1.12.2
the logic is that the game has more features
im buying a mc server
i cant deal with this
shockbyte is cheap and it works fast
how do i remove all types of an item from the floor
its pretty usefull to have at least 16gb ram for developing too
What do you mean "all types of an item"
Do you mean all items of a certain type?
I recommend u to get a linux vps, running a server and use RUoDeT
RUoDeT is a java program automaticly grabs the .jar file on project build and uploads to ur server, then use BileTools for automatic plugin reload too
yes
yea but it is still hard to open multiple instances of Minecraft with that
i can barely open 4
which is why i have 32
i commonly run 3 servers too
world.getEntities().stream().filter(e -> e instanceof Item).map(Item.class::cast).filter(i -> i.getType() == Material.SOME_TYPE).forEach(Item::remove)

