#help-development
1 messages ยท Page 622 of 1
Also also, getTag() can return null if the item doesn't have any NBT
okay
If I wanted to display a list of rewards for completing a quest, but some of the rewards are commands, what are my options for that?
wdym by this? like telling the player what they have been rewarded? or giving them the commands?
for example, if the reward is to give the player a crate key, but that's a separate plugin that isn't anything to do with me, how would I do something like: rewards: 1x diamond, 1x epic key, ... as a message to the player?
If it's configurable just add another key in the YML that is "display" and just display that
for the quest itself, or for the crate plugin, or what precisely?
Is it possible to modify entity's attack reach?
nope
attack range is an attribute i think if i remember correctly
either entity attribute or item attribute
idk if thats what youre looking for tho
So normally can attack if the mob is close to its enemy.
I want to make let's example the mob can attack even the distance is 10 blocks.
https://github.com/JamiesWhiteShirt/reach-entity-attributes
This might be what you want?
oh wait
im so wrong
thats a mod.
๐
That might be it but it's a mod yeah.
CompoundTag#getCompound doesn't return null.
Yeah sleep deprived me aint to good rn lol, sorry bout that. You could do something with ray casting? im seeing some spigot forum chats like that.
So basically I have to manually do that right? Like create a timer task and check the entity's raycast.
I believe so yes, but also some of this other stuff im reading, is that ray cast doesnt check for blocks. so you'll have to do something about that.
https://www.spigotmc.org/threads/increase-melee-weapon-reach.476336/
this seems to have a good grasp. Ticxo at the end haas mentioned a method. https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#rayTrace(org.bukkit.Location,org.bukkit.util.Vector,double,org.bukkit.FluidCollisionMode,boolean,double,java.util.function.Predicate)
Which i might actually use this rayTrace I have some ideas.
I also found this https://github.com/YeetmanLord/RayCastUtility
entity attributes
or item attributes
There are no attributes for that.
I really like this. Really minimizes everything.
Also got like different levels of Precision which is nice.
Couldn't find one.
how can I get the amount of netherwart can drop?
tried this but doesn't seemed to be right
i have a small question
if its posible or if someone know
i want to make a dispose plugin that when you open it and put items in there when you leave it the items disapear
and i really need 1 thing
how can i set the text "dispose" in the midle of the inventory
package me.shadow.inventory;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.Inventory;
import java.util.ArrayList;
public class MenuCommands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
Player p = (Player) commandSender;
Inventory inventory = Bukkit.createInventory(p, 27, ChatColor.DARK_GREEN + "Dispose");
p.openInventory(inventory);
return true;
}
}
Add spaces before the word dispose?
https://paste.md-5.net/yopudorazi.cpp
Trying to add the possibility to display days but from many tries i can't,
Old code i tried:
https://paste.md-5.net/hosayaropo.cpp
not a solution but you should check if seconds < 0 and if so return "infinite" at the beginning so you dont have tot do the check at the end or use Math.abs
something i missed lol
to display days something like this should work
String formatted = String.format("%d:%02d:%02d:%02d", s / (3600 * 24), s % (3600 * 24) / 3600, (s % 3600) / 60, (s % 60));
with s being the number of seconds
in your code absseconds
ok
it wont work with negative seconds
pretty much i don't care about that because i already made something to fix it
ok
Im trying to make it so when ToolMenuManager.openToolMenu(playerMenuUtility); is called https://pastebin.com/MSLLb3rw it opens the menu of the tool the player has selected for example an elytra here https://pastebin.com/5qAQ55Y2 but the line is not working. here is the toolmenu manager class also https://pastebin.com/5XTKsWEx any help would be much appreciated !
when i click the close button to return to the tool menu nothing happens it is just a useless button. there is nothing coming up in console either
Anyone have any luck writing unit tests with mockito and mockbukkit? its been a nightmare for me. I've been trying to mock an event, and pass it to my listener. I haven't found any solid examples, so i've been trying various approaches. I'm just very confused at this point. If anyone else has got it working (or knows an example), I'm all ears.
Wouldn't having a Function<PlayerMenuUtility, Menu> be better than creating the instance from class using reflection ?
In your ToolMenuManager class.
Also, use an early return so your code is not so nested.
Is it a good practice to use a static instance of the JavaPlugin class instead of putting it in a constructor for each class?
MyPlugin plugin = MyPlugin.getInstance();
public static MyPlugin plugin;
onEnable plugin=this;
this is what i do
Same, I am actually trying to improve my code and I see many doing both of the things I mentioned above. I was wondering if there was a reason to do that certain thing or do the other thing
nah its all the same (i think)
https://bukkit.org/threads/getting-the-instance-from-the-main-class.489377/
this might help tho
Thank you ๐
MikeTheShadow, what do you think instead?
Good practice? Sort of? Technically it's better to have it as a constructor arg.
It really depends because imo I'd rather be able to just use plugin.xyz in my code rather than mainclass.getPlugin().xyz or create a new local variable everytime
I do DI all the way
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ye dependency injection
It's pretty self-explanatory but the second you're making a bunch of plugin.something calls you really don't want to have to make a new local variable each time you want the plugin. Plus, if you make sub methods you'd have to unironically inject it into those as well or face doing another main.getplugin() call.
You're right, it's good practice. But I think the performance is not affected that much... From what I understand so far, it just seems to be a design choice
I don't think calling a precached instance variable once per code execution would affect the server that much.
It's entirely a design choice. In fact, you'd actually use a minutely larger amount of memory injecting. That being said, from a design aspect it's easier to use, and it will greatly cleanup the code because you don't ever have to do
Plugin plugin = Main.getPlugin(); plugin.doX; plugin.doY
Thank you for sharing your opinion! ๐
NP. Just remember that if you feel like it's time to refactor it's never too late to start 
What packet do I need to cancel being sent for player's not to appear on tablist? (only header and footer shows)
prolly can find it if it exists here https://wiki.vg/Protocol
damn I forgot to reply
there's a tab info packet
One of the modes is REMOVE_PLAYER
https://pastebin.com/gGYFiE5t
Error when player have mending on tool
here is my code:
https://pastebin.com/m3ZYkVDA
at first it was working
i change NOTHING and after some time it starts kick players
here is the start of error: https://pastebin.com/wGEmAcH6
What if I just stop the server from ever sending the packet to add the player to tab?
like cancel whenever that packet gets sent
I don't think the players spawn if they're not added to tab
so I would just send that remove packet whenever that add player packet is sent?
Yeah so looking at how this works
Apparently if you set the repair amount to 0
it trips up
Because it's trying to convert leftover exp
so i need to check if repairAmount >0?
not really
You just need to set the repair amount instead of manually repairing the itme
like damageable.setDamage(item.getType().getMaxDurability() - repairAmount);?
I think damage is actually from 0 to max instead of the opposite
So setDamage(0) will repair it
any1 got minecraft plugin ideas
PlayerToilets
What's that
Last time I did packets I had the problem that I couldn't gert anything by getWhateverType() and I had to get the raw modifiers and use nms for modification
Look at the NMS packet in whatever server version you're working with
ElgarL, I need your opinion
Packets are painful, but when you get them working it's super cool
You are in luck, I have lots of opinions
I'm making a plugin that I'm going to put on SpigotMc with different inventories and that also has a yml file for the language. Do you think it makes sense to make all items in each inventory and messages editable or just the messages?
I would have to create a whole other system to implement message editing as well. I currently only have one system that allows me to get strings, but if I had to do something like this for every lore and displayname, I would mess everything up.
If its for others to use the more customisation would be more attractive. However rememember if you allow Materials ot be specified in the config you will have to trap errors in different versions (Materials missing)
keeping language to a separate file would be best
Thank you so much Elgar ๐
np
Making the materials AND texts customizable does have a downside: The people using your plugin will have a harder time to tell you exactly what they did and clicked in order to reproduce an error. I'm not saying "don't do it". I just wanna add that having some Admin GUI with fixed items won't hurt anyone and will make life easier when issues occur
That being said - if the GUI is also for regular players admins probably want it to be adjustable.
Yep, you'll have to be on the ball with error handling
I use Sentry-io for this, it's not a sponsor
guys
how to make that if i have spaces in the args[1] like for the reason "Hacking and Cheating " how to make the args[1] accept them all in the command ?
You combine args[1] with all args until args[args.length-1]
like ?
For loop with string builder
args[args.length-1]
do i write this in the code ?
no , it's just a report command
does it have a player name then
yes
That'd be args0
String.join should also do the job
okay, use a string builder
But mah for loop!
cant join if it has other stuff in it
true, unless you wanna substring args[0] after
what are u tryna do?
Well just do asList and sublist it
or create a sub-array
StrinBuilder mew = new StringBuilder(args[1])
No
hmm
for (int i = 1 ... args.len)
builder.append(args[I]);
Am on my phone - it is hell to type non-abbreviated code
what is this ?
a stacktrace
alright
NEVER call new MyPlugin()
Also
Why...
?whoami
Why would anybody do that
Hence never do it
Well "I need a plugin instance and don't have direct access to one - lemme just create a new one, what's DI anyway?"
I would use packet events since it has a much nicer API
why would you not have direct access to it
Beginner code
Why would you have direct access to it if you never learned DI?
Unless you do that static variable hack
I e. You have no idea about In avapkugin#getPlugin
nope
Isn't there some shit like Bukkit.getPluginInstance?
No
I have a per player block system for 1.20.1 that works
But there is JavaPlugin.getPluhin(NyPlugin.class)
so the latest release works on 1.20.1 servers?
Hi, does anyone know how to run a mc server every time the plugin is built? so I dont have to restart it manually every time
Maven-execite-plugin or something
i use gradle tho, would it work too?
use run-paper or just make a task that runs the command somewhere
I'll google for it, never did much with gradle hehe ty
JavaExec is the other opption
hmm
but on the other side, the player will report for one reason like
hacking or spamming
it will join the args up to the end of the command
eg you could type /report player cheats or /report player cheats and hacks and spam
and it would still catch it all
toilets for players xD
do you guys know how to get the bounding box of a player? and the raytrace of an attacking entity?
So, just toilets?
Its a dumb idea I was joking xD But yeah.. just toilets. You can place them with a command and it'll create like a small toilet hut
so depends on the player eating and all the other factors..
from time to time they have to go sit in the toilet xD
If they dont go they will move slower and slower
XD
Toilet hut?
I'll add a public toilet structure
You'll get nausea when you enter it
How can I remove a specific amount of items? I have for example 20 diamonds and if someone tries to byt something it should remove for example 3 diamonds of that stack
How could I do that?
Inventory#remove(new ItemStack(Material.DIAMOND,3))
How to check that book has this enchantment?
Here im creating a book: https://pastebin.com/A2LtSjSr
here im trying to get enchant from book but i get null
https://pastebin.com/3AfhbvD4
item.getItemMeta().getEnchants() show me {}
enchantmentStorageMeta.hasStoredEnchants() show me false
well does the book have the enchant stored...
remember enchanted book v book with enchantment are two different things
yeah, i know
oh
CustomEnchants.MENDING_PLUS
custom enchants aren't supported by the API
so who tf knows
ohh
im telling choco
this did not remove anything
Try removeItem instead
anyone knows? I remember that in old spigot versions there was "entity.getBoundingBox()" and "boundingbox.rayTrace()" but now it's gone, are there any equivalent methods?
How can I give a PLayer some armor?
armor slots
declaration: package: org.bukkit.entity, interface: LivingEntity
then the appropriate set methods
I was using 1.8 spigot... my bad, thnks
what is the fourth argument in Quaternion responsible for?
If you ask that, then you don't really know what the first three are for either
List<ItemStack> armorContents = new ArrayList<>();
armorContents.add(type.getTeamArmor(ItemManager.generateItem(Material.LEATHER_HELMET, 1, 0, itemMeta -> {
itemMeta.addEnchant(Enchantment.DURABILITY, 1, true);
})));
armorContents.add(itemStack);
armorContents.add(type.getTeamArmor(ItemManager.generateItem(Material.LEATHER_LEGGINGS, 1, 0, itemMeta -> {
itemMeta.addEnchant(Enchantment.DURABILITY, 1, true);
})));
armorContents.add(type.getTeamArmor(ItemManager.generateItem(Material.LEATHER_BOOTS, 1, 0, itemMeta -> {
itemMeta.addEnchant(Enchantment.DURABILITY, 1, true);
})));
player.getEquipment().setArmorContents((ItemStack[]) armorContents.toArray());```
This throws me a castException
How can I fix this?
What exactly is "this"
Show the exception as well
The ArrayList which I want to cast
ava.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Lorg.bukkit.inventory.ItemStack; ([Ljava.lang.Object; is in module java.base of loader 'bootstrap'; [Lorg.bukkit.inventory.ItemStack; is in unnamed module of loader java.net.URLClassLoader @3b764bce)
at de.marvn.alphablock.alphawars.util.InventoryUtil.lambda$shopArmorItem$13(InventoryUtil.java:180) ~[AlphaWars-1.0-all.jar:?];```
this only accepts an ItemStack Array and I want to add new armor that
Well, this is the only way I could think of so far... What do you think? (InventoriesLang#getElement gets data from a cache)
EditableElement nameUnsetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_NAME_UNSET);
EditableElement nameSetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_NAME_SET, Map.of("{companyName}", companyName));
EditableElement ownerUnsetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_OWNER_UNSET);
EditableElement ownerSetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_OWNER_SET, Map.of("{companyOwner}", owner.getName()));
EditableElement creatorConfirmElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_CONFIRM, Map.of("{companyName}", companyName, "{companyOwner}", owner.getName()));
EditableElement errorElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_VALUE_ERROR); //todo add error parameters
EditableElement infoElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_INFO, Map.of("{price}", String.valueOf(price)));
EditableElement priceElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_PRICE, Map.of("{price}", String.valueOf(price)));
EditableElement cancelElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_CANCEL);
@Data
public class EditableElement {
private String displayName;
private String[] lore;
private Material material;
public EditableElement(Material material, String displayName, List<String> lore) {
this.displayName = ChatColor.color(displayName);
this.lore = ChatColor.color(lore);
this.material = material;
}
It's a bit of a mess, I know, but it's the only way I found to make inventories that customizable
list.toArray(new ItemStack[0]);
I think
worked thx
yes, I don't know. for the second day I have been looking for a way to convert Vector direction to Quarternion
this method gave me chat gpt, but it still doesn't work
do team prefixes not change the player's nametag color?
ew
we can static import right
How can i have in one item CustomEnchant (which i create with EnchantmentWrapper) and spigot Enchantment?
.enchant xD
Well, do you have any better idea? ๐
For messages?
Inventories
Ah
Well yeah
If the lang is not per-player I like to do my entire inventory stuff on config
And then just link some actions in code
Customisable Material, display name and lore through a config for each element of the GUI
.enchant what?
Yea
did you register the enchantment correctly ?
Yeah, this enchant is working when solo on tool
Hmh, so, donโt you use somebodyโs api?
Ohh, i will try smth
Well, thatโs what Im gonna do right now lmao, thank you
And then it's as easy as registering actions
Oh wait, how does the chars-layout work?
It's basically a mask
Where you have a line for each row
And a character for each item
And it gets the items and applies to whatever slots match the layout
Ohhhh, so it is a simple for Cycle, isnโt it?
took me 3 hours to write this all I think
What is different when i addEnchant to meta or addUnsafeEnchantment to item?
Hm, nice! Thank you!!
One does safety checks
as in
You can't apply infinity to a pair of shears type deal
Hi, I created a custom event called BattleStartedEvent.
It is part of a jar, that my server uses as a dependency and fires from the main thread. I can listen to it from the plugin that calls the event without any problem. Now my plan is/was to have add-on plugins that can also subscribe to this event. The registerEvents is called there but when I fire the event and chase the stacktrace, only listeners from the Caller are listed as registered listeners.
I googled a lot for this issue but can't seem to find anything. Is there something needed to subscribe to other Plugins custom events?
In the plugin.yml also a depends: is configured.
No clue how you're firing the events
Created a thread for it
Hello,
Is it a good idea to make it that way? I want to prevent specific players from taming animals if the condition is met. https://paste.md-5.net/uzuvuqumeq.cs
EntityInteractEvent
why not just cancel the taming event for that player
Is there such event?
Not really to be honest. But thank you, I'll start using that since now ๐
applyPatches generates those folders
to be clear, there is no way via the api to modify the bounding box of an entity, right?
I have CustomEnchants class, where i create custom enchantment (minecraft:mending_plus) with EnchantmentWrapper.
When my mending_plus is solo on tool (enchant is added to tool with anvil) its works, but when i take tool with custom enchant and add with anvil another minecraft enchant, for example efficiency, my custom enchant disappears from tool. Im trying this, but it returned null:
Map<Enchantment, Integer> list1 = firstItem.getEnchantments();
Map<Enchantment, Integer> list2 = secondItem.getEnchantments();
list1.putAll(list2);
so i need to rewrite my code and create enchantment like lore?
no
getEnchantments returns an immutable Map. You can;t add to it
Create an empty Map, then put all enchants from both
What is this bullshit
where's the error i can't see it here
Why does it come to this though? I entered one space randomly in an entire class and saved and now all of these red lines are gone
XD
its just IDE spacing out
yeah Eclipse...
by saving sometimes you're re-running the analysis
Ty
Hello, can someone help me with Player Ranks?
can I change ItemDisplay eye line in hitbox?
why should you
for example, move it forward towards this line
even the installation of eclipse sucks. "Do you wanna trust this untrusted stuff?"
and one can't continue if one does not trust this "Unknown" stuff
I still prefer free with no paywall ๐
I'll give it another try, but how does one compile using maven with it?
one sec let me open my ide
"Build all" is greyed out
Right click pom -> Run As -> Run Configurations
select maven build on left and click new icon at top
hello, i did a command which add section in config (especially data on item holded by the command sender) but i cant add 2 items in a row, i need to reload the server before add a new one, (my command ends with saveConfig() and reloadConfig() ), could you help me pls ?
everythign shoudl be auto filled in for you, just type clean package in the Goals and then apply/run
give it a Name of course
you can then run it from teh build menu
can't i just enter a goal "on the fly" without creating/editing the configuration everytime?
yes
e.g. what if I quickly wanna run mvn dependency:tree once?
I also don't have any autocompletion
Why esclipse :l inteliJ have a free version so
thx
just checking it out. I normally use IJ Ultimate
(args.length == 1 && args[0].equalsIgnoreCase("setitem") && player instanceof Player) {
if (player.getItemInHand().getType() != Material.AIR ) {
setItemConfig(player.getItemInHand());
main.saveConfig();
main.reloadConfig();
player.sendMessage(config.getString("Messages.Tag").replace("&", "ยง") + config.getString("Messages.Valid-Command").replace("&", "ยง"));
}
cant add 2 items in my config, need to /reload or it wont be safe when i execute this command
never seen that
it's a fresh install of latest eclipse, then I did FIle -> Import -> from Git -> entered URL -> add as general project (add as maven project was not an option)
if its maven on git you can select teh maven section
all I could find is Import -> Maven -> from SCM but that doesn't do anything
thats the correct place
well it doesn't do anything
there's no "git" in that menu, the menu is empty
looks like somethgin is up with your install
it's a completely fresh install
reinstalled it agagin, there's no "git" thingy in the maven stuff, but normally using Import from Git works fine, but then it doesn't understand it's a maven project
I can't see discord vids ๐ฆ
I can honestly say I've never seen that issue
make sure you have the M2Eclipse connector
that does not exist
its really old post, but I've never had to do it
i just found there's "m2e-egit"
weird that it's explained nowhere and that it needs a separate thingy even though it already supports maven and git standalone
I do remember having to install a connector years ago but I don;t remember having to in recent years
I wonder if it's a thing like the InteliJ bug when you cant import maven untill you have at least one maven project that was about a while back
Main issue here is that you do not have the JDT nature set up correctly
Then only thign I've had to do on intalls recently was edit the ini file
Well this could be caused by using Eclipse JDT for Enterprise or however that variant of eclipse is called
JDT? what even is that?
and where does one set that up?
Well it's called the Java nature
it only asked me for a JDK where I left it at the default value (my already installed java17)
but truth betold the maven nature should set up the java nature so it is odd that eclipse did not auto-detect it
But then I also highly avoid this feature
TL;DR eclipse didnt become any better in the last 4 years lol
using Git > Projects from git (with smart import) should usually work though
litterally the only thing I remember doing in the past few years is edit the eclipse.ini to set a java path
this is the wrong one though
It auto-detects what should be used pretty fine
its not good at importing maven
But these days I generally clone seperately
I just Check out Maven Projects from SCM
yeah after installing that "m2e-egit" thing, this works, however I'm not sure how someone is supposed to find out that this exact thing is needed, nor why it's not part of the default installation
Jesus - the "Check out maven projects from SCM" is atrocious to use. No suprise I never use that feature ๐คฃ
No clue I remember installing it years ago but not recently. Perhaps I just forgot
oh interesting
And it doesn't even do anything. Compared to smart import from git it is MILES better
on a clean install with an empty clipbopard my IDE behaves as yoru Alex
sorry with an empty clipboard it looks to work
it's all blank when you have a url on your clipboard
to be honest it does tell you about it
Hello, can someone help with scoreboards and player teams?
yeah but it shows a list of tons of unrelated stuff there (e.g. what's "buildhelper"?). most of these things are not "scm connectors" at all, and it also surprises me that it does support git, and maven, but not git+maven by default. also it's called "egit" and not git so one could think it's sth else than git
Those are integrations that need to be installed seperately to the maven plugins
if you want/need to use them
Because for some ungodly reason IDEs find it funny to run your maven projects in interpreted mode
eclipse really makes sure to be overly annoying. in IJ you do "New file from VCS", enter the git (or whatever) URL and then it automatically sees "oh, a pom.xml - must be a maven project"
(though to be fair this means that unlikely gradle you do not have any security vulnerabilities)
That is what smart import does
Like smart import is infinitely better and I have no idea why anyone would discourage it's usage
or you clone from git and import existing maven
that is best ofc
damn why did you not mention that earlier lol
I wasn't part of the convo back then
But I did once I realised what was so fishy about it
Okay after downloading the m2e-git plugin the materialize from SCM way also works but I still don't like it because compared to smart import it does not show you what exactly you are importing and gives you less control over it
Also pro tip: You can add the maven nature to any project after the fact by right clicking on the project, then going on configure and pressing on "Convert to maven project". If a pom is present, it will automatically set up all natures without a fuzz - otherwise it will ask you some basic information to generate the pom for you
Another pro tip: Use the project editor instead of the package editor - to this day I don't really understand why the former isn't the default.
But the differences are minor outside a multi-project setup
Hi !, i don't really understand the usefulness of the file config.yml ?
Well then you don't need it
then you don't have to use it
really, thanks because i throw that was not really useful but a lot of classes explain it and use it
interestign installing that m2e-git plugin broke my 2022-06 ide ๐ฆ
Wow, you are a whole year behind
ij 2023 isnt the most stable experience
I know some people are still stuck on Eclipse Oxygen (or was it Neon?) but those do it because they don't have another choice (i.e. newer Eclipse releases don't support Java 7- debugging)
can;t even rollback. it broke the transport layer
Guess you may need to manually yoink the plugin from the plugins dir
I'll probably just wipe and install a fresh as I use no customization
I have at least a dozen plugins that I forget to reinstall after reinstalling eclipse (such as the checkstyle integration, the (absolutely trash that I should probably fork) decompiler plugin or syntax highlighting plugins for various languages such as JSON)
it's to add user-configurable options, like this. if you don't need any, you don't need any config.yml
okay thx
hello! so im very much a newbie in terms of looking at minecrafts code and figuring stuff out, and i want to see on a 1.20 spigot server how lets say a shulker box is compressed. ive been told its under net/minecraft/nbt/NBTCompressedStreamTools.java, but i cant seem to find it in this file either. any help would be appreciated lol
i cant find that on spigot tho
do you have the remapped spigot version?
Nbtlo?
does anyone here know which enum to send in "ClientboundPlayerInfoUpdatePacket" to add a new entity to the client list?
1.20.1
i just installed the 1.20.1 server with buildtools and ran it once
run buildtools with --remapped, then you get the mojang mapped classes
I couldn't figure out how to get the remapped one recently so I just went with the obfuscated lmao
with proper method names etc
I'm stupid lol
?nms
But tbf I don't really care at this point
(probably a dumb question): i ran this. where did it put it
i looked at Spigot/Spigot-Server/src/main/java/net/minecraft/nbt
and it doesnt seem to be there
aaaaaaaa i never did java before aaaaaaaaaaaaa
gotta look up a tutorial ig
i have no experience in anything other than c ๐
Oof
Well, you'd need to learn naming conventions, keywords and other java stuff
Since you are familiar with programming, it shouldn't be hard
it's one of those days
Lol
Hi, Ive created a custom boss and im wondering how do i add a boss bar for it? and when the boss takes damage do i manually need to update it or will it update itself?
how can i make it smoother with teleports? For example, if I move an entity by 0.1 every tick, it turns out to be twitchy.
- this is about Display Entity, like others move smoothly
why wouldn't you make a file that you would read data from and then you can call saveResource() on that file
.
that's half of how the tutorial works
saves you from hardcoding even though it's still kinda hardcoding haha
but not exactly
the other half would be way too complex to make configurable
but yes
ah, in that case i wish you and your nerves all the best
or at least to make it worthwhile
How can I color Peoples name and they cant hit the people in their own team? Its for bedwars
1 - scoreboard teams
2 - make an event handler
if you're making a minigame plugin we expect you to know the basics
It my first minigame....So no
you make the display entity ride an armor stand since they have position interpolation of 3 ticks instead of interpolation of 1 tick
Also, if possible, you can use the display interpolations.
Cannot invoke "java.sql.Connection.createStatement()" because "connection" is null
why im getting this error
Because "connection" is null
i have checked every thing in the connection
this one doesnt seem to be useful because there is an option where you can disable pvp with teams
and also getting this
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
even i have installed the jar
of mysql-connector
and put it in the build path
and also tried maven
tried all the solutions there
You were using class.forName?
install mysql-connector.jar done
install mysql-connector from maven done
yes
public void connectToSql() {
try {
synchronized (this) {
if(getConnection() != null && getConnection().isClosed()) {
return;
}
this.getLogger().info(Translate.connection_msg);
Class.forName("com.mysql.jdbc.Driver");
this.setConnection(DriverManager.getConnection("jdbc:mysql://localhost:3306/cat", "cat", "sdmdfsdfsdfs"));
db = getConnection().createStatement();
}
} catch(SQLException e) {
System.out.println(e);
} catch (ClassNotFoundException e) {
System.out.println(e);
}
}
if you are shading the latest mysql driver, that is the wrong class
then what's the right one ?
com.mysql.cj.jdbc.Driver
i will try that
didn't work
what is the error
java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
are you relocating ?
i don't think so
what mysql driver are you shading
which of these should be used? or should i set it to 0?
im using this in my build path
mysql-connector-j-8.0.33.jar
im using intellij idea and when i installed it i went to project structure -> libraries -> from maven
im using the default with intellij idea
I'd highly highly recommend checking out either maven or gradle
to define all of this via files instead of intellij configuration values
well both
Look up display entity wiki
normal minecraft wiki
quick question what value does getWalkSpeed return when the player has no effects?
bing answered faster than yall
Who in their right mind asks a support chat before trying to find the answer on a search engine 
i searched it up and couldnt find anything
and i dont use microsoft edge
so i had to open it
but my lazy ass didnt want to
tell me why my plugin to search for a specific zone creates a lot of some files in the world/region when the plugin is launched
does it have something to do with worldguard?
after a sharp shutdown of the PC, some kind of error appeared in 1 file and I deleted it
before this worldguard rampaged in the console
Asking again just in case, anyone familiar with unit testing their plugins? Specifically with mockito and maybe mockbukkit?
EntityTameEvent is not working, tried to use event.setCancelled(true) but didn't work. Any ideas?
this work maybe you have mistake
I just called the event and cancelled it
pay us and we'll answer quicker
venmo?
no
alr then no money for you
i somehow doubt many people that give help here use venmo
package com.justxdude.islandcore.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityTameEvent;
public class testListener implements Listener {
@EventHandler
public void test(EntityTameEvent e) {
e.setCancelled(true);
}
}
Literally, registered it of course...
Yeah, it's fired after taming occured... :V
Is Interpolation called when it teleports?
does someone know how to fix this? My IJ is stuck in the "Loading indexes" part. I already deleted the .gradle and .idea but it didnt solve it
no, those are different things
as I said, if your use case allows it, you should use interpolation instead
Look up what it is, CloudWolfs video might be good
Have you tried file > invalidate caches?
I had the same issue before. I fixed mine by just reinstalling IntelliJ.
I'm trying to rotate an ItemDisplay using the player's direction. But the x, y, and or z rotation axies are always messed up, I tried -, flipping them around, but there is always at least one axis that is wrong:
val direction = player.eyeLocation.direction
val direction3f = Vector3f(direction.x.toFloat(), direction.y.toFloat(), direction.z.toFloat())
val up = Vector3f(0f, 1f, 0f).normalize()
val leftRotation = Quaternionf().lookAlong(direction3f, up)
val rightRotation = Quaternionf()
val scale = Vector3f(1.0f, 1.0f, 1.0f)
val translation = Vector3f()
val transformation = Transformation(translation, leftRotation, scale, rightRotation)
is there an entity collision event
no
why isn't gradle picking up the class I just added to another submodule implemented by this one
Its so annoying
I've tried refreshign and restarting no luck. Still no luck I hate gradle
i don't understand mongedb i store datas in json ?
the database you choose should reflect the data you need to store
yeah
well technically its Bson
but samething in principle
but i can't find some options
example unique id
and mongodb creating id,
Bson supports Unique IDs
Bson supports more data types than MySQL
you throw entire world files in those documents and it handles it very well
postgres supremacy
Is there a way to refresh dependencies in gradle? I seriously wanna cry righta bout now can't find what I need on google either ๐ญ I just want the new class I added to work without having to fucking refresh everything. This takes 2 seconds on maven
I already tried ๐ญ i t just doesn't fuckin work
"Refresh gradle dependencies"

WWell, you can try the --refresh-dependencies flag on the wrapper ?
GAHHH I was on a streak I've been using gradle for like every project this is the closest I'm getting to going back to maven like wtf it should just work like it does on maven
with maven I don't even need to refresh
maven certainly also needs refreshes
when I add a class to an already depended upon subproject I don't need to manually do anything which is 100x nicer than having to refresh every time you edit a class
if you are using a snapshot dependency, both maven and gradle are going to cache it locally for a configurable timespan
neither in gradle
I feel like you are doing the multi module wrong
can you share the consuming modules build.gradle.kts
e.g. the module that depends on the other module
How can I check if a block was blown up by tnt so I can cancel the block?
plugins {
id 'java'
id 'io.papermc.paperweight.userdev' version '1.5.4'
}
dependencies {
compileOnly project(":nms:base")
paperweightDevelopmentBundle('io.papermc.paper:dev-bundle:1.19.4-R0.1-SNAPSHOT')
}
invalidating caches fixed it
yea no that should be fine yea
idk wtf IntelliJ cached but ๐คทโโ๏ธ
No, these are components of a database
Each does something vastly different
groovy dsl 
mad cuz bad
fr
groovy ftw
its less horrifying than the scuff that is kotlin
groovy reminds me of spicy python lol
u havent just hurt my eyes, but my soul ๐ข
Well if I wanted to use a weird ah looking language I'd use one that has some benefit and learn rust :P
u goofy
:]
as Originally a Python dev I rather learn Spicy Python than Java's malformed baby brother
lol "malformed baby brother"
Title.Times times = Title.Times.times(Duration.ofMillis(fadeIn*50), Duration.ofMillis(duration*50), Duration.ofMillis(fadeOut*50));
if (Objects.equals(mainTitle, "")) {
players.sendTitlePart(TitlePart.SUBTITLE, Component.text(subtitle));
return;
}
if (Objects.equals(subtitle, "")) {
players.sendTitlePart(TitlePart.TITLE, Component.text(mainTitle));
return;
}
Title title = Title.title(Component.text(mainTitle), Component.text(subtitle), times);
players.showTitle(title);```
how do i apply the times to a title part? it only lets me do the title part and text component
https://paste.md-5.net/uzemejasef.css This is the first time I've gotten an error and I genuenly have on fucking clue what this means
Are you using reflection or smth
no final net.minecraft.world.item.ItemStack item = craftItem.handle;
that's the aforementioned line
Try using getHandle instead of just handle
I don't think you have access to that field
This is Paper API
Paper Discord will help you better
oh ok
What is the 1.20.1 nms maven dependency?
?nms
CraftItemStack has no getHandle method
But replace 1.18 with 1.20.1
ah right there should be a different method
1 sec let me check
yeah its package protected lmfao net.minecraft.world.item.ItemStack handle; why does intellij even have that has an option then
so confusing
Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT
Did you run build tools with the remapped flag
CraftItemStack.asNMSCopy(bukkitItem)
yeah you're supposed to do that though I'm doing naughty things though so I think I'ma do reflection rather than keep making copies
๐
Where am I supposed to get the buildtools jar? Error: Unable to access jarfile BuildTools.jar
?bt
You need to open cmd in the folder with the BuildTools jar
What's the difference between getField and getDeclaredField again
Not sure actually
I do know that getDeclaredField works most of the time
If it doesn't then you use the other method
getField only yields public fields
ahk
Thanks ๐
So now when I refresh maven I get this Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT
If I comment out this in my pom.xml it works <classifier>remapped-mojang</classifier> but I can't build it like that
How can I make the player face a specific Block?
got this while updated LostSkyWars plugin from 1.8 to 1.20
Is there any smart mathematician that can explain how can I understand leftRotation and rightRotation rotations? Why there is not just one property for rotation? Also how can I convert given rotation in Vector3(x,y,z) to those leftRotation and rightRotation Quaternions?
i also have no clue, all I managed to do was to experiment with those rotations a bit as shown in this video, which probably doesn't help you at all lmao: #help-development message
same here, i just gave it a custom scale and changed the rotation via its location
none of that is really documented either
maybe check the minecraft updates n stuff
At the time being I only find out that Transformation is later converted to Matrix4 that is used by OpenGl to render stuff
Martix4?
its just class that holds flaot[4][4]
/summon block_display ~-0.5 ~-0.5 ~-0.5 {Passengers:[{id:"minecraft:block_display",block_state:{Name:"minecraft:acacia_fence",Properties:{}},transformation:[1.0000f,0.0000f,0.0000f,0.0000f,0.0000f,0.7071f,0.7071f,0.0000f,0.0000f,-0.7071f,0.7071f,0.0000f,0.0000f,0.0000f,0.0000f,1.0000f]}]} Here is example of loading transformation as Matrix4
I found some article about Transformations in OpenGL, RightRotation is OrginalVector whatever that means
Easier to just use the 3 components rather than try and make a 4x4 matrix
Sure, I'm just trying to understand what is right_rotation for
isn;t left and right just the order in which translations are applied?
I guess it's just how quaternions work
Its been a few years since I messed around with quaternions (for a space game) but if I get time tomorrow I'll have a play with displays
Are there any particles that can be custom colored
with a hex or just default color
Redstone dust is really the only one that comes to mind
I guess maybe splash particles too. The only other one is notes but I don't think you can control the RGB on that
Well, "requires", yeah. It's optional
How do you make a pull request to spigot?
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
PRs are appreciated but if you don't feel comfortable signing the CLA, at least a JIRA issue goes a long way
Why does it need the mobile number? ๐ค
I mean, my feature I wrote is only like 8 lines long ๐
#general message
The sniper needs you to pick up the phone before he can dramatically shoot you
That's the secondary reason
Your PRs are of higher quality when the sniper laser's pointed right at your forehead
what about the kangaroo working for the dod that tracks ur mobile to come say hi
I mean, if you need to contact someone wouldn't you just message them on discord?
How do you make a player bounce off (that i've implemented), from a certain location? BUT on PlayerMoveEvent, also with cancelling support. For some reason if I cancel the event, the bounce off thing doesn't work, I just vectorize the player location and invert it..
Eg. player is trying to enter a region that they shouldn't ented and on the border, as soon as they walk into it, I bounce them off, however it's kinda glitchy, without multiplying the vector the player can just glitch in the region, because I can't cancel the event and bounce the player back in inverse location at the same time (if i cancel the playermoveevent, nothing happens, as if i didnt bounce the player back)
So how is this normally handled and how it should be handled? with bouncing the player back thing?
i doubt its to actually contact you, that would be done on the pr or by email most likey, id say its probably legal stuff
Personally that's what'd likely put me off contributing sadly. On Paper you can just make a github pull request and it's all good but with spigot you have to put your mobile number in etc of which is slightly iffy. I do trust you guys but I don't even give my numbers out to my friends lol.
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
the DMCA of 2014 D:
Like mostly everyone was upset when bukkit and spigot got hit :/
I honestly don't know what to do now. Here's me thinking "oh that'll be a quick 5 min pull request" now I gotta sign forms etc
CLAs aren't exactly uncommon
How do you run a command in the chat as a player again?
dispatchCommand or something? was it?
Bukkit.dispatchCommad or player.chat
Also, any good guide/ on multi-paged GUIs? It's the best to implement it myself?
or just use an already existing util class or something
idk if there is one
There are many libs you can use
Want to clear all sniffer locations.
Could you please tell me 1
I don't want to spend a few days writing it
handling everything
Thank you!
this seems very janky, is there a way i can improve it?
@Override
public @NotNull Map<Material, List<PlayerGenerator>> convertGenerators(@NotNull PlayerData data) {
Map<Material, List<PlayerGenerator>> formattedGenerators = new HashMap<>();
PlayerData.Data playerData = data.getData();
List<PlayerGenerator> generators = playerData.getGenerators();
if (generators.isEmpty()) {
return formattedGenerators;
}
for (PlayerGenerator generator : generators) {
PlaceableGenerator placeableGenerator = (PlaceableGenerator) generator;
Block block = placeableGenerator.getBlock();
Material blockType = block.getType();
List<PlayerGenerator> matchingGenerators = generators.stream()
.filter(g -> ((RegisteredGenerator) g).getRegisterable().getDropItem().getType().equals(blockType))
.collect(Collectors.toList());
formattedGenerators.put(blockType, matchingGenerators);
}
return formattedGenerators;
}```
like 0 way i'm keeping this
๐
you can release it independently i guess
but thats not optimal
True. But blocking visibility of PRs is. Everyone just uses some action or plugin or whatever to make sure the author signed the pr they opened.
i havent found a cla that asks me for my address or phone number before
on github its just usually sending a message in the pull request
I canโt speak to how often certain info is asked for in CLA, but Iโve seen plenty of repos that have tools that make sure the author has signed it
I'm trying to set up a playtime objective, but failing
On enable,
if(scoreboard.getObjective("playtime") == null){
scoreboard.registerNewObjective("playtime", Criteria.statistic(Statistic.PLAY_ONE_MINUTE, EntityType.PLAYER), mm.deserialize("playtime"));
}
this.playtime = scoreboard.getObjective("playtime");
on player join,
Score playtimeScore = playtime.getScore(player.getName());
if(!playtimeScore.isScoreSet())
playtimeScore.setScore(0);
I'm guessing it has something to do with statistics criteria, because other objectives work properly
The score stays at zero
I also tried it without the EntityType.PLAYER
Yeah you shouldn't need the EntityType for that
Criteria.statistic(Statistic.PLAY_ONE_MINUTE) should work fine
Also, I'm doubtful this would work onEnable() because you can't do anything with scoreboards while plugins are enabling. There is no scoreboard manager.
im making an rtp gui and when i click an item in the gui, i get random teleported, anyways when i use:
player.closeInventory();
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
teleportPlayerRandomly(player);
});
it just closes my inventory, but doesnt rtp (yes rtp should work i alr have the function) anyways when i use:
teleportPlayerRandomly(player);
player.closeInventory();
it works. How do i fix this, i want to use asynch since it reduces the lag when i press the item in the gui and the rtp itself.
Are there any errors
nope
asynch does make the item click into the next indent of commands faster (or however you say it) but it just closes the menu, doesnt rtp at all
is here someone that is a pro in setting up scoreboards? (i got some issues with mine)
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
why dont you ask your question directly?
ok, so
i got teams on my server and once i apply a newscoreboard for every player, only the player can see their own rank, but not the other players
?nocode
Itโs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
?paste
who cares about effort
Itโs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
ty
im pretty sure all players have to use the same scoreboard
unless you are doing stuff with packets so that your teammates are green and enemies are red
how do i display personal stuff like money on the scoreboard?
if everyone has the same scoreboard
then i cannot display personal data
that depends on the plugin
wdym by that?
for example {Player} for the player or whatever dont tell me if im wrong, anyways for example u have an economy plugin, it basically uses these for example {eco} (now again dont tell me that im wrong because i know i suck at java) but not all have the same ones
one could have {economy}
one could have {money}
one can have {balance}
but still i dont know if you use curly brackets for this
the thing is if they share a scoreboard, it does not display their individual stats
bro what
it displays the stats of the last player that applied their stats to it
yes bro i totally suck just dont point it out
thanks
i recently got into java
thats why
i dont know the basics
then dont try to help
idk
ok :(
try making a thread
and putting the link in here every now and then
if you have teams like admin and moderator, each scoreboard has to have them as well
for players to see them
so i have to register them there too?
the sad part is im creating teams for each individual player
ohh
with an algorithm
you have to create the teams on every scoreboard
and add each players in the correct teams
idk if that was clear
but if i add the player to a team from a different scoreboard, wouldnt that not work?
the player doesnt have to have that scoreboard
it just has to be in the scoreboard's team's entry list
entry array
idk
ok
just read the thread's answers
ok, thank you
how to i stop my rtp from teleporting into water
it actually works! thank you, you kept me from going insane, one question tho for (Player onlinePlayers : Bukkit.getOnlineplayers()) will run the command for each individual player right?
check if the block below is water
if the block below is air keep checking until you hit !air && !water
yeah
do you know how to add that, since i dont know much about java.
would make more sense to write player instead of onlinePlayers
it's basic programming
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.
Then you won't succeed in making a properly functional plugin.
Another good resource is TheNewBoston on YT. Old videos but very good, short-form and still relevant.
Go through at least just the beginner series, it can be done in half a day.
chatgpt helps me lol, and before u say its a bad way, yes i know.
im gonna try learning it tomorrow
well
today
Gonna take you abit more then half a day to learn java :/
you mean the basics of java?
or just some of the basics
Java
You learn java before spigot
spigot is an API, an addition to the base of Java
You should know you can't replace a String by simply entering an entry with brackets
i never even mentioned spigot
i just asked if he meant all basics of java or just some of the basics of java
and what do you mean by this, i also never mentioned my code
...
Of course all the basics. How are you ever going to go anywhere if you dont know ALL the basics
they are basic
basic basics
well i asked since he said beginner stuff in half a day, and you said it probably takes longer than half a day, but im not fully english so obviously i dont take beginner and basic as the exact exact same thing, thats why i asked.
oh yeah i forgor
The "basics" will take you several months the master. You should be fluent in Java before moving to spigot
i never tried to learn spigot, i have just been trying to make guis using deluxemenus, and also skript, but i realized it isnt as hard as i thought to make plugins.
and making plugins is not as messy as having to configure files and having multiple commands to make multiple gui's just to make a "next page" button
when all i actually need to do is make 1 plugin, with 1 resource pack to make a custom rtp gui instead of having it this messy
how accurate is isSimilar? if I have a custom item, but then someone puts an enchant on it, witll the isSimiliar still return true or false?
False
Thats what i thought ok.
Iirc isSimilar is just equals but ignoring stack size
ugh okay, I think it would work better in my mention way above, but I guess that makes sense.
Yeah I know I use pdc all the time, I just hate having to constantly create keys. I always forget and Fleet sometimes likes to be stupid and not tell me that i forgot.
fleet for java??
Just make all your keys once and store them in a constants class
yea its what I got now. its just that I forget to actually create the key lol
yup. Use it for python, and js as well.
i tried it but the smart code or the intelli sense what ever its called is super buggy
Yeah it is. it still is. not as bad anymore though.
I only use it because its super lightweight. Runs well on my macbook. Which struggles with intellij sometimes.
?paste
https://paste.md-5.net/qunewagivo.cs
https://github.com/JEFF-Media-GbR/ArmorEquipEvent
Events are not being called.
Did ya register both your events and the libraries events
oh shit i forgot abt the library events.
I know ๐ข I recently restarted my project and used oold code from before. I just forgot abt that.
does anyone know why this is spamming my console with errors?
public class OnPlayerMoveEvent implements Listener {
// public Hashtable<UUID, Location> player_last_location = new Hashtable<UUID, Location>();
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player p = event.getPlayer();
if (p == null) return;
if (event.getFrom().getX() == event.getTo().getX() && event.getFrom().getZ() == event.getTo().getZ()) return;
// cancel home timer if they move
if (CooldownManager.hasHomeTimer(p.getUniqueId())) {
CooldownManager.cancelHomeTimer(p);
}
if (CooldownManager.hasLogoutTimer(p)) {
CooldownManager.cancelLogoutTimer(p);
}
ClaimsManager.relayPlayerInClaim(p);
}
}
``` ```
18.07 04:28:17 [Server] [ERROR] Could not pass event PlayerMoveEvent to hcfcore v1.0-SNAPSHOT
18.07 04:28:17 [Server] [INFO] org.bukkit.event.EventException: null
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
post your full error
not half of it
18.07 04:28:17 [Server] [ERROR] Could not pass event PlayerMoveEvent to hcfcore v1.0-SNAPSHOT
18.07 04:28:17 [Server] [INFO] org.bukkit.event.EventException: null
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:270) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:57) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
18.07 04:28:17 [Server] [INFO] Caused by: java.lang.NullPointerException
18.07 04:28:17 [Server] [INFO] at org.ayple.hcfcore.core.claims.ClaimsManager.relayPlayerInClaim(ClaimsManager.java:147) ~[?:?]
18.07 04:28:17 [Server] [INFO] at org.ayple.hcfcore.events.OnPlayerMoveEvent.onPlayerMove(OnPlayerMoveEvent.java:46) ~[?:?]
18.07 04:28:17 [Server] [INFO] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) ~[?:?]
18.07 04:28:20 [Server] [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292]
18.07 04:28:20 [Server] [INFO] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292]
18.07 04:28:20 [Server] [INFO] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:20 [Server] [INFO] ... 15 more```
if im comparing 2 invs i need to implement inventory holder?
Im trying to make it so when ToolMenuManager.openToolMenu(playerMenuUtility); is called https://pastebin.com/MSLLb3rw it opens the menu of the tool the player has selected for example an elytra here https://pastebin.com/5qAQ55Y2 but the line is not working. here is the toolmenu manager class also https://pastebin.com/5XTKsWEx any help would be much appreciated !
Hi, someon have a tutorial for pagnited gui?
There are a few libraries out there that make it easy to make paginated menus
Iโd suggest you to make your own library, makes it simpler to understand
I don't want use library. I want make my own system.
Then I donโt think there are tutorials for paginated menus out there
To make your own system you can try to imagine it first, or insipide yourself from other libraries and how they did it
I hope you have improved the code with my suggestions from yesterday.
Anyways, what exactly is not working ?
yes yes i have -> https://pastebin.com/nNaTP9av. when i click the back button on the enchantment menu it is not returning to the tool menu of the players selected tool. it was working previously but i had to change the code for the person who needs it and then of course change it back to how i had it originally.. when i click the back button literally nothing happens and there is no console errors or anything
Hmm.. have you tried debugging it ?
Like putting printouts everywhere :D
Are you sure the slot ids are correct ?
Also, the ToolMenu is missing @Overrides (That is not the source of your problem tho)
yeah, ive done a little but ill go back and just add printouts everywhere. and i will fix the tool menu. thank you for your help
Hey so I am wanting to set a block facing a player (dispenser in this exact situation but will be others) how can I get direction based off block face? (They click on a dispenser and I want it to cancel the opening of the GUI and just set the block facing them)
or like is there some way to turn a player direction into a block face direction?
I think there was a method specifically for this
Im stuck in 1.8 currently so im not sure if there is lol
If you can get where the player is facing then the half of the work is done
well I can get the pitch and yaw and the direction vector
There was a method in nms to know where the player is facing with blockface or smth like that, unfortunately I can not help a lot since I am unable to use my pc anymore and all what I have is my phone
You simply need to look through player's class to see if there is anything you could use to know the direction as blockface
or just ask chatgpt, it will be more helpful then me lol
CraftPlayer or?
Imma just do this lol worked in the past a lot
It isn't that complex
It's just a list of itemstacks and a method to render a page
?pdc for self bc i never used them n want 2 use them for something
That just segments the list
:/ its just telling me to use Packets
this should work as a pdc wrapper, right?
actually maybe i should make a wrapper that gets instantiated builder-style
look back a couple of days. mfnalex posted a nice pdc wrapper in here
this, ye?
yep
There is a getTwoLastBlocks method
Just google "spigot player direction block face"
a
how can i register 2 commands
getCommand("ancient").setExecutor(new bosscommand());
getCommand("reaper").setExecutor(new bosscommand2());
that gives me error
What error
wait
did you know that if you send a player a sufficiently fucked up chunk data packet you can crash their entire client
Post the full error
which symbol can't it resolve
named bosscommand 2
Did you know that you'll be banned from spigot if you post a plugin that does that lmao
xd
Post the full log
๐
how to post the log ;-;
._.
Obv
no
Like, you get a whole log with a stacktrace when you build the plugin, right?
the fields declared in PersistentDataType obviously are of type PersistentDataType and not of Type
in intellJ
?
Well, where does it show an error
so change Type<T,Z> in your own methods to PersistentDataType<?,Z> @buoyant viper
Do you have bosscommand2 ?
Also for the love of fuck, use the java conventions
What is the command for it guys
true
i do
I want you to tell me what the error is
