#help-development
1 messages Β· Page 1618 of 1
yes
Configure your maven compiler plugin to use a newer java version
<properties>
<java.version>16</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
Use the Minecraft dev plugin for IntelliJ. This way you will never miss it again π
ahh
yea but Minecraft dev plugin set Java version as 1.8 for my 1.17.1 project
or i missed something while creating project?
It also uses the wrong import for some stuff in 1.17. Probably just a bug.
anybody know how to only get a single part of a collection
Sure. Depends on the collection.
List<Foo> newList = srcCollection.stream().collect(toList()); or iterate
to contex is that i cant compare to itemstacks which are identically but are yet returning different so im testing full armour bonuses using the generic.armor attribute
Thats quite sub optimal. Just using the constructor of ArrayList should suffice and doesnt build an entire stream pipeline just for collecting.
Collection<AttributeModifier> attributeModifiers = player.getInventory().getHelmet().getItemMeta().getAttributeModifiers(Attribute.GENERIC_ARMOR);
System.out.println(attributeModifiers);
What do you mean by that? What do you want to compare?
public ItemStack NeptuneBoots() {
ItemStack NB = new ItemStack(Material.LEATHER_BOOTS);
LeatherArmorMeta meta = (LeatherArmorMeta) NB.getItemMeta();
assert meta != null;
meta.setColor(Color.fromRGB(0, 87, 123));
meta.setUnbreakable(true);
meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Neptune's Boots");
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 4, false);
meta.addEnchant(Enchantment.THORNS, 3, false);
meta.addEnchant(Enchantment.PROTECTION_FALL, 4, false);
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier("generic.armor", 6.25, AttributeModifier.Operation.ADD_NUMBER));
ArrayList<String> lore = new ArrayList<>();
lore.add("");
lore.add(ChatColor.GOLD + "Full Set Bonus: Oceanborn");
lore.add(ChatColor.GRAY + "While in water or during rain,");
lore.add(ChatColor.GRAY + "increase attack damage along with");
lore.add(ChatColor.GRAY + "movement speed by 50%.");
lore.add("");
lore.add(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "MYTHIC BOOTS");
meta.setLore(lore);
NB.setItemMeta(meta);
return NB;
}
this is my item stack
If you want to create set bonuses then you should def use the PersistentDataContainer of the ItemStacks and nothing else.
just to double check, it's not necessary to remove lazy metadata values right?
they don't stay loaded in memory?
new LazyMetadataValue(MetadataHandler.PLUGIN, LazyMetadataValue.CacheStrategy.NEVER_CACHE, eliteEntity::getLevel));
those
That's a thing π
Ah. No. They hold a SoftReference to their actual value.
people don't even know they exist
But who uses (any) metadata in 2021 anyways?
pretty much no one
persistent storage containers sort of killed it
I'll just yeet them out then, it doesn't seem worth maintaining at this stage
if you don't mind could you explain how would this be better
You are independent from properties that might change because they have an impact on the game.
PDC is superior in any way in this case.
You can also program agnostic and more object oriented. Ill give you an example.
This way you can make everything a certain set item and change the attributes later as you which without having to change all your checks.
private static final NamespacedKey NEPTUNE_KEY = NamespacedKey.minecraft("setbonus-neptune");
public void applyNeptuneTag(final ItemStack itemStack) {
final ItemMeta meta = itemStack.getItemMeta();
final PersistentDataContainer container = meta.getPersistentDataContainer();
container.set(NEPTUNE_KEY, PersistentDataType.INTEGER, 1);
itemStack.setItemMeta(meta);
}
public boolean isNeptuneItem(final ItemStack itemStack) {
if (itemStack == null) {
return false;
}
final ItemMeta meta = itemStack.getItemMeta();
if (meta == null) {
return false;
}
final PersistentDataContainer container = meta.getPersistentDataContainer();
return container.has(NEPTUNE_KEY, PersistentDataType.INTEGER);
}
public boolean hasNeptuneSet(final Player player) {
for (final ItemStack armorItem : player.getInventory().getArmorContents()) {
if (!this.isNeptuneItem(armorItem)) {
return false;
}
}
return true;
}
i have this particle
PacketPlayOutWorldParticles packetParticle = new PacketPlayOutWorldParticles(EnumParticle.FIREWORKS_SPARK, true, (float) l2.getX()+dx2, (float) l2.getY(), (float) l2.getZ()+dz2, 0,0,0 ,0, 0, 1 );
i dont know what value to change to make the particle play faster / last less time
i think its one of the last 6 values tho
Dont ever use packets for particles. It makes literally 0 sense as Spigot already sends Packets to specific players.
how do i do it in 1.8 spigot
a ton of people enjoy 1.8 pvp mechanics, and use that version, so i'm using it for a server im making
Using ancient software. Go search in the spigot forum archives. You might find something from 7 years ago.
8% of the player base uses 1.8
Sure. But then just use it for pvp. I dont think developing software for such an old version is worth it.
Anyways. Try finding a method to spawn particles for a specific Player first.
Its either in the Player class or the World class.
i already did tho, i wanna know how to change the speed of the firework particle, since when i spawn it, it stays there for a couple of seconds then dissapears
You cant keep a particle from disappearing.
i want it to dissapear quicker

