#help-development
1 messages ยท Page 225 of 1
If you work on programming must alrdaus have dmca without paid without getting money. Because once smth happen you can win
but they have proper budgets n all
they can afford everyone there
and have always paid them
Like our particle developer does VFX work for marvel n all
that doesn't come cheap
In my case Im paying dmca but i havent done so much money this month, but im sure that if something happen I will get the money
I dont care loding money with dmca because un the worst he will be with me
๐
Also imagine
this mf talking about DMCAs like they're ICAs
Oh my bad
Here there is smth like dmca but you pay and you are protected by law when talks about in terms of your projects and things you sell digital or physic
you must be thinking of something different
Of course you must be associated with them and pay smth like 30$ each year
in the US, copyright protections are free
Oh I dont know uderstnaf how they work
Because how they would know you really own that resource
And you are not lying cuz
imagine being american lol
Also in the other hand dmca takes a small a out of money when they help you to win
whoever can prove earliest form of work. Github is really good for this ๐
I mean the problem is thst you cannot apply dmca by self
What do you mean?
Because you have 0,01% probabity win ing while github could have +80, 8%
Do I explain?
idk what you are talking about
he is the law
Dmca doesnt apply the same when its used by personal nor big companies
Thst is wha ti want to mean
DMCA applies equally
In the us!
Outside doesnt really apply equally
Cuz us doesnt have rights over other xountries law
There is the trixk
They do when the Countries sign provisions to join together for copyright protections, which there is quite a lot of countries that have signed an international copyright agreement
But keep believing this until you end up on the US's radar. If the US wants to extradite someone they will eventually get you lmao
Im not talking to just to talk im talking with Arguments which were told and explained by a really important lawyer and specifictly talked about programming restrictivos
well sounds like whatever country you are from doesn't really like copyright protections
I dont think imagine how many time they took to extraditate Mac Fee, Chapo Guzmรกn (big drug seller)
๐
Verano where u frome
Pocitos, Montevideo, Uy
Tell me if need to be more specific
I can provide the address so if you want
Is Uy Uruguay or sum
Spain granted the extradition for John McaFee and El Chapo was extradited as well, not sure what you are trying to say other then time? Yeah the US has the resources to wait lol
That was my xounter argument tho but he seens not to listen to it
Also India has no Copyright system and China has it's own which you have to specifically register on and they don;t recognize copyright thats not registered with them
Classic China momwnt
George Bridi
anyone else want to claim the US doesn't extradite over copyright? lol
Richard O'Dwyer is another, however in leu of being extradited he instead paid a fine and was on probation however had he not agreed to that he would have been extradited
Hew Raymond Griffiths
George Bridi was not extradited over copyright. That was ONE of the charges but it was wire fraud which allowed for extraditionGeorge Bridi, a 52-year-old British national originally from Ghana, was arrested in Cyprus in August 2020 on an international warrant with multiple charges including copyright infringement and wire fraud.
Still was extradited for it
if wire fraud wasn't on there, they would have still extradited for it
No thats the point, thats not why he was extradited
Copyright is a civil matter and not extraditable, as far as I know
it is
should read international laws a bit more
telling me Griffiths wasn't extradited from Australia ?
to the US
for copyright infringement?
For extradition from the UK it has to be a criminal act, so it has to have a commercial component, ie they made money selling a copyrighted item.
if there is no commercial component it's only a civil matter and does not warrant extradition
ah right, that is why Richard O'Dwyer was being extradited unless they paid a fine
yep
must been made up
Anyways keep believing the US doesn't extradite for Copyright Infringement ๐
Not on copyright alone
yes on copyright alone
no
Griffiths was Extradited on nothing but that
Hew Raymond Griffiths (born 8 November 1962, UK) has been accused by the United States of being a ring leader of DrinkOrDie or DOD, an underground software infringement network, using the online identity of "Bandido". Griffiths was living in Berkeley Vale in the Central Coast Region of NSW, Australia before he was placed on remand at Silverwater...
Anything to say on this? In Australia it wasn't a criminal act
but hey, still served 51 months in prison plus 3 years in Australian jail
Yep, a very controversial extradition
still happened
Yes it did, a one in a million
as I said, US extradites for copyright infringement
One which shoudl not have actually happened if the actual extradition laws were correctly applied
they were
No they were not, it was a specific agreement between AU ans US
under international extradition law it must be a crimial act to warrant extradition
in Australia copyright infringement is a criminal act
is it? Not here in the UK
anyways whether it is classified criminal or not isn't even part of the international law
just that you can be punished with a 1 year jail sentence in both countries
is enough for to be valid for extraditable offense
https://www.gov.uk/guidance/extradition-processes-and-reviewincluding, in almost all cases, the requirement that the conduct would amount to a criminal offence were it to have occurred in the UK, and minimum levels of severity of punishment
Even if you made ยฃ1 it becomes criminal
but on Copyright alone its not extraditable from the UK
This is why they always tack on other criminal charges to make it extraditable
even if they drop those charges later
ok that doesn't mean the US doesn't extradite for copyright infringement
um, thats exactly what it is
from the UK sure might not be enough alone, but that doesn't mean it doesn't happen elsewhere
they ensure at least ONE charge is criminal so they can extradite on that alone.
depends on the country being extradited from
I am not talking about the UK specifically
you are the one trying to say it never happens at all anywhere which I have shown it obviously has happened
Then its pot luck, your experience may vary
is there anyway to do smth like Location.add() but wihtout modifying the original location
clone it
question
I have a org.bukkit.entity.Player
how can I convert it into a net.minecraft.world.entity.player.Player
ask?
isnt that just CraftPlayer::getHandle?
cast it to the craftbukkit player and get the handle
If im not wrong you have to cast it from CraftPlayer to Player
๐
cast to CraftPlayer and getHandle()
((CraftPlayer)player).getHandle()
i need that
thats sick
why does it work both ways ๐ค
Its mostly used in Spain for windows
So they can be opened in diff positions
Sorryf or ping zacken ๐ ๐
also question: how can I set the tags?
I just realize i tag you
who
?whereami
yo ur in spigotmc yeha
Spigot != Paper
yo udidng ping zackbe
what tags
jezus my spellih
it works with spigot too ๐
He has paper, he must ask on their support
stfu
HMN
yes
I can see
nms != api
the question was abt nms player rigth
nah
But i just remember that CraftBukkit is the thing that works over minecraft sever making relections
its the implementation of the bukkit api over the minecraft server
bukkit doesnt do shit by itself
its all interfaces
almost
So let say, bukkit itself its an api
api: bukkit <- spigot api
impl: minecraft <- craftbukkit <- spigot
hmnn
spigot server is a fork of craftbukkit
Bukkit: bukkit api -> bukkit core -> CraftBukkit -> minecraft
Spigot: spigot api -> spigot core -> bukkit core -> CraftBukkit -> minecraft
there should be -> minecraft at the end
Because CraftBukkit is not an impl of minecraftr sever, cuz its obfucated
no CraftBukkit is sort of a fork of the official mojang minecraft server
so yes
i guess
Wait no
craftbukkit isn't obfuscated
i was talking about minecraft sever which is obf
I mean i bad written what i mean
i was saying that CraftBukkit is not an implementation of minecraft server because mc server is obf
just because it is obfuscated doesn't mean it can't be implemented
Craftbukkit just does so without deobfuscating
Anyways, Craftbukkit is an implementation of the vanilla server
since it adds its own code on top of vanilla
Paper is a modification of spigot using spigot as a base for its plugin API with fixes implemented
Hii, do someone know how to make in java something like add max hp? No set but add.
if u know how i mean it..
question: how can I store persistent data on the player
do you just not read documentation?
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
when it comes to NMS you are for the most part on your own. Need to go learn NBT
I have items figured out
not sure what I said has to do with items
reason I want to set data on the players NBT is simple: I need to somehow read data on the client
you won't read data on the client that way
its for a thing where moderators can see custom popups when a player swears
you are limited to packets and that is whatever the client sends via packets
Which is certainly not the entire entities compound Tag unless I am tripping
?
also how can I send a packet to the client to check if the mod is installed, without making the client go disconnect
spigot doesn't support mods
and there is no packet from the mc protocol for such things either
Plugin Message channel alone won't tell you mods though and even if it does, it is only if the mod self reports
Mods can send pretty arbitrary data over ehhh- what's the name of the packet
Yea
But that is what they want right ?
Communicate with their mod
To show their moderation popups
I suppose that may work
It is a bit of a mess with registering channels
But certainly possible
No idea what those clients do, I don't use them ๐
Presumably they announce themselves then
Easily preventable if you want tho
Choco's veinminer plugin has a mod for doing a custom keybind, I use that as an example when I'm remembering how to do it myself
question: is it possible to merge NBT when a player tries to combine items?
Hi, im again having problem with my wand and region system. Last time i asked i was having problem with the wand system which was allowing me to break do actions while i was claiming (break, place, interact, drop, etc). But now im experimenting another problem which in theory should allow the player to do actions while you are inside a claim. But from what i have tested its not allowing you do to that
Yes
?justask @sterile token
I didnt i ask?
What could be the posible cause? Because i have already check my cuboid class and the designed is okay
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Never said not working
LMAO
BRUH If you wont help just dont answer
There was not a ?nocode
I need code and explanation of what you expect.
Not just some random stuff about how it should work and everything is perfect. If it is not working clearly something is wrong.
ok
So let me refactor
I mean its something between the WandListener and RegionListener
Because before i add the Wand system for claiming, everything was okay
No clue what those are.
Let me send my code 1m please
https://paste.md-5.net/icagaximur.java - My wand listener which takes about the item for claiming specific regions
https://paste.md-5.net/haceyiduyi.java - My region listener which care about the region actions itself
So before i add the wand listener i already tested the cuboid class to see if it was working correctly and the result was the one expected. So that is not issue here. Also the cuboid just for letting you know is an utility class which i use for coding on 1.13
The cuboid, wand and region all separated
What was the result of your debugging?
the 3 of them were successfully alone
What would be your next step in debugging then?
But when i put them together the problem started haha. The main one is that while you are a member of a claim you should be able to do actions which is not happening
Then debug each if statement in your code that checks if they're members and allowed to build.
This the wand and cuboid debug
Your issue is the building right?
Debug your listeners in the RegionListener class
Do they run?
Do they pass the ifs? (By pass do the ifs return properly)
The issue are the actions, yeah building
I have divided the logic into Region (name, cuboid, list of member) and Cuboid (max and min locations)
So far what happen is that being member of claim right? Doesnt allow to build
Have you seen my code?
Yes
I have been trying hours this
Annd i still cannot find it by debbugging my self
If not i wouldnt come to ask smth simple like this
Have u tried the good old printout everywhere it calls to and see what it does wrong?
yeah, that is what its called debug or primary debug
Its the first you do when smth is not working
So what was the results.
Where did it fail?
which part of it failed
if you debugged it you would have checked each section and part of it.
It doesnt fail in any part
Then it works.
No
Then it fails at some part.
So it runs everything properly in there?
Wait wait
Oh no it shouldnt fail on wand listener cuz it returns when he is not claiming
You've checked it returns the proper things here right?
Region region = this.regions.getRegion(profile.getUuid());
if (region != null && region.getCuboid().contains(block.getLocation())) return;
No im an idiot sorry
Sorry bro that problem went off
Now the issue is different, its allow me to do actions outside the region
๐คก
Its really trolling to test mc code
Hello, how I can print text in subtitle bar?
what mc version
is the server
1.16.5
By subtitle bar do you mean actionbar
yes
actionbar or title both of them are good
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
thank you
i have location1 and location2, i need to figure out how to move from 1 to 2 with relative movement type in (byte)
with a relative velocity?
PacketPlayOutEntity.PacketPlayOutRelEntityMove packet
protocol wiki says i have to Change in X position as (currentX * 32 - prevX * 32) * 128
but im not sure if it is
and dont know how to do it
i get values in double, how should i preperly turn it to byte ?
i tried just (byte)(currX-prevX), but its toomuch already
this thing "PacketPlayOutEntity.PacketPlayOutRelEntityMove" askes me for (byte), not for shorts
the bytes are used for rotation
(int entityId, short deltaX, short deltaY, short deltaZ, byte yaw, byte pitch, boolean onGround)
the other one is just for rotation
defined as (int entityId, byte yaw, byte pitch, boolean onGround)
or you can make the full packet
with
(int entityId, short deltaX, short deltaY, short deltaZ, byte yaw, byte pitch, boolean onGround, boolean rotate, boolean positionChanged)
Can anyone help me with a plugin that won't work? The problem has to do with the plugin.yml
These are the errors in the console:
Could not load 'plugins\CreeperSpawn.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
(*if you're using Maven or Gradle)
Maven on eclipse
Yeah, so you should have a src/main/java and src/main/resources directory structure
plugin.yml goes in the src/main/resources
Not verified? Upload screenshots here: https://prnt.sc/
nope, its:
public PacketPlayOutRelEntityMove(int var1, byte var2, byte var3, byte var4, boolean var5) {
mby it bcs i just use 1.8.8 NMS
@tardy delta
How is it you're building/exporting your project?
Also, TIL Eclipse's Outline view shows YAML outline. Had no idea lol
Me?
Yes
I added the spigot archived libraries to POM
He wants to know how you are getting a jar. What are you pressing
Yeah but to turn your project into a .jar file. How is it you do that?
Export > jar file > finish
Yeah, so with Maven and Gradle you do things a bit differently
You'll have to setup a build profile
It'll open a wizard for you. In the "goals" line, write "clean package", then hit run
Then you can re-use that build
What is the difference between 1,2,3,etc maven build?
The options in my screenshot you mean? Just different default ways to run your build is all
I got a "BUILD FAILURE"
error: invalid target release: 18
It doesn't know what release 18 is. What does your pom.xml look like?
Oh wait no, nevermind
Open up your build config.
Make sure you have the correct JRE set
lol hiding ๐
It's work projects, I have to lol
So I've got a question I keep trying to call
private val manager: ScoreboardManager = Bukkit.getServer().scoreboardManager
and it keeps returning an error java.lang.NullPointerExceptiongetServer().scoreboardManager must not be null
It's null in onEnable()
Oh right, contracts are like that hahaha
Where is this option?
Click the down arrow next to the Play button at the top
I guess Eclipse doesn't make that super clear heh
Was that referring to me?
How I do know what the correct one is?
The only option for me is "jre"
Whatever you named it. It defaults to your project name
Oh, you mean the JRE stuff
You should have Java 18 installed on your computer somewhere. If so, you can point to it in Execution Environment. Or (and imo the better approach) you can setup an execution environment under Window -> Preferences... -> Java -> Installed JREs
Should I change my load up method to Post world then?
No you can just schedule a task
Bukkit.getScheduler().runTask(this, () -> { /* Do your scoreboard stuff in here */ });
Hey there. (Apologies for the long message, but I figured it best to include lots of detail).
I want some advice on how to pass large amounts of data in ArrayList<ComplicatedClass> to a BukkitRunnable for saving its contents to a file.
In this use-case the file I want to write out to is a .csv , but this won't always be the case...
In my ComplicatedClass I have a method:
public String getCSVLine() {
return String.format("%s,%s,%d,%s", this.getA(), this.getB(), this.getC(), etc);
}
When the functionality to save the ArrayList<ComplicatedClass> is invoked, I do something like:
public void save(String fileName) {
// Loop through each item and add it to the list as a csv string line.
List<String> csvList = new ArrayList();
for (ComplicatedClass c : this.complicatedClassList) {
csvList.add(c.getCSVLine());
}
// Start async, passing the string list.
new SaveComplicatedClassListRunnable(this.plugin, fileName, csvList);
this.runnable.runTaskAsynchronously(this.plugin);
}
The BukkitRunnable extending class then does:
@Override
public void run() {
BufferedWriter bw= new BufferedWriter(new FileWriter(this.fileName));
// Loop through passed ArrayList and write each String.
Bukkit.getScheduler().runTask(this.plugin, () -> { // Callback });
}
I find this implementation easy to understand, but I acknowledge that it's only simple because I'm using a .csv file.
Q1). Is this actually thread-safe?
Q2). What are the caveats of this design?
Q3). What are my other options?
(I've looked into cloning, serialization / deserialization and deep-copies, but don't quite understand what I actually have to do...)
@worldly ingot would changing plugin loadup to POSTWORLD do the same
POSTWORLD is default, so no
I have it set to STARTUP
Oh
What do I do in "installed JREs"
You have to add a new entry and point it to your JDK installation
Wherever it is on your local computer
This is one of my JDKs for example
(the checked one is the default by the way)
I don't have any jdks only one jre option
How many do you mean by "large"? If <10000 then it might be better to just do it in sync, can't answer your other questions though. If writing to file is for data storage purposes, then look into sqlite perhabs
And I don't know what either means tbh
A JRE is fine if you have one. Mine just happen to be JDKs
As long as you have some version of Java installed
If you're writing against Java 18, I'd like to hope you have Java 18 actually installed on your computer
The default install path is under C:\Program Files\ usually
Then depending on the distribution under either Java, Oracle, OpenJDK, AdoptOpenJDK, etc.
So I would add both of those (just so you have them readily available), but you can really only run Maven using Java 16, so that's the highest version you can support atm
If you want to be able to build for Java 18, you'll have to install it too using the link I sent above, add that as an Installed JRE, then update your Maven build config
What is the difference?
Well plugins depending on Bukkit can, in theory, be compiled against Java 8. So that's fine if you want to do that. Though Minecraft 1.17 forces servers to be run on at least 17, so you can use those features if you so choose
Uhh
Basically you can compile your project against any version between Java 8 - 19, depending on which features you want to use. However it's worth keeping in mind that whatever your plugin is compiled against will be the minimum version the server will require to use it
I would personally compile against Java 17
I am looking to code in minecraft version 1.19.2
Yeah so Java 17 is fine
And I have 16 atm?
Correct
You can definitely compile against 16 if you want though! You'll just have to edit your pom.xml to use release 16 instead
The differences between 16 and 18 are pretty miniscule so you won't be missing out on anything
Somewhere in your pom.xml you probably have <release>18</release> and <target>18</target>
Or maybe <maven.compiler.source>18</maven.compiler.source>
Once you have that changed, same process as above (only for Java 16 instead of 18)
See my config above as an example
I have this?
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>18</source>
<target>18</target>
</configuration>
, update those 18s to 16s
im using bukkit runnable in a gui, when a player clicks an item, it runs. how can i make it stop running when the player clicks other item?
Okay BUILD SUCCESS now you said don't export to get the jar?
Or now I can
Oh wait nvm
Yes, so now that itโs built, you should find it under your project directoryโs target/ folder
C:/Path/to/your/project/target/ThePlugin.jar
Thatโs how youโll build and export your project with maven from this point on
I ended up finding it and the yml issue is fixed, thank you. Now the command just doesn't work tho but I'll see if I can fix it.
Sounds good ๐ glad you got it sorted
Why do ppl still use eclipse ๐ . I think they should heavly move from there and give a try to Intellij
Minumum effort
You're the clown why do you care?
I really prefer suffering with Ram using Intellij than suffering about dirty Eclipse interface
๐คฃ
But as Zacken says, they are just preferences
yes
yes
PlayerDeathEvent()#getKiller()#getInventory() if you want the full items
Im not sure if its called getKiller(), i just remember that the getEntity() returns the killed player
What's the easiest way to get the players cardinal facing direction?
i.e the opposite direction an orientable block would face if it were placed by the player
Entity#getKiller(), so event.getPlayer().getKiller(). Though that can be null
Entity#getFacing()
if you want the opposite, entity.getFacing().getOpposite();
it does but how can i check if THAT item killed a player?
i mean he can hold something different but killed him with bow or something
getItemInMainHand() will always be the item they killed them with, unless it's a bow. That's significantly harder to track because that information is lost
There's a reason bows don't support looting ;p
If you want to track the bow used if killed by a projectile, you will have to do that tracking yourself by recording what item was used from an EntityShootBowEvent
okay so itemInHand is in most cased the kill item?
Yeah
can i check if the display name got changed with anvil or something?
But for getting that item dont get it from PlayerDeathEvent#getEntity() cuz it will return the main hand item of the killedp layer
I think that when you change it thru anvil, its just update the ItemStack name - Im not sure tho
Im not sure, i just know Item names and lores are stored as TextComponent
Is it possible to send an email from alias email using the Java mailing API?
example:
Main email (non alias): josh@johnson.com
Alias (The one i want it[the message] to be sent from): joe@johnson.com
Does anyone have an idea how to make a plug in which makes the player take no damage when he wears a full set of armor with protection 4 on it? The important thing is that he still loses durability of his armor but shouldn't take real damage as long as no piece breaks.
first you check whether the player has all prot 4
if yes => decrease durability of armour and cancel fall damage.
you can achieve that by doing EntityDamageEvent => check if the damaged entity is player => check if all armor pieces have prot 4 and if they even have the armor pieces=> if yes, cancel fall damage and decrease durability of armour.
@quaint mantle do you need pseudo code?
Not my video nor my music all link in here
Remastered Version: https://youtu.be/U7lxnJVAlQE
Music โ
https://youtu.be/aHnaBbLKEww
(Hopefully this link is enough.)
Thanks man but maybe i explained one thing a bit bad. Of course he shouldn't take fall damage too but the important thing is that he doesn't get damaged when another player or entity hits him. I mean its pretty much equal to what resistance potion effect does. It prevents the player from getting damaged in form of hearts but he is still losing durability during fighting. So the idea is that not hearts are relevant in pvp, but the durability the armor has.
oh well then take out the fall damage part
Would be pretty nice of you.
okay. do you know how to convert it to normal code?
I don't
class SomeClass implements Listener {
@EventHandler
public void onDamage(EntityDamageEvent event) {
if (event.getEntity() instanceof Player player) {
if (player.getInventory().getHelmet != null && player.getInventory().getChestplate != null player.getInventory().getLeggingst != null
&& player.getInventory().getBoots != null) {
if (player all armor slots have prot 4 (not hard to tell, check some tutorial)) {
event.setCancelled(true);
}
}
}
}
}
ik it can be better
i just wanna sleep
its 11pm
Thanks
Isnt possible to do? if (Player#getInventory()#getArmorContents()#length !=4) return; instead of checking them manually?
yeah probably
I think its much eff than checking if contain manually the properties
But you are on cellphone so much you cannot do
Somebody can help me with registerEvents?
public class YourListenerName implements Listener {
@EventHandler
public void onDamage(EntityDamageEvent event) {
if (!(event.getEntity() instanceof Player player)) return;
if (player.getInventory().getArmorContents().length != 4) return;
event.setCancelled(true);
}
}
What do you need specific?
YES
Its well explained on the events page
dont be rude please๐
Probably going to get a ?tryit but wouldn't this return something like BlockFace.EAST_SOUTH_EAST if I wasn't looking directly EAST?
When I register the event, the plugin it doesn't see
i think its like this no?
Hmnn, cant you explain more?
My question might have been unclear
I want to get the cardinal direction the player is facing
I dont understand phrase
Can you text in DM?
did you implement listener
yes
yes
?paste
how can i send it? xd
Ok, I pasted the code
Pretty sure the player's armor contents is always a length of 4, it will just contain an air itemstack or null or something otherwise
maybe
You open the url and paste the code there
Press ctrl + s
copy the generated url
send it on the channel
Here is it
Can i send picture what the package structure?
Main or JoinEvent class?
JoinEvent
?paste
**JoinEvent
https://paste.md-5.net/iqasayebic.java
pls help
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
For none programming realted questions please move to #help-server - Thanks
appears so
what?
So just dont disturb in other channels
And wait patientlly
armor contents size?
The problem was solved, thanks!!!
i just got curious and wanted to look, lol
if need things fast just give your ... and you will have everything fast
yeah im tired of none imptaient ppl
With other words if need things fast just put money or paying someone to fix it fast
you related to smth else hahaha
no becuase they can be null yet the length is stil l4
Is here an event to disable chickens spawning from eggs?
EntitySpawnEvent I believe
yeah thatll do it
the egg spawning fires that event
Yo would you explain a bit what that length! =4 does and what i have to fill the bracket behind getarmorcontents with?
that would be the CreatureSpawnEvent, the EntitySpawnEvent is what you need since dropped items are entities too
It works great. Thanks :D
basically I used EntitySpawnEvent, checked if entity is chicken, and just cancelled the event
it all is only because of one cosmetic haha
oh tbh i read that entirely wrong, I thought you wanted to prevent chickens from spawning eggs
but its the same thing
youd need SpawnReason too
Is it a thing?
Good to know ๐น
@EventHandler
public void chickenSpawn(EntitySpawnEvent e) {
if (e.getEntity().getType().equals(EntityType.CHICKEN)) {
e.setCancelled(true);
}
}
this code perfectly does btw
yes, just check if the CreatureSpawnEvent.getSpawnReason() == CreatureSpawnEvent.SpawnReason.EGG
this would prevent chickens from spawning in any case
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html
declaration: package: org.bukkit.event.entity, class: CreatureSpawnEvent, enum: SpawnReason
I know.
But a KitPvP server doesn't needs chickens anyway
yeah you are right
Basically the cosmetic that would've made it possible to spawn chickens is something like... a kill effect... If it is active, and you kill someone, eggs will spawn in a cube sphere above you, and so yes.. xd
However there is a rank that has eggs replaced to snowballs
1st programming rule: if it works, don't touch it
since it works, I won't touch it
no, since the thing that matters is that if it works
someone have a tutorial that explains how to get user input from sign via packets? (with nms)
thats a really really dumb thought process
for something that simple sure, but as you scale just do the right thing get in the habbit of doing it even for small tasks
Somebody know how I could enable fly for everyone (also in survival mode) when he joins the server?
I don't really care. The only thing I care about is that it needs to work.
i imported the fresh build spigot.jar with buildtools compileOnly files('libs/spigot-1.19.2.jar') in gradle but i cant use nms? why?
did you run build tools for nms
Use Paperweight for nms with gradle or use maven
See the paperweight test plugin for example usage
I am trying to remove a certain number of items in someone's inventory with this line:
player.getInventory().removeItem(getItem(new ItemStack(Material.GOLD_BLOCK, i3 * 64), "ยง6Compressed Nether Gold"));
but when I do, it does not remove any items. I am for sure that the block I want to remove is in my inventory and i3 is for sure equal to 1 even though no items are removed from my inventory. The picture is the item I have in my inventory that it removes nothing of. I have 74 of them in my inventory. Anyone know why?
Will mushroom block data be reset as soon as the block is updated?
If so, what's the best way around this
iirc an ItemStack can only be 64 maximum for it to register
the 74 items are in 2 stacks
the item stack you are removing unless i3 is1
will be over 64
so probably wont work
!paste
xd
whats the prefix
?paste
thanks
np
https://paste.md-5.net/vewusesulo.bash why tf is JavaPlugin#getPlugin() returning the wrong class and throwing this error (both plugins are mine)
getter inside CommandAPI:
public static CommandAPI getPlugin() {
return getPlugin(CommandAPI.class);
}
getter inside the other plugin depending on CommandAPI
public static EvolvedPrison getPlugin() {
return getPlugin(EvolvedPrison.class);
}
Static ๐คข
The error is okay tho
a method to register commands is called inside EvolvedPrison and that method invokes getPlugin in the CommandAPI plugin
You cannot cast EvolvedPrison to CommandAPI
classes extending JavaPlugin are singletons
Because EvolvedPrison is not an implementation of CommandAPI or backwards
i am not casting EvolvedPrison to CommandAPI, spigot's getPlugin method is
Hmnn
Send your full code please
for some weird reason, CommandAPI's classloader holds the wrong JavaPlugin instance
well i can send spigot's code i gues
what contains CommandAPI?
because something's going wrong there
package me.kill05.commandapi;
import org.bukkit.plugin.java.JavaPlugin;
public final class CommandAPI extends JavaPlugin {
private CommandManager commandManager;
@Override
public void onEnable() {
this.commandManager = new CommandManager(this);
}
@Override
public void onDisable() {
commandManager.unregisterCommands();
}
public static CommandAPI getPlugin() {
return getPlugin(CommandAPI.class);
}
public static CommandManager getCommandManager() {
return getPlugin().commandManager;
}
}
mans got a whole plugin just to wrap 1 class
just do what most sensible servers do
have a core with the most commonly used utils
like fake entities, commands, guis, listeners n all
and then all other plugins depend on the core
it used to be a plugin with more stuff inside, i've extrapolated the module
Core might be singleton, in some companies
I would use:
CommandAPI command = (CommandAPI) getServer().getPluginManager().getPlugin("CommandAPI");
command.noneStaticMethods();
that's what i'm doing anyways but the issue right now is not about my server's internal design
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
im against static
He must use this in that case
getServer().getPluginCommand("mycommand").setExecutor(new CommandClassName(this));
if you want i can send you more of my code so you'll see why i'm using statics in this specific case
and anyways i'm registering commands by putting them in the commandmap so that's irrelevant
Please dont use static, just use DI
public class CommandClassName implements CommandExecutor {
private final MainClassName plugin;
public CommandClassName(MainClassName plugin) {
this.plugin = plugin;
}
}
```'
oh lol
didnt see that
it doesn't really show in the code so that's fine
CommandAPI command = (CommandAPI) getServer().getPluginManager().getPlugin("CommandAPI");
command.noneStaticMethods();
this is how you handle static at work
kill05 its a bit weird
lol discord doesn't like pngs apparently
yikes i realize
but like, you made sure the classes are loaded by the right class loaders?
I thought it was my pc
just can you stop making assumptions about my code and can anyone actually focus on the issue
well i'm not doing anything weird to load them
Di please
not sure what you mean by that
cz like, JavaPlugin::getPlugin basically takes the class loader and retrieves the plugin instance associated with given class loader
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Read about DI please
Its not really diff
and then performs a cast also via Class::cast
yeah i've read the code and i have no idea why the classloader has the wrong instance
that's getProvidingPlugin pretty sure
di would only work if they didnt register via cmd map
Or either use what i tell him many times
both are
4th i sent it
are you fucking done
how am i supposed to DI from a plugin to another
Dont need to use static
Just follow what i tell you
5th time in a row
That is what spigot api provide to get a plugin instance from anothe rplugin
There is no need to use static
okay do what like more i will leave it here ๐
basically what i'm getting from this is that the PluginClassLoader associated with CommandAPI holds EvolvedPrison's instance in the plugin field
quick question, how does essentialsx support multible minecraft versions
building for lower versions
nms stuff by checking versions so triggering different classes probably
thanks
can i somehow get a custom head in my plugin?
what type of custom head
if i have a list like this: ObjectA, ObjectB, ObjectC
and i get ObjectA from the list somewhere and change a value in it, is it changed for the ObjectA in the list too?
in most cases yes since objects themselves are not stored in the list rather just the reference
and
if i have a class with a list and i get it with something like getList() (returnst the raw list) and i run something with removeIf() the list is updated too?
Yes.
is anyone good with oracle cloud?
I kinda need sum help
Basically how do I store my server in a block volume instead of a boot volume?
(Extra storage)
by not using oracle /s
Is it a VM with an OS or something else?
Linux, Ubuntu
VM
Yea
It has a block + boot volume attached
But how do I store the actual minecraft stuff on the block volume
so this would work?
df should tell you where it's mounted
df?
k
No need for the return
oh
Also whereever the get members is you should add a removemembers
but
sda2 perhaps?
da fuq
talking bout linux
should i remove whole class now? Lmfao
mb
thx
does oracle docs say it gets mounted automatically? You might need to mount it yourself
I already mounted hte block volume manualy
Still think a HashMap would work way better.
u thin hashmap better than list?
Idk how to move the stuff doe
Considering you're removing based on ID I assume a clan member must be a unique individual
Sometimes it does sometimes it doesn't for me it didn't so I had to attach it manually
mounted or attached?
I attached it
cause you might need to mount it
uh ok
Oracle docs says you do
Linux Instance Tutorial. Learn how to create, attach, and mount a block volume to your instance.
its already mounted
lmao
as well
Disk /dev/sdb: 150 GiB, 161061273600 bytes, 314572800 sectors
Disk model: BlockVolume
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
where is it mounted to?
that's the disk not the mount point
df shows you mounted partitions
So how do I find where its mounted
Hey, just a simple question.
How do I get for example imports like net.minecraft.server.<version lets say>.Entity ?
Cant find a way for it to work ๐
Also, the same with craftbukkit, I need CraftWorld import, cant find how do I do the import for lets say import org.bukkit.craftbukkit.<version>.CraftWorld
It's quite simple questions, but cant find the way to make it work :/
/dev/sdb
its mounted
You need to depend directly on spigot rather than the API
where
Filesystem 1K-blocks Used Available Use% Mounted on
udev 12247496 0 12247496 0% /dev
What do you mean by that? ๐ฅถ
that's udev not /dev/sdb
Filesystem 1K-blocks Used Available Use% Mounted on
udev 12247496 0 12247496 0% /dev
I ran df on /dev/sdb
if it doesn't show up in df it's not mounted
You need to go to your maven deps and remove the -api from the dependency for spigot. If you haven't already, run buildtools for the version you're using.
I did run the buildtools, added the jar file in project structure from BuildTools, but didnt work
use maven or gradle
I use maven
hey all! I am looking for a spigot plugin developer for my server, if this interests anyone please reach out to me and be prepared to show off some of your work!
?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/
ah thankyou!
Will try, appreciate it
Basically with this my org.bukkit.craftbukkit.v1_19_R1.CraftWorld started working, but I still can't get net.minecraft.server.<version> imports to work with any dep I use:/
Loving java errors, every time they are more and more descriptive "Caused by: java.lang.LinkageError: loading constraint violation"
Nah forget what i have said the plugin was stupid hahaha
How do I control particles so that they don't just burst?
Can you elaborate more?
Alright, so this is my code:
player.spawnParticle(Particle.SQUID_INK, player.getLocation(), 200, 0,0,0, 5);
And I want the particle to not burst I'll send a video of how I need the particles to act
explain more what do oyu mean by burst?
It doesnt even have a translation tho
burst as in break/disappear?
More like explode
It did last time I did it 0,1,0,
Do you want there to constantly be particles?
I dont know, its your question
^ this is how I want them to be
hahaha that why i stopped answering
Because i dont think he is being really explainfully
The video is still processing
dont join it ill steal ur credentials, its basic from intenet
this is the video
Thanks
To me they look like they are bursting in this video
hat the heck is burst so?
Uh no I'm not
because any particle is designed to go to place via code
Making ref that you can do lot of things with code
I don't think you get what I'm trying to say, thanks for your time I guess.
yeah is what im saying to you - hahhaa
How can i replace a word in a string? For example, replacing just the name of the player in a death message.
string.replace
But how do i get the string to replace? its a player name so it changes
In the event the death message is sent, can you get the player name from somewhere else?
message.replace("thingtoreplace", player.getName())
oh didnt think of that, thx
how do we get ServerPlayer without using the CraftPlayer from using the mojand mappings <classifier>remapped-mojang</classifier>
when i try using the mojang mappings, for NMS
i get the error
Unresolved dependency: 'org.spigotmc:spigot-api:jar:1.19.2-R0.1-SNAPSHOT'
remove the -api
from artifact id?
ye
got more errors now
have you ran buildtools
i dont think so
?bt
may i know what that is?
it builds spigot and creates the stuff to use nms
ok
Hey guys, can I add the enchant of drop item? ( version on 1.19.2)
its been going on for a while now
its downloading lots
btw i couldnt do it directly on the project, as my folder was in onedrive
so im downloading it out of onedrive
and will move it to the project
you dont need to move it to the project, you just need to run it
yeah
great
do you still have the steak ๐
no
ok
what causes this error?
incompatible types: org.bukkit.Sound cannot be converted to net.kyori.adventure.sound.Sound
Make sure to ask in the appropriate server concerning development towards different JAR types such as PaperMC. (Tip: Google them!)
you might need to use the EntityDeathEvent
but not exactly sure
ItemDropEvent probably
I just want to add enchant when player's fishing lmao
check PlayerFishEvent out
oh lmfao
thought it was from a mob xd
@remote swallow ok so i finished installing it, and its still showing the same error
reload the project
?paste your buildtools log
one sec
Sooo can I?
its really long, and that website wont save it for some reason
but it does say success
cut off the beginning, only need the last page or so
try with what EpicEbic suggested
since you want to change the item from fishing
- Saved as .\spigot-1.19.2.jar``` is not a valid .m2 path
wdym
what command did you use to run buildtools?
java -jar BuildTools.jar --rev 1.19.2
this
inside my test folder
in that case I have no idea what to advise your maven is so messed
What's EpicEbic ?
or
Oh Yeah I try with that event,
ok nvm, maven just decided to work out of no where
thanks
but im unable to import ServerPlayer
wtf
you need to depend on spigot not spigot-api
joined a tthe wrong time
i have
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
i changed it
?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
ow
@EventHandler
public void onFish(PlayerFishEvent event) {
Player player = event.getPlayer();
if (event.getState().equals(PlayerFishEvent.State.CAUGHT_FISH)) {
if (event.getCaught() instanceof Item item) {
ItemStack result = fishType.item(1);
item.setItemStack(FishType.RAWMUDCARP.item(1));
}
}
}
public ItemStack item(int amount) {
ItemStack itemStack = new ItemStack(material, amount);
System.out.println(itemStack);
ItemMeta meta = itemStack.getItemMeta();
itemStack.addUnsafeEnchantment(Enchantment.CHANNELING, 1);
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "ยงf[" + fishRank.getName() + "] " + translate + " ยง7(" + size + "cm)"));
meta.setCustomModelData(modelData);
itemStack.addUnsafeEnchantment(Enchantment.CHANNELING, 1);
itemStack.setItemMeta(meta);
return itemStack;
}
``` But It works only without addUnsafeEnchantment
ok
my pom.xml is correct according to the website
so maven should work right?
btw, they discourage the use of NMS
how can i make NPCs without it?
can i use it to create an NPC
declaration: package: org.bukkit.entity, interface: NPC
depends on your requirements of the NPC
i just want it to have a custom skin and name
and when right-clicked should say something
yeah might need NMS for the custom skin part
but everything else can be done from the api
try using addEnchantment and add a 3rd argument true
oh how?
just like NPC npc = new NPC();?
would make a new npc?
you would just use the spawn methods
but, since you want custom skin you would need to spawn it from NMS I believe
not sure if skins can be changed on entities already spawned
if that is true, then you could spawn the npc from the api, then use NMS to change skin only
nah it cant be
you can change teh skin on a player
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT:jar:remapped-mojang
</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>
${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar
</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT:jar:remapped-obf
</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
``` this is correct ?
but like its an NPC
is it possible on it
or maybe you could get the NPC as a player?
what is the base of your NPC?
wdym
the base MC class
it throw thisjava.lang.IllegalArgumentException: Specified enchantment cannot be applied to this itemstack
I tried to enchanttype itemStack.addEnchantment(Enchantment.CHANNELING, 1);
Do you mean ServerPlayer?
@eternal oxide
Channeling is for tridents i believe
Oh Is there an enchantmentType for food?
addUnsafeEnchantment probably
It doesn't work
If its a villager then you have to change their job
itemStack.addEnchantment(Enchantment.CHANNELING, 1, true) try this maybe
addEnchantment and addUnsafeEnchantment are different
it should be like a player