is there a plugin or just default way i can read from a text file. I guess write
You have a full blown programming language at your disposal. You can even read from a gif if you feel like it.
If you want yml support then use spigots configuration API
https://www.spigotmc.org/wiki/config-files/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Surely there is a 1.8 PvP plugin
I guess I have to go back and hit my head against a brick wall with kotlin
I would probably start with Java as you currently have way more examples/information for that online.
But reading a File with Kotlin is doable. There are tutorials on that matter for sure.
the problem is that all the information on building with gradle and the api support is incredibly vague and frusterating
Why are you using kotlin if all the guides are for java
gradle + Kotlin is a niche setup. You really need to know what to do if you want to jump into spigot development with that.
the problem is the api and the building which is just way too annoying to me
Then just use java :)
And Maven most of us here use that instead of Gradle and more tutorials for it with spigot
Not that it's better than kotlin but you're gonna find it easier
Yea maven is much better than gradle in my experience
Or maybe just forge gradle sucks deep ass
How is it easier if its way way easier doing literally anything in Kotlin
ForgeGradle doesn't change how Gradle works it just takes care of setting up a dev enviroment
But kinda forge everything sucks deep ass other than their pretty impressive deobfuscation of vanilla code
Forge is quite neat
For me, forge was not fun to work with and spigot is fun to work with
i can just hear you crying about kotlin. either you are continuing with kotlin or switch to java. java is way more beginner friendly, does have a nicer syntax (in my opinion) and is just java
Forge is a bit messier to get started other than that it's quite similar in a few ways
Lots of it is confusing, poorly documented and much harder to find support
It's got better extensibility than spigot tho
because you've been brainwashed into using arbitrary forced type descriptions
A big part of Forge is decompiling and seeing how Vanilla does it. It's like working with NMS
Oh and Forge and MMD discords can help if you get stuck
Yeah but there are forge-specific things that you gotta look through github repos from seven years ago to figure out
I found forge discord and forums toxic (from a spectator pov) but mod-specific discords were friendly
Forge has had rewrites since 7 years ago
NuclearCraft's discord was great for 1.12 help
1.16 Forge is a lot better to work with
I hope haha
1.13 rewrite cleaned a lot of things up
Oh and Mojmaps are great
And ParchmentMC gives Javadocs and Params
Though what I was doing needed 1.12 mods (NC, GTCE) and the forge admins wanted to pretend 1.12 is dead and 1.15 was the new big thing
1.15 is end of life now
I wanna try fabric at some point to compare
1.15 was a bit of a failed state
1.16 seems pretty solid
But hopefully 1.18 becomes the new long-term version
It's good cause playing 1.12 packs gets boring
1.16 feels fresh since I didn't really play vanilla so I was stuck on .12
tf are you talking about
You mean strongly typed languages?
Guys chill
π€
@prime mountain if you seriously want to circlejerk about kotlin, this is not the place to say the least. At least keep the discussion civil if you do.
I just learnt today that Void is return of null, not for wrapping void
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.
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.
Lmao show me
you probably just clicked outside the inventory
Yes.
How can I fix this?
Okay. Thanks. I will try.
I already do.
you dont
you check if the item in the clicked slot is not null
if(event.getSlot() <= 4 && inventory.getItem(event.getSlot()) != null)
Isn't this what you mean?
if you would check if the event#getClickedItem is not null, you wouldnt have this error either
Ah. Thanks. I'm dumb
also identifying the inventory by the title is worse
Can I do it better?
and if your clickable items cant be moved i would identify them over the slots they are on instead over the displayname
Do you mean #getCurrentItem?
yeah
Is this a GUI?
Okay.
Where the items are meant to be unobtainable?
your naming conventions arent good either. check javas naming conventions
yeah. you could f.e. do a class per inventory which implements InventoryHolder so you can identify them by their holder
Even the item can extend itemstack and implement its own onclick handler
the items in the inventory are itemstacks 
It is possible thru persistent data and reflection
Save the class name within the persistent data container lolol

Then Class.forName and instantiate it again
just.. no
Since no meta data is lost other then the fact that it is no longer extending ItemStack, we can use the constructor with ItemStack as argument
Unless someone uses two plugins of the same name and both using the same technique, and somehow saving it under the same namespaced key, but by then something else would have broken down before that
oh, you are serious about this?
so, then it would be like: "hey guys, look at that" - "ew, go away ?learnjava"
anyone with experience with world loading and unloading happen to know why I am getting this?
[05:55:03] [Paper RegionFile IO Thread/FATAL]: Failed to read chunk data for task: Task for world: 'em_hallosseum' at 2,5 poi: false, hash: 900610284
java.nio.channels.ClosedChannelException: null
at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:156) ~[?:?]
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:790) ~[?:?]
at net.minecraft.world.level.chunk.storage.RegionFile.getChunkDataInputStream(RegionFile.java:176) ~[patched_1.17.1.jar:git-Paper-100]
at net.minecraft.world.level.chunk.storage.RegionFileStorage.read(RegionFileStorage.java:185) ~[?:?]
at net.minecraft.world.level.chunk.storage.ChunkStorage.read(ChunkStorage.java:115) ~[?:?]
at net.minecraft.server.level.ChunkMap.read(ChunkMap.java:1687) ~[patched_1.17.1.jar:git-Paper-100]
at net.minecraft.server.level.ServerLevel$2.readData(ServerLevel.java:252) ~[?:?]
at com.destroystokyo.paper.io.PaperFileIOThread$ChunkDataTask.run(PaperFileIOThread.java:508) ~[patched_1.17.1.jar:git-Paper-100]
at com.destroystokyo.paper.io.QueueExecutorThread.pollTasks(QueueExecutorThread.java:105) ~[patched_1.17.1.jar:git-Paper-100]
at com.destroystokyo.paper.io.QueueExecutorThread.run(QueueExecutorThread.java:38) ~[patched_1.17.1.jar:git-Paper-100]
I don't even really know where to start with this one
?paste please oh nvm its not that big
Just whats the problem with doing that
It sounds ugly at the start
But gui elements can be easily extendable
everything. why do you want to do that? using the PDC, okay, for what? reflections? very bad! you should never use reflections if you are not doing something big where you explicit need it(!). f.e. coding a framework.
also this has nothing to do with OOP then and is just an ugly way of overcomplicating. it would be extremely redundant since you could either just have a method for each ItemStack or even just do a handlerclass
anyone has an idea of how can I make resourcepack forced plugins
not forced ig
soft depending on a resource pack
just for more context this happens when I unload and then load a world in, sometimes it seems to work and sometimes it doesn't, I can't quite pin it down
seems like paper related to me
Turns out, I'm having way more trouble than I initially thought. I want to make it so when someone shifts, they get a certain potion effect, but currently I'm not even sure how to do that
the stuff i'm reading online is leaving me more confused than helped as well
PlayerToggleSneakEvent or smth
listen for that
I meant, as long as they're shifted, they get the potion effect, but once they unshift they don't get it anymore
toggle registers when they shift and unshift and that's it
mb explained it wrong at first
so store them somewhere
if they are in the collection at unsneak
remove them and the potion effect
ooh
can't believe in the few hours I've spent working on this, I didn't think of that... lmfaoo
I'll try it out and get back to you lmfoa
where is the rule of reflection usage coming from? there must be a reason to not do that. people are using it for nms in uglier ways. And it is OOP related, I personally think it is cleaner than checking inventory slots. It is like saying a webpage button handler should take in cursor's position within the windows. And what if the gui item is used in multiple GUIs?
I dont mean to come off that way. Sorry if i do. I'll figure stuff out on my own, sorry <3
Thing is it'd be using reflection where it isn't necessary
For OOP functionality in GUIs there is an easier alternative which I use
informative: https://stackoverflow.com/questions/42425906/is-java-reflection-bad-practice
crossversion nms "requires" reflections. in your case its completely possible without. its really not needed to have an own class with an event listener for each clickable item. and no, its not.
what has that got to do with webpage stuff now?
so you can make the hander/util/whateverclass f.e.
im trying to import a library into my project. how would i do so through gradlew
pls ping me if u think up anything
i.e. have a custom gui class which has an array (or map or whatever) that maps inventory slots to gui button objects. These objects are where you define the itemstack and implement your button functionality. From there you can implement whatever logic you want in a completely oop way.
There are other ways to do it but point is you don't need reflection for OOP inventory guis
i would think of a functional interface here
Basically, what I am proposing is for something like this to be feasible, where GUIItem is an abstract class for other classes to inherit:
@EventHandler
public void onItemClick(InventoryClickEvent evt) {
GUIItem clickedItem = GUIItem.fromItemStack(evt.getCurrentItem());
if (clickedItem != null) {
evt.setCancelled(true);
clickedItem.onClickHandler(evt);
}
}
which contains the code that the itemstack is supposed to do
Yeah I get the concept. But I don't see the use, only advantage it gives is that using the same itemstack in different GUIs will still have the same effect. But you could just as well do that with objects mapped to inventory slots rather than to the stacks themselves.
CustomGUIButton[invSize] buttons;
In event:
if(buttons[clicked slot] != null)
buttons[clicked slot].onClick()
?jd
same here. as well you would need to identify the itemstack first to cast to the correct subclass of guiitem.
there where the idea of saving the class within PDC come from actually, but yea..
and reflections seem totally unnecressary
or else how would you know which subclass to instantiate
all information about the instance class is lost
Yeah like it's a valid method but I don't see the advantages over for example what I described
without the nms pdc stuff*
yea i get your idea
but you could make f.e. a custom GUI which contains your GUIItems
the first thought that came to me since I suppose GUIs gonna implement InventoryHolder is that information about the items' instances will be lost
didn't think of creating a separate map
Yeah just have an addButton function that adds both your object to your array and the itemstack to the inventory
how can i get a item player has currently in hand in 1.13 to 1.17
Player.getInventory().getItemInMainHand()
Something along those lines
Is there a way to make it so, when you use performCommand to apply a potion effect, it doesn't say that it applied said potion effect to you in chat
ty
You can apply the effect directly rather than through command
i'm applying it through a command so you can't see the particles
is there a way to apply it directly without the particles
There should be an overload to the method right
hm maybe let me try and see if i can get that to work
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.
Code: this.essentials = (Essentials) this.getServer().getPluginManager().getPlugin("Essentials");
So i've got a problem with an anticheat project im making (Yes I know there's plenty out there it's just cuz it's fun)
I've got a couple of fly checks ect. but when a player is launched because of slime blocks they trigger the fly checks. How would I be able to detect if a player is launched because of slime blocks? I was thinking in the direction of checking if any of the blocks around the player r slime blocks but doing that would probably be way too inefficient so I was wondering if any of you guys have a better solution
declaration: package: org.bukkit.util, class: RayTraceResult
maybe check out this class
so, i am trying to use the worldedit api to get the region of a pasted schematic. i have this so far:
System.out.println("ran!!!!!!!!!");
EditSessionEvent e = (EditSessionEvent) event;
System.out.println("ran2!!!!"); // gets printed just fine
Region region = new CuboidRegion(e.getWorld(),e.getExtent().getMaximumPoint(), e.getExtent().getMinimumPoint());
World world = Bukkit.getWorld(worldname);
while(region.iterator().hasNext()){
BlockVector3 block3d = region.iterator().next();
Block block = world.getBlockAt(block3d.getX(), block3d.getY(),block3d.getZ());
if (block.getType() == Material.AIR) continue;
System.out.println(block.getType().name());
}
but that times out the server so that leads me to think that e.getExtent().getMaximumPoint() and e.getExtent().getMinimumPoint() are not the top and minimum blocks of the region
so, how DO i get the region of a pasted schematic?
NNYa
Am having some issues with the pathfinder
ie it just does not find a path
π
i removed the randomness
but still no worky
i couldn't find one
this was the issue
i didn't want to write one
but then i couldn't find one anywhere
again?
hey would i destroy block like this Block#setType(Material.AIR) in 1.13 to 1.17
im trying it and it doesnt work
Why does this return null?: configManager.getClanWarMapsConfig().getDouble("Maps." + mapName + ".Bounds.1.X")
ConfigManager.java: https://pastebin.com/3xD4j2BB
Location{world=CraftWorld{name=world},x=100.0,y=88.0,z=86.0,pitch=0.0,yaw=0.0}
Location{world=CraftWorld{name=world},x=98.0,y=88.0,z=135.0,pitch=0.0,yaw=0.0}
i mean that is my start and finish positions, completely line of sight and it still doesn't find a route
suer
*sure
Is the value in config ?
Yes
what did you change to make it not work anymore
well the PathController
but
i dont see why me changing how it gets called should break it
Any errors at loading?
i would have to see what exactly you changed
Only this: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.getDouble(String)" because the return value of "md.sintez.cloudclans.data.cofiguration.ConfigManager.getClanWarMapsConfig()" is null
i see
this method getClanWarMapsConfig() returns null
so your config is probably not loaded
ik, why?
show me how you load it
CloudClans.getInstance().saveResource("clanwarmaps.yml", false);
?
#createNewfile
check the ConfigManager
#saveResource is to save a file which exists internally
I mean in like main class
it exists
Could you show the CloudClans class too?
Hello,
I made a plugin where a specific item has fuel, and this fuel runs out every time a block gets destroyed using the specific item. How do I make that
I have an idea of using PCD
Just a question how did you initiliaze the configManager variable?
But the fuel will not be different for each person if I use my method
it will be the same for every one
In which class?
in the class u used the configManager.getClanWarMapsConfig().getDouble("Maps." + mapName + ".Bounds.1.X")
private ConfigManager configManager;
public ClanWarMap(String mapName) {
this.configManager = new ConfigManager();
}
oh i see
so you have to get the ConfigManager from the CloudClans.getConfigManager() method
you are just creating a new configmanager
so it have to be always null
since you never reinitialize it
bcz you are creating a new configmanager instance that is not loaded and any stuff
so I have to keep it's instance in main class?
you have to use the instance which is in your mainclass
Diamond block is the target
got it, ty
can anyone help i want to make a charges system for an item
seems to me like its blocking itself
takes a while
big file as well
it is set to remove the block 6 seconds after it is placed hence it gets destroyed after
yeah lmao blocking itself

do you compare the locations?
ye but there may be an issue with it
remember, it have to be the exact location to be reached.
let me change the equals function
or could it be because the diamond block is blocking the way to the location?
int current = e.getPlayer().getPersistentDataContainer().get(new NamespacedKey(plugin, "drill"), PersistentDataType.INTEGER);
why Unboxing of 'e.getPlayer().getPersistentDataContainer().get(new NamespacedKey(plugin, "drill"), PersistentDataTyp...' may produce 'NullPointerException'
Try use Integer instead of int, in case the pdc.get() returns null
what
oh so Integer
not int
ok
Yeah and then check if it's null before using it as a number
lmao
say it ain't so santa hitler
thats charlie chaplin
@grim ice btw if you're making a drill with fuel then you wanna store it on the item pdc not the player
huh I didn't know charlie chaplin was racist
yikes
but who are you racist against santa?
I do
that's why I asked
then you're using rhetorical questions wrong
because that has an answer
it matters to me
didnt knew that NNYa was either
I feel like not only are you a racist but you're also a coward for not saying who you're racist against
Yea honestly who cares lol
I care

I feel like I'm repeating myself
he spins his wheel of fortune to determine his next hate target
after you broke it
If he's only racist towards non-0xFFFFFF people then does that mean he's cool with the polish
Paradoxically
that's where you draw the line jeff?
that's like the french drawing the surrender line in belgium
can someone tell me what i need to fill in my pom.xml file if i use this library?
https://www.spigotmc.org/resources/lib-armorequipevent.5478/
You need to install it on your local repo
well only his main account
yeah he still has his other 50
but still
he is very helpful
questionable ethics
but very helpful
No.
that will change the item for everyone
not just the player whos using the drill
tbf nnya would instantly disappear if someone made this chat verified only
there's only so much patience people will have for spoofing multiple accounts on multiple levels
sorry, but do you know a tutorial on this stuff or smth? because i dont know how to do it and never did it before
there's a guide on how to use maven on the spigot docs
NNY is a nice guy as long as he doesn't post his racist comments
Yes man, here you go: https://intellipaat.com/community/6786/how-to-add-local-jar-files-to-a-maven-project
once you have that down it applies everywhere
Hope it helps you kipteam
thank ya
yeah but by volume that's 20% of what he says, and he says a lot
but not on the spigot page nor the github page is explained what the <groupId>, <artifactId> or <version> is
Its because they dont have an repo for it, so you have to add it to your pc, which will only work on your machine, that's why you have to download the jar of it
anything you want
oh
but you also need mvn installed
you have some tutorials on youtube for that
just search " how to install mvn windows 10"
banned from discord or this discord server and why?
How can I make something like this? https://www.youtube.com/watch?v=mOMhlURW35w
from this discord - again
again⦠What did he do
is that a timer with blocks
I know what it is
but how can I recreate it
what is the most optimized way
Im asking what it is
ok
Probably the best way to do it would be to just have a set of blocks for each number, like the format, and then just set those blocks when that number needs to be drawn at a location
Then just have a timer every 1 second to redraw the changed numbers
that is a terrible idea
LMAO then what's your idea?
thats like 320 numbers
Wouldnβt that cause the server to lag potentially even crash
Why would it
yeah thats what I was saying
Youre only changing like 30-ish blocks depending on how you size and format your numbers
That's trivial for the server to do
Your changing multiple blocks every second
saying in a dumb way but I had that in mind lol
WorldEdit can place thousands of blocks all at once without much lag, pretty sure you're going to be okay with not even 100
It's the same concept
No it's not. Fill just iterates through and sets each block.
They do the same thing
I mean there's really no other way for what you're trying to achieve anyways. You have to set the blocks regardless of your method of doing so.
Take a look how this person does it https://www.spigotmc.org/resources/blockclock-1-13-1-14.68651/?__cf_chl_jschl_tk__=pmd_1368705ad7ffc1af29de7739a4839d015d160dc4-1628081827-0-gqNtZGzNAfijcnBszQi6 π€·ββοΈ
It's not open source
decompile lol
thats againt spigot tos
I thought I saw a github link
there isn't one
oh found something
it's about the platform
Bulkedit can do >100k blocks easily but I think they are using a lot of optimisations
not the content
Plugins can have their own licenses though, so be careful with what you do. Decompiling is generally okay afaik but never just steal the code
"works to the platform"
Your just viewing how they did it though so you can get a general idea
it's not. you are receiving data you aren't allowed to receive. *as long as its stated anywhere
equated with hacking afaik
but you would have to proof it. that could be hard
π€ what does that even mean
You're not allowed to
screen record your process
Itβs not skidding
so like fuck yourself at court?
Literally what your saying is if you look at a github project your skidding
no
that's what you said
but if you decompile it without perms then you're obv breaking the rules
stackoverflow = skidding
Yes
decompiling is public
its not
^
yeah it is
^^^^^
you are accessing data you aren't allowed to access. as i already said, its equated with hacking
^^^
Take a look at Digital Millennium Copyright Act PUBLIC LAW 105β304
m8 I aint no lawyer but it's common knowledge
^
but if the author stated its allowed Γ‘ the door of the house is open with a sign "come in", its allowed
π€·ββοΈ
exactly
It's not on github
ask the author for it
There's a reason it's not public
Maybe he is a noob at github and doesnβt know how
https://hastebin.com/iponuhebey.kotlin
Can someone check what im missing?
I dont see it
If he can make something idk what the BEST WAY to do it is then he knows how
Is there an error message? Tim
Whatβs line 19
its also in the paste but its
getServer().getPluginCommand("plugin").setExecutor(new plugin());
Yeah so this is the license used for every spigot plugin if not specified otherwise
ah
I didnβt even know that existed
ok?
Did you add it to your plugin.yml?
yes
How do I stop players from placing my itemstack? What I have now:
@EventHandler
public void onPlace(BlockPlaceEvent e){
if(e.getItemInHand().isSimilar(recipes.getEngine())) {
e.setCancelled(true);
}```
Like the class?
no executor
but getItemInHand() wouldn't be as good, right
Cant really change the /command since it has to be a simple replacement for /plugins
CommandPreProcessEvent
I also added the perm to plugin.yml
Or something like that
check if command is /plugins and cancel it
and do what you want it to do
Just send a simple messages when a players tries to lurk into our plugins list
oh i see
Wait I think i know the solution for that, whats the problem?
https://hastebin.com/iponuhebey.kotlin
error + line + class code
can you do getServer.getCommand
Cannot resolve method 'getCommand' in 'Server'
uh
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
idk i donβt ide
getServer()
I do have this warning at the 3 lines
Method invocation 'setExecutor' may produce 'NullPointerException'
Please learn java before going into spigot
already learning it
You can ignore that, it won't return null unless you did not register your command in plugin.yml
so you if you did register it you can ignore that
I have registered it in plugins.yml
Then you can ignore it
so is the permission
guys which is better storing list of ids in a column in database or a new table?
im sure column is faster but idk if its a good idea
replace your "line 19" with
getCommand("plugin").setExecutor(new plugin());
@queen niche
^ not sure how getPluginCommand works but I don't think you can use it for registering them
I think that gets already registered commands maybe?
He's using getPluginCommand
What?
Why?
Nevermind. π€¦ββοΈ
Why is he using that...
bruh
oop I misread ur message
idk who told him to use that
dont tell me a yt showed it
Hopefully not
Hello
is there any 1.15.2 schematic pasting/copy code? I tried to find for 1.2hour and I failed (Failed 6 code far) (without worldedit/api) (Failed example1: https://pastebin.com/raw/KiDUCs5m)
iirc right u use that to get the commands of other plugins
WorldEdit has documentation for loading and saving schematics.
Use WorldEditAPI
oof I don't want use any api/worldeidt sorry I should said
Use it
Yeah... It's gonna be a huge pain for you to recreate something like that
thanks you for worrying about me. but I will never use that π
because I want to make my system
Oh well good luck figuring it out
Oh and it's not your system if we write it for you
Try not to ask for code next time
How to stop a itemstack from being placed?
I have
@EventHandler
public void onPlace(BlockPlaceEvent e){
if(e.getItemInHand().isSimilar(recipes.getEngine())) {
e.setCancelled(true);
}
}
yeah, but I will edit it myself. and I didn't made .schematic file system so I can't make paste system myself
I personally think this part needs a code.
.-. If you don't know what you're doing stop asking us to spoonfeed you and use libraries like WorldEdit
That seems like it should work, provided the events are registered and that recipes.getEngine() is returning a similar ItemStack. Maybe try adding some print statements to see if there's a difference between the two items
Okay
just cancel the interact event if the itemstack is the #getItem if the getClickedBlock is not null
Just use WorldEditAPI, every plugin that has structures to paste uses that
so i have this code
// more code here
Location loc = e.getWhoClicked().getLocation();
loc.setX(-53.0);
loc.setY(8.0);
loc.setZ(95.0);
loc.setYaw(0);
Minecart minecart = Bukkit.getWorld("TPCSurvival").spawn(loc, Minecart.class);
switch (e.getCurrentItem().getType()) {
case COPPER_BLOCK:
minecart.addPassenger(e.getWhoClicked());
player.sendMessage(ChatColor.YELLOW + "[NPC] " + ChatColor.WHITE + "Minecart Operator: " + ChatColor.GRAY + "I will bring you to the copper mines!");
break;
// more code here
and this is what happens, how can i get the minecart on the rail?
https://youtu.be/H3i3tzsC3LQ
What annotation?
@Plugin(name = "2b4c Core", version = "v1") I'm trying to use this but my plugin simply isn't loaded..
pl
pl
[17:47:37 INFO]: Plugins (0):
package twobeefourcee.core;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.java.annotation.plugin.Plugin;
import twobeefourcee.core.commands.Update;
@SuppressWarnings({ "rawtypes" })
@Plugin(name = "2b4c Core", version = "v1")
public class Core extends JavaPlugin {
// DB db = DBMaker.fileDB("file.db").make();
// ConcurrentMap map = db.hashMap("map").createOrOpen();
@Override
public void onEnable() {
this.getCommand("update").setExecutor(new Update());
if (Bukkit.getOnlinePlayers().size() != 0) {
System.out.println(
"I'm not really a fan of reloads, but because this is probably a development environment, I don't care.");
// do some shit here idk
}
}
@Override
public void onDisable() {
System.out.println(";( bye");
// db.close();
}
}
This is my code
Pom
My plugin.yml is empty.
?paste
You need to have a plugin.yml?
you need to define stuff
Yeah
You must declare:
name
main
version
[17:51:20 ERROR]: Error occurred while enabling 2b4cCore v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "twobeefourcee.core.Core.getCommand(String)" is null
Do I need to have a command inside of Plugin.yml too?
yep
Why'd you use annotations then?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
You don't
Annotations are useless to me then
If you're using plugin annotations, there is a @ Command annotation iirc
There's an annotation for every field in the plugin.yml
See the README here:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/plugin-annotations/browse
Those annotations are more verbose than if you were to just make a plugin.yml manually. You're just shifting all of that work load into annotations in source, which imo was a massive turn off unless you're making an extremely simple plugin
?paste
Did you register the event
it looks like a "in the next moment breaking"-wave
Add some debug messages or smth
e.getPlayer().getInventory().getItemInMainHand().equals(new ItemStack(Material.IRON_NUGGET))
equals() checks for exact NBT matches
Check its type instead
Even still, that will yield a similar result because isSimilar() is just equals() without equating item amount
Just simplifying that to item.getType() == Material.IRON_NUGGET should yield some results
Also, please make some variables for readability sake ;p
yeah lol
Definitely PlayerInteractEvent#getItem() over Inventory#getItemInMainHand()
Not only is it more concise but it's going to better support multiple hands
Though careful because if I recall correctly it returns null as opposed to an empty stack like getItemInMainHand() does
e#hasItem
I;m using getAmount rn
so
i would still need
to check if getItem is not null
at least to remove the warning from my ide
hello
i was trying to keep the diamond_sword item on my inv on death
like when a person die his armors are removed except for the sword
e.getDrops().removeIf(item -> item.getType() != Material.DIAMOND_AXE);
i tried that
hello?
What version are you using? for spigot
A diamond axe is not a diamond sword
Also that will just stop it from dropping
You could set event.keepInventory to true and then manually drop all the items
how do i kill a minecart?
Call remove on it iirc
hello
i'm trying to disable a plugin to update it
i want to delete my plugin to delete itself, but it's being locked by spigot
how do i disable spigot from using my plugin before I toggle it back on?
my code:
You want your plugin to delete itself?
I see.. is that a private plugin or are you going to upload it to spigot
Private.
So I looked things up you can get the update folder with Bukkit.getUpdateFolderFile() and put your plugin there. During the next start bukkit will replace jar
Who know how can i colored name players ? but not on chat, on their head
nametag?
is there a proper way to cancel EntityTargetLivingEntity event? It keeps occurring after some retries even if i cancel it
Hey there π currently working on a plugin witch involve ender dragon, but as you probably know dragons have a « portal locationΒ Β» attribute witch is the location where they will fly around when they are in circling phase for example. Iβm trying to modify this attribute but idk how :/
@chrome beacon
Do you know any documentation for that method?
Heres what I have right now.
I now have a core-1.0.0-2b4c.jar file.
How do i make durabilities for custom items (for example sticks..etc)
PersistentDataContainer?
If i do that the durability will change for everyone using the item
not just the one who is using it
wut
If i do that the durability will change for everyone using the item
not just the one who is using it
...no?
Quick question: When you make a shaped recipe, how can you make it so that you need several items on one slot for the recipe? e.g. you make a recipe for which you need 10 earth blocks. one earth block must be on each crafting slot and 2 earth blocks must be on a certain slot?
yes becuz they have same key
wdym by "all the copies"
like
when a player crafts the item
and damages it
ill add the persistent data container to the item, right
yeah
Here is an example implementation https://github.com/BenCodez/AdvancedCore/blob/master/AdvancedCore/src/com/bencodez/advancedcore/api/updater/UpdateDownloader.java
but it will contain specific durability integer
just ItemStack#getItemMeta#getPersistentDataContainer#set(NamespacedKey, PersistentDataType.INTEGER, value)
and you just handle block break (for example) events and check if that item has that key and reduce the value
and if the value is 0
remove the item
Yea like this
becuz u set the value to the item itself
can anybody help
is there any spigot plugins i can ue as a discord bot to note down people users names and ips
Use #help-server and don't log ips unless you really need to
skid
the server does do it itself so
Β―\_(γ)_/Β―
Yeah but why do you need to log it yourself
ik to bc of hackers
from previous servers i ran
does it?
i need a discord bot so all my staff see
how can i check the user name and ip then
Read the logs
Or you know you could just ban the ip
Instead of keeping track of each ip manually
Yes technically possible by listening to both PrepareItemCraftEvent and CraftItemEvent
On prepareitemcraftevent set result as null if there are insufficient items. And on craftitemevent decide how much amount of ingredient to deduct
if i added the plugins jar to the dependencies why cant it find the class?
Did you forget repo?
on the site there is nothing for the pom.xml so i got it from the github page
like i hope it's this
oh wew i did it everywhere and it worked
Then run mvn install in the folder
intellij can find the classes if thats the problem
I fixed it by unzipping straight into /plugins. unzipper.unzip("2b4cCoreUPDATE.zip", "plugins/");
I have a new issue.
does kicking a player still fire PlayerQuitEvent? I can't remember ._.
I have this config.yml ```
locations:
RED_WOOL:
- "234,97,217"
I'm trying to use it here
``` Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
public void run() {
locations.forEach((loc, mt) -> {
loc.getWorld().dropItemNaturally(loc, new ItemStack(mt));
});
}
}, 0L, 3);
you mean like you have dependency and repository?
yeah
Yes
I told you what to do instead
the source is the zip file right?
Yeah or clone with git
since when does steelphoenix code plugins?
Yeah that works if you don't have maven setup
i dunno if i have
Just open Intellij then
Have you opened Intellij?
yessir
Now instead of using package in run configurations use install
aha thankjoe
the only thing is that the maven tab is gone
i defined the project sdk
ah found
is there a way to set an item stack of a custom item ,morefood:pinapplebeing the ID of the item any help would be greatly appreciated and ty in advanced
Where does that id come from
A mod?
No you use the Material Enum
hmm it cant find the pom.xml
Just use the Forge or Fabric api directly and don't use Spigot
I have a question about buildtools?
Is there a way you can make a spigot jar from a version of minecraft you have downloaded on your pc?
what will it do if i cancell the playerquit event
pretty sure you can't set it canceled
Ig that would immediately kick them
normally it sends a message to the server when someone joins
but when im vanished it wont
but it sends the default minecraft one
and i dont want that
like this brr
set the join message?
Whatever vanish pluging you are using has a permission override to see vanished joins
i made it myself Β°-Β°
:minitroll:
Then make it better π
well i think hust set the join message to an empty string
Material.getMaterial("RED_WOOL") gives me nothing
are you trying to make an ItemStack?
config
item stack is new ItemStack(Material.RED_WOOL)
yeah
Could not find minecraft:red_wool material!
Hmm. Still the same issue
Here's my code.
missing API version in your plugin.yml
name: 2b4cCore
main: twobeefourcee.core.Core
version: 1.0.0
api-version: 1.16
commands:
update:
default: op
Still doesn't seem to work.
why
Unboxing of 'e.getPlayer().getPersistentDataContainer().get(new NamespacedKey(plugin, "drill"), PersistentDataTyp...' may produce 'NullPointerException'
Integer total = (e.getPlayer().getPersistentDataContainer().get(new NamespacedKey(plugin, "drill"), PersistentDataType.INTEGER) + amount);
how to fix it tho
test teh return before you attempt to add
it was just a test
i removed it
lol
ye
who uses anything other than intelliJ anyways lUl
ok
there isnt find cause
lol
nothing there
i clicked it
nothing in it
just some useless stuff
Anyway that warning is because the player might not have that pdc
what?? i checked
i checked if it has that pdc
Then ignore the warning

Just when will I stop asking questions in this channel :(
I feel like I'm not progressing :/
myeah
you should probably learn java on its own
might enhance your spigot dev skills significantly
I mean
dont supress every warning
I mean
I don't find what I'm doing really uh
like
I don't feel like im really lacking java
I lack spigot api knowledge more
sysdm its kinda the stfu compiler which might produce bugs later on because you weren't able to spot them, or rather couldn't
oh yeah
I mean "unchecked" would be enough then lol
I think I arbitrarily clicked on of your bin links just the other day
unused, rawtypes
uh
ConstantConditions
π
how can i save to and read from the config a list of objects of my own class? can i do that with yaml? or does everything have to have a key?
so, doing that, i do config.set("some.key", myobject.serialize()) for storing it, and (MyObjectType)config.get("some.key") to read it?
what if i want to do a list of that? i just set a list of serialized maps? or it serializes automatically or what
right
it will use the deserialize method?
and setList?
but the main thing i want
is to have different data types in the same element of a list, can i do that? or the thing i serialize has to be all the same type?
Does anyone know if it's possible to make the MC client recognize recipe ingredients with custom names in the knowledge book?
The recipe works, but the knowledge book doesn't know it works, if that makes sense.
?
if that makes sense.
I guess it did not π
I have custom recipes with ingredients that have display names or other special data. The recipes work, they show up in the knowledge book, but always as "uncraftable" even if I have the right ingredients.
Seems like a client problem, I'm wondering if there is a workaround.
how can I make a child category of a category in the config file?
the item has to be exactly similar
games:
clash:
clans: barbarian
Like that Barbarian? Not sure what you mean, exactly
yeah
FileConfiguration#createConfigurationSection(path)
It is the exact same item- I have tested with a simple item that has no meta except for a display name
ok thanks
hm though I suppose I don't know at which point all the ChatComponent serialization kicks in
it works for me, try doing a Sysout
ItemStack#isSimilar(other)
well a I said, crafting works
so the ExactMatch works
anything I do server-side is going to show they match (I believe)- but I will dump the item when I register it to be sure
I'll also test with something simpler like the unbreakable tag
Sounds like a client issue. Might not be much you can do
How much CPU usage is too much for a loop running every 5 ticks?
What
exactly
Oh, right, depends on CPU
and what you are doing
... fwiw using an unbreakable item instead of a named item is even weirder. It now thinks I can craft the recipe, but won't move the unbreakable item into the grid automatically.
So i guess it's not an issue with name/component translation, or at least not entirely. Ah well, probably nothing I can do, but that sure doesn't stop my users from complaining π
Try using datapack recipies in Vanilla
If those work then might be worth looking in to further
Thanks, that's a good suggestion .. looking through the mojang tracker, seems like it should work with datapacks but they don't care it works with Spigot
https://bugs.mojang.com/browse/MC-130058
https://bugs.mojang.com/browse/MC-166870
(gonna try out the datapack posted with the 2nd issue)
If it works with Vanilla we can help work around it
well that skyblock.zip seems like a no-go, it's just simple items.
Sadly I've no idea how to make a datapack that has ingredients with tags on them
Hi hi, I have this calculation to get the velocity 5 ticks later in a free-fall which works fine.
Double Velocity = player.getVelocity().getY();
Integer x = 5;
Double expectedVelocity = (3.92 + Velocity) * Math.pow(0.98, x) - 3.92;
Can I also calculate the expected Y level of the player with the current Y level and the expected velocity of the player after 5 ticks?
uh so how do i know if i know enough java
maybe doing some calculations with System.currentMillisionecsondssomeyhing
i forgot the rest
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
F, cuz I saw this post
And by integrating the function and adjusting some constants, you get this function, which describes the player's Y position after X ticks:
p(x) = -3.92(x+1) - 0.98^(x+1) * 50(3.92 + INITIAL_Y_VELOCITY) + 50(3.92 + INITIAL_Y_VELOCITY) + INITIAL_Y_POSITION
But I have no clue if it would work
i saw ppl in forums rly struggle in some really basic stuff and im scared now
will do
all in lower case be like:
system.currentTimeMillis()
I donβt have time to capitalize
extra button
lol
it's System.currentTimeMillis() right?
yep
Ye okay I got confused lol
idfk
no
Caused by: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: minecraft:diamond{Unbreakable:1}
Maybe.. you can not actually make datapacks with custom item ingredients?
System is a class
oo
right

