#help-development
1 messages · Page 1417 of 1
im trying to learn how to limit ores in chunk generation atm
Can a player input an infinite amount of characters inside an arg? or should I make this by my own?
?paste
stack trace?
valores is null
i know
but, i dont have idea to make is not be null
entry.setValue(numberReports);
init it
public static List<Entry<UUID, Integer>> valores = new ArrayList<>();
nope
right, thanks
does null make a string empty?
The NullPointerExeception error came out after I init the ArrayList, however, it is not returning anything in the command event
show me ur code
?paste
What line does it have the exception in?
.
now, i dont have any exeception
but dont work anything
hmmm
before i having theses error
null excep
idk bcz I don't see anything wrong
maybe there is something but I can't find it
one moment
oh lord
people, i'm a bit of a layman in creating some systems, in my case i would need to make a category system where i define several locations in a world, and ends up spawning a particular item in this location with a list of various types of items
I have a block location and I want to fill blocks around it, is there any way to do so?
I have location of gold block and I want to fill diamond blocks
add vectors or single numbers to the location
wdym?
if (block.getType() == Material.CHEST){
e.setCancelled(true);
Location loc = block.getLocation();
int x = (int) loc.getX();
int y = (int) loc.getY();
int z = (int) loc.getZ();
}
this is what I have
throw some for loops at it or hardcode the relative locations of the diamond blocks
then add that relative location to the location of the origin block
and check whether the block at the resulting location is diamond
How I can set item in EntityPickupItemEvent?
event.getItem().setItemStack()
I haven't this ;/
Edited
i’m trying to change a player’s skin, i know how to do it for other players but it is not visible for the player who’s skin is changed
is it possible?
My question: How can I check if a player place an item in his inventory from a chest?
Packets I guess
the given itemstack is mutable
ik i need packets but what type of packets
I will never enter packets dimension 🤷
protocollib makes fucking with the protocol quite a bit easier
ok so do i need to overrides the player list packet sent to the the client giving info about the skin?
sounds about right
ok i’ll try..
nice joke
yes
if you don't put anything in a variable, the variable is empty
aka null
String variable = null;
and
String variable;
are the same thing
yes
do you want to ask it at some point
Not primitives
for primitives a default value of 0 or false is used
Hello, quick question: How do I rotate an anvil? I want it to spawn facing the same direction the player is facing, but couldn't find any method to do it anywhere.
it's probably Directional or something
come to think of it, is there even any documentation to refer to to figure out which blocks' blockstate/blockdata implement which of the interfaces?
i've always just kind of eyeballed it
i want know how i can make this system understand
guidelines at last
Hello is there any way to stop a player from leaving the boat? I was trying to cancel the VehicleExitEvent but that doesnt work...
@EventHandler
public void onPlayerLeaveBoat(VehicleExitEvent e)
{
if (e.getVehicle() instanceof Boat)
{
System.out.println("Player Exit");
e.setCancelled(true);
}
}```
can someone help me set a world border?
is there a better way to tabcomplete items other than listing them one by one
Well you have Material#values() and Material#isItem() in your arsenal, Ivj
can someone help with world border
thx
?paste
why does intellij give me a crap ton of errors when using
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
}
most helpful
I just corrected the link above
you should learn Java
You must return something
a List<String>
oops
How can I make entity to attacks everyone?
with pathfindergoal
Targeting entity : ```
this.goalSelector.a(1, new PathfinderGoalNearestAttackableTarget<EntityHuman>
(this, EntityHuman.class, true));
(But without humanentity)
feels like modded
so im using spigot api and the commandexecutor thing i implemented it and it isnt working?
Prev version 1.14 you could make inventories larger than 54 slots. Now you can't. Maybe with the user of resource packs but I haven't tried that.
rn the guy that sent the photo
said that it's client side
lol
nice
Cool
Still only works prev 1.14 unfortunately.
u sure
I am
i swear i seen that above 1.4
and maybe for menus with certain titles, they render the playerinventory diff
anyway why not working lol
probably just an rp
What does the error say?
can you not overwrite a value for a addDefault()
plugin.getConfig().addDefault(uuid + ".helmet", helmet);
plugin.getConfig().addDefault(uuid + ".chestplate", chestplate);
plugin.saveConfig();```
it doesn't update the value anymore
Try clearing your caches and restart your IDE.
idk how to clear cache but i did restart my ide
Is CommandExecutor properly imported?
ye
Screen
I don't think that will override a value. I think the point is that is provides a default value if one is missing or else the specified value. Not 100% sure.
how do i set a value which will be changing a lot
User set although you will lose comments
wait what
i saved a config in my plugins folder and it had comments
Yo, how can I async resolve the player, before doing
skull.setOwningPlayer(player);
inventory.setItem(skull);
so that if the lookup for it should fail, I can at least catch it and it doesn't crash the main thread.
If you use set and then save the file then comments are removed.
it won't crash but paper makes a massive fuss about a exception cause it apparently locks up the thread or something
u sure
go ask in paper 🤷🏿♂️
what are comments
- They only want you to use something from their API
- This is a Spigot plugin, I just run my personal server on Paper
Instead of questioning me then just go ahead and see for yourself.
and I mean, Spigot must have some solution to this
if the player is null just dont set them as the owning player
Green lines.
oh
that's not the problem?
It's when the lookup on the Yggdrasil API fails or times out that it may see the thread as "locked up"
but can u tell me whats the problem..
Yggdrasil is the internal Minecraft authentication library/system
Nothing that I use
There is no problem? That is just how it is implemented.
it's just when you do inventory.setItem and you give it a skull Spigot will call a yggdrasil method to get the players information
no i mean my problem ...
i think you're just overthinking it
like with the commandexecutor not working
Maybe send a screen of the whole file. Would make it easier to see. Also what is in the AbstractCommand class.
how come
you will not lock up a server's main thread by causing a non-internal NPE
i've never seen it happen
just do the method, if it doesnt work debug it
ok
show your code
because of a network call from spigot
Bukkit.getScheduler().runTask(BlockProt.instance) { _ ->
for (item in items.indices) {
inv.setItem(item, items[item])
}
}
and in an async bukkit task before that I populate items with a skull each,
val skull = ItemStack(Material.PLAYER_HEAD, 1)
val meta = skull.itemMeta as SkullMeta?
meta!!.owningPlayer = player
meta.setDisplayName(player.name)
skull.itemMeta = meta
it's not an exception
how do u know
Yea that is odd. IntelliJ has something called "Invalidate Caches / Restart". Eclipse probably has something similar.
Cause I thought that when doing setOwningPlayer or create the SkullMeta the network calls would go through, so I made that part async.
Turns out it's the inv.setItem part that is actually performing the network calls.
But in the end it doesn't really matter
just
How many items are you processing?
(Dont do it async)
It was I think 7 before
Doing 1 helps out and doesn't make the thread lock up for 10 seconds
Still it could be more than 20 calls theoretically
Which is why I would like to do this async
With some kind of Bukkit API or similar
it is odd but idk where the eclipse clear cache is idk if eclipse even has cache
maven in eclipse?
ye?
just cache, then project menu -> clean
else right click your pom -> maven -> update project
i did didnt work
gave me error
Looks like your project structure is wrong
I'm pretty sure resources should not be nested that deep
isnt it meant to be in src/main/?
I couldn;t say for sure. I use a custom layout
how do u do that?
i kinda want to move everything into src lol
Should be something like this
how can i get the name of an advancement instead of this: org.bukkit.craftbukkit.v1_16_R3.advancement.CraftAdvancement@160e3cc3
yeah thats what it is ..
without the test folder tho
Yep, I just created a new maven project and that is correct
what does your problems tab show?
it says that the methods dont exist
in 4 different classes
even tho it is a method
of CommandExecutor
Hello https://github.com/Espiiii-debug/SpigotPluginTest
I cannot retrieve my global variable in the ChatEvent.java Because the variable in this class is null. Please help me.
Variable location : QuestionCommand.java
thats from bukkit
idk
maybe u never set it?
if your global variable is null then the problem isn't that you can't retrieve it
it's that it's null
I'd recommend implement the CommandExecutor in your abstract command class, then override it
null is null, retrieving something that is null gets you null
i did
ohg wait i read that wrong
oh
ok
My variable is however defined during the execution of the command. But the new value is not up to date in the event chat
then you're reading from and writing to in the wrong order
nah didnt work
How can I correct it then?@wraith rapids
by doing it right
is your src folder set as your build path?
yes?
anyone uses eclipse need to switch intellij idea for better experinece
eclipse will do more suffering
right click src -> build path. If there is an option to remove it, then it is
Guys, quick question. I need a good world manager plugin 1.16.5 (Like the old multiverse-core), does anyone know one?
multiverse-core
Is it still good?
ye
it's as good as it was before
lol
Ook thanks.
not me.
I saw some servers that use some slimy thing
I use my custom world manager
idk the name
slimeworldmanager
that's not exactly a replacement
it's not a world manager i know
it technically is
but
it only creates void worlds
atm
but you're able to store worlds in DBs instead
else in files it's way smaller sizes
slimeworldmanager ^^
for example originrealms uses slimeworldmanager
except grinderwolf modified it so it can create actual terrains
slime format worlds are more geared towards minigames and whatnot
for player's personal realms
Slime World Manager is a Minecraft plugin that implements the Slime Region Format, developed by the Hypixel Dev Team. Its goal is to provide server administrators with an easy-to-use tool to load worlds faster and save space.
yeah you'd probably use SWM for skyblock tbh
that's what hypixel does
bc swm is based off the slime format in hypixel
If I need to load and unload worlds very often, what should I use?
but definitely not intended for your regular survival worlds
just use multiverse core
hypixel also uses slime for player housing but i think that's it
small and static
it's a v good plugin but idt it's being maintained if i remember
i cant fix my shitty thing :(
since grinder is focused on originrealms atm
How do I get something like this for when someone searches for my website? (I use NamelessMC)
what shitty thing
whats wrong with it
ok thanks
presumably it's shit
oncommand from bukkit class CommandExecutor doesnt work
define doesn't work
and i need to use it
send code
wdym onCommand
you mean
I see no reason for your error.
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){}
?
saying this dont exist @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
You have the correct import and its not showing any error on it
no i meant its erroring
what is saying what doesn't exist
are you implementing CommandExecutor
yes
show pls
Show your pom
my pom is legit like default pom u would have
what's the error
Does anyone have any idea why when I send a playerinfopacket with inside an entity with a skin to a target player if the target is still joining it spawns the npc without rendering the skin?
it wouldnt be intresting
why are boots not being set to "None" when i have none on
if (p.getEquipment().getBoots() == null) {
String boots = "None";
}
else {
if (p.getEquipment().getBoots().hasItemMeta()) {
boots = p.getEquipment().getBoots().getItemMeta().getDisplayName();
}
else {
boots = p.getEquipment().getBoots().getType().name().replace("_", " ").toLowerCase();
}
}```
its legit standard for some reason when i saved it it saved as xml but its pom https://paste.md-5.net/orobepujep.xml
show AbstractCommand
it contains legit nothing lol over than a few functions ...
but here it is https://paste.md-5.net/wacaribosa.java
yes of course i do
that isnt even the error
did u even look
what happened when you moved your implement CommandExecutor to your abstract class?
more Errors
it caused a error in my main class
that makes no sense
cuz i was registering the comamnds there
and since the command didnt have implements CommandExecutor
it errored
i.e. intellij's is alt enter
it doesn;t need it as its extending the abstract
yeah but it errored
oh no... why is is it linked
chestplate: elytra
leggings: diamond leggings
helmet: Diamond Helmeteasefwqr33
boots: Diamond Bootsqwe
29e391aa-e42f-475c-a232-e4dfe692fe33:
helmet: Diamond Helmeteasefwqr33
chestplate: elytra
leggings: diamond leggings
boots: Diamond Bootsqwe
@EventHandler
public void armor(PlayerInteractEvent event) {
for(Player p : Bukkit.getOnlinePlayers()){
UUID uuid = p.getUniqueId();```
move the implement CommandExecutor to yoru abstract class and add an onCommand in there
plugin.getConfig().set(uuid + ".helmet", helmet);
plugin.getConfig().set(uuid + ".chestplate", chestplate);
plugin.getConfig().set(uuid + ".leggings", leggings);
plugin.getConfig().set(uuid + ".boots", boots);
plugin.saveConfig();```
why onCommand isnt gonna get executed then...
you will override it in yoru command class
i thought the player loop would run sperate for each
I've downloaded a world, and into the world folder there is that. I was wondering from what plugin/mod this came from, does anyone know?
not once for everyone
how can i get the name of an advancement instead of this: org.bukkit.craftbukkit.v1_16_R3.advancement.CraftAdvancement@160e3cc3
nvm, found. It is a mod
Moving CommandExecutor shouldn't change anything
but it did
This works just fine.
That's the mod... named accordingly, CustomNPCs. I think it's like a 1.7.10 - 1.12.2 Forge Mod.
Thanks
Who knows. At least what you had should not have been an issue.
does spigot do anything special in terms of console handling?
when i print ansi sequences on windows it works fine when running under spigot, but when running separately it doesnt
That would work for me in eclipse. Seems not for him
My best guess is that it is some cache issue. IntelliJ has built-in cache clear and restart. Not sure about Eclipse.
when running under spigot:
its eclipse java 2018-12
Eclipse is generally just project -> clear, or update using the pom
<yikes spigot loading slow>
Why don't you just update?
"Hey my IDE is outdated and causes issues but I like it"
and i think i downloaded 2020 version but idk where it is
ok i found out the problem with the link
if player 1 has full diamond
and player 2 has full iron
lets just say
and player 2 takes off his boots
then it will think he has the same boots as player 1
which is diamond
so now i cant build the plugin in eclipse cuz if i do the resources are gonna be in the main folder ;-;
cuz of the structure
i wish i could change it
;-;
why does maven have to be like dat
Resources should be in main.
how do i fix this
no if i compile using maven in the jar it isnt
but with eclipse it is
and it shouldnt be
...
I have never used Eclipse so I can't help you with that
i think its cuz u meant to put resources in a source folder
not in a folder
and it should only be one directory
thats why i dont like to use maven but im using it cuz i need to
cuz i dont want to go have to build spigot api manually using buildtools :)
i think u should be able to change the resourceDirectory and the sourceCodeDirectory for maven
overwise its kinda lame
Any Good alternative to fawe?
and bad
it doesn't handle well schems.
No, what I mean is.
isnt that in worldedit ? already
i dont think theres fixing that
i dont think schems hold block rotations
lol
im not sure tho
😦
just fix them manually thats the only way really
its never fucked up for me tho
idk im a newbie to schems
help
Incorrect usage, the correct usage would be !help <error> <what to help with> to receive help with plugin development
guess ill just include jansi in my jar lol
how do I convert this (org.bukkit.craftbukkit.v1_16_R3.advancement.CraftAdvancement@160e3cc3 ) into the name of the achievement?
Start by not printing the instance
how should I do that?
CraftAdvancement.getHandle().c().a()
getkey?
ok thanks
gives you a ChatComponent tho
how should i add it?
where tho?
in ur main file probs
i got it thanks!
@limpid pumice I love you so much
private String getEnglishDisplayName(Advancement advancement) {
final IChatBaseComponent displayComponent = ((CraftAdvancement) advancement).getHandle().c().a();
final String key = ((ChatMessage) displayComponent).getKey();
return LocaleLanguage.a().a(key);
}
would return The End? for the advancement story/enter_the_end
if that is what you needed
not that you can only translate to English as the server only ships that
Hey, I was wondering how I could summon an entity and then every tick or two ticks (in-game) position that entity to be looking the same way as the player, and be in the same location as the player
Use a BukkitRunnable and loop through all players and entities
Hello, How do i do like /command command1
google search how to make command using (api of ur choice spigot,paper)
ik how to make a comman dlol
command*
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
like this in the onCommandjava if (args[0].equals("something")) { do stuff }
easy
oh ty
👁️👄👁️
wat
args[0].equals("something") or args[0].equalsIgnoreCase("something") instead pls
== is like
memory location or whatever
memory reference
i forget it's something to do w memory tho
equals is comparing objects or smthn
yeah i used it, not just copy paste the solution lol
it wont
lol
hello, does anyone know how to disable creating a map when you right click an empty map?
This code is in a PlayerInteract event.
The weird thing is that this code only disables it when you right click a block
you can't disable it?
why is this guy speaking in half sentences?
Whats the problem innit
this
can server detect if u right click air..?
yes
does your code work when u right click air
no
cancel MapInitializeEvent iirc
you can't cancel that event
Is there a way to buy a litebans whit paysafe card?
is there a way/feature for when the player looks at an entity it displays it's custom name but not when looking away?
How safe is it to do Inventory#setItem from an async task/runnable?
probably very unsafe, right
go ask the pugin author lol
oki
I saw someone mention Inventories were safe as they use CopyOnWrite maps, but I'd check that for yourself before taking it as truth
ok, thx
event.setUseItemInHand
can i hide player name using packets? to fix a bug on 1.8 with invis players having their names visible when using something like nte for nametags
you tried to edit the Cart#getLocation#setDirection?
like after it was spawned?
weird, not sure sorry
i'm modifying my config like this
if (Material.matchMaterial(args[2].toUpperCase(Locale.ROOT)) != null) {
List<String> banned_blocks = plugin.getConfig().getStringList("banned-blocks");
banned_blocks.add(args[2]);
plugin.getConfig().set("banned-blocks", banned_blocks);
player.sendMessage(ChatColor.GREEN + "Block successfully added to banned blocks!");
}
but when i reload or restart the changes are gone, is there a way to save them?
Save the in-memory config into the actual file?
Plugin#saveConfig
thx
Did something with the Bukkit.getOfflinePlayer(name) method change? I know it's deprecated but it's just returning random UUIDs now
Uh it shouldn’t return random uuids
Only reason for its depreciation is the fact that it may make a request to mojang
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
Player p = (Player) sender;
if (args[0].length() > 16) {
p.sendMessage("" + Bukkit.getOfflinePlayer(UUID.fromString(args[0])).getUniqueId());
}
else {
p.sendMessage("" + Bukkit.getOfflinePlayer(args[0]).getUniqueId());
}
return true;
}```
See how it's returning a different UUID if I change a letter to caps
that's not normal right
not to mention that none of the UUIDs match the actual UUID
Weird...
Is your server in online mode
Yep
And is the connection not being firewalled
correct
plugin.getConfig().set(uuid + ".helmet", helmet);
plugin.getConfig().set(uuid + ".chestplate", chestplate);
plugin.getConfig().set(uuid + ".leggings", leggings);
plugin.getConfig().set(uuid + ".boots", boots);
plugin.saveConfig();
p.sendMessage("saved");```
@EventHandler
public void armor(PlayerInteractEvent event) {
for(Player p : Bukkit.getOnlinePlayers()){
UUID uuid = p.getUniqueId();
p.sendMessage("test");```
but it's not being saved
infact somehow all the old data was lost
29e391aa-e42f-475c-a232-e4dfe692fe33: {}
well ok it is being saved
if i delete it it comes back
but the data isn't being written
unless is everything set to null?
Same thing on localhost aswell @young knoll
is there a way to attempt to connect a player in bungeecord
yessir
how can i define a variable like this
String helmet;
inside the same void that i will be using it in
shouldn't the next time i try and define it it just gets overwritten?
yeah
my problem is
if a player doesn't have boots on
then the variable would stay has the previous person's armor
making it so if player 1 had diamond boots
Then it isn't local
how do i make it local
Declare it inside the method
then i get Error:(36,23) java: error: variable helmet is already defined in method armor(PlayerInteractEvent)
//helmet
String helmet;
if (p.getEquipment().getHelmet() == null) {
String helmet = null;
}
else {
if (p.getEquipment().getHelmet().hasItemMeta()) {
String helmet = p.getEquipment().getHelmet().getItemMeta().getDisplayName();
}
else {
String helmet = p.getEquipment().getHelmet().getType().name().replace("_", " ").toLowerCase();
}
}```
helmet = null
tried that
You don't need to define it's type twice
https://api.mojang.com/users/profiles/minecraft/tomcool
This returns this {"name":"tomcool","id":"0eadc03912364963b48bf663a8f853da"}
Bukkit.getOfflinePlayer("tomcool").getUniqueId() returns a random UUID that's not associated to any player
So you'd get
//helmet
String helmet;
if (p.getEquipment().getHelmet() == null) {
helmet = null;
}
else {
if (p.getEquipment().getHelmet().hasItemMeta()) {
helmet = p.getEquipment().getHelmet().getItemMeta().getDisplayName();
}
else {
helmet = p.getEquipment().getHelmet().getType().name().replace("_", " ").toLowerCase();
}
}
You should probably store an instance rather than calling p.getEquipment.getHelmet 3 times
Perhaps the player is not within the player cache? (or is the server in offline mode?)
the server is in online mode
See if that UUID is equals to
UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8))
if it is, thats why
are you using Bungee?
nah
has tomcool ever logged into your server?
no
then you will not have a local cache of that player
same result with my main account though
this is it.
public static boolean hasPlayedBefore(String name) {
Player player = Bukkit.getPlayerExact(name);
if (player != null) {
return true;
} else {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(name);
return offlinePlayer.hasPlayedBefore();
}
}
doesn't work it is my RIGHT_CLICK_AIR Action that isn't firing
I use this method to check if the player is has played before in this server
yeah in that case your player doesn't exist and is being created by the fallback
Right click air should fire as long as you are holding an item
Is the fallback incorrect then?
It will not fire with an empty hand
no the fallback is correct, although it shouldn't care about capitalization iirc
but then why are my results not correct
Its a valid player name so you shoudl not be getting a generated UUID
🤷♂️ thank mojang
do you need to consider ALL player names or just ones that have joined the server
All.
only if the Player name is unknown to Mojang should you get a generated UUID
I'd suggest doing a quick api call yourself then
Yeah no other options IG
this only started happening like a day ago btw
it was perfectly fine before
Why do you need to lookup an offline player by name?
Skins
Did you mess with the player cache?
na
nothing changed to this server
btw I created a new localhost server and the result is the same
if he got an invlid lookup then his cache is incorect
a completely fresh server
This is my JD for an offline player by name ```java
/**
* (Deprecated) Gets an OfflinePlayer object ![NEVER USE]!
* adds this data to the servers usercache.
* Always returns an object with this name, but the UUID will be generated if there is no account.
* (performs a blocking web request if the player is not known to the server)
*
* -----------------------------------------------------------------
* The reason to never use this is it adding data to the usercache.
* This can result in a name being associated with an invalid UUID
* possibly confusing future searches.
* -----------------------------------------------------------------
*
* @param name a sting of this players name (case insensitive)
* @return OfflinePlayer object for this name.
*/
@Deprecated
public static OfflinePlayer getOfflinePlayer(String name) {
return Bukkit.getOfflinePlayer(name);
}```
I never use it for the commented reason
if I want an offline player I getOfflinePlayers() and search it
what java version do I need to make this?
lookups are throttled. If you hit the cap you will not get any valid response until you are unblocked. Which will result in offline generated UUIDs
if (!e.getKickReason().equals("full")) {
e.setKickReason(ChatColor.RED + "The game is full! Placing you in the queue...");
e.setCancelled(true);
e.setCancelServer(kickTo);
p.sendMessage(ChatColor.RED + "You have lost connection to the server you were on, so you have been put in the lobby.");
} else {
if (kickFrom.getName().equals("testing1")) {
QueueManager qm = QueueManager.getQueueManager();
if (!qm.queueForCaptureTheClay.contains(p)) {
qm.queueForCaptureTheClay.add(p);
}
p.sendMessage(ChatColor.GRAY + "You are currently in the queue! " +
"(" + (qm.queueForCaptureTheClay.indexOf(p) + 1) + "/" + qm.queueForCaptureTheClay.size() + ")");
}
}``` (this is in a ServerKickEvent)
the reason is full
but it just says
ah that's fucked lol @eternal oxide
not sure why this started happening only a few hours ago
You will not see a kick message as you are cancelling the kick event
if (kickFrom.getName().equals("testing1")) {
QueueManager qm = QueueManager.getQueueManager();
if (!qm.queueForCaptureTheClay.contains(p)) {
qm.queueForCaptureTheClay.add(p);
}
p.sendMessage(ChatColor.GRAY + "You are currently in the queue! " +
"(" + (qm.queueForCaptureTheClay.indexOf(p) + 1) + "/" + qm.queueForCaptureTheClay.size() + ")");
}```
this is the code that is supposed to be running
the reason is "full"
getKickReason() isn't spigot
old version perhaps?
eae get's not send when you right click air for some reason, can't find why
ah
debug the returned kick reason then
when the player was kicked on spigot
make sure its your expected "full"
To make your Minecarts update their direction on spawnign use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#spawn(org.bukkit.Location,java.lang.Class,org.bukkit.util.Consumer) and set their direction in teh consumer
but i kick the player for reason "full"
This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air). For the purpose of avoiding doubt, this means that the event will only be in the cancelled state if it is fired as a result of some prediction made by the server where no subsequent code will run, rather than when the subsequent interaction activity (e.g. placing a block in an illegal position (BlockCanBuildEvent) will fail.
My method is jumping around inside it's method, anyone know what is happening???
https://gist.github.com/Qboi123/d3b43e355016191cc1f7187e07ebe10c
The log is on top, the method is at the bottom.
is there a more specific event for when dirt is tilled other than PlayerInteract?
is there like a CropTrampleEvent?
PlayerInteractEvent with an Action.PHYSICAL
Is it just me just now, or does Bukkit.getOfflinePlayers() return a List of all offline players with COMPLETELY random and invalid UUIDs?
yeah but how would i check if block is crop
in offline mode, yes it does
it's online
then no, it's not supposed to
kinda random but event.getClickedBlock?
what are you using to determine whether the uuids are valid or not
but I think I just looked at one UUID from a user when the server was in offline mode accidentally
so nvm
yeah but need to check if it is actually a crop, i've seen isEdible() on Material idk if that works or nah
p.connect(GlobalMessage.getPlugin().getProxy().getServerInfo("testing1"), new Callback<Boolean>() {
@Override
public void done(Boolean aBoolean, Throwable throwable) {
if (!aBoolean) {
queueForCaptureTheClay.remove(p);
}
}
}, ServerConnectEvent.Reason.PLUGIN);```
what is the boolean for
is it if the connection was successful
or failed
I mean there's only a few blocks it could be that can be trampled right? may aswell just put them in an arraylist yourself
yeah sad that there is no tag for them
THERE IS WTF
SO POOOG
there's something very weird going on....
at one point I do this and add it to an inventory.
meta.setOwningPlayer(player);
Then when someone clicks on that inventory, I do
val skull = item.itemMeta as SkullMeta?
val uuid = skull.owningPlayer?.uniqueId
Yet that uuid is complete garbage
I'm getting into programming plugins and i'm trying to figure out how teams work but can't find a guide anywhere. Can anyone help?
scorebaord
callback.done( ( result == ServerConnectRequest.Result.SUCCESS ) ? Boolean.TRUE : Boolean.FALSE, error );
paper adds more tags :fingerguns:
okay so that means that the boolean would mean that the connection was successful
yup
doesnt really seem that way though
because im trying to remove the player from the queue when they join
but for some reason that sometimes doesnt work
and instead just says 1/1 in the queue
instead of 2/2
!aBoolean means if they not joined
you need to remove the ! to remove them if they joined the server
would this line (on the serverkickevent) change this
if (!qm.queueForCaptureTheClay.contains(p)) {
qm.queueForCaptureTheClay.add(p);
}```
lines
if that's a regular collection you can just
if (qm.queueForCaptureTheClay.add(p)) {
}```
I didn't use bungeecord for long ago
fun getPlayerSkull(player: OfflinePlayer): ItemStack {
val skull = ItemStack(Material.PLAYER_HEAD, 1)
val meta = skull.itemMeta as SkullMeta?
meta!!.owningPlayer = player
meta.setDisplayName(player.name)
skull.itemMeta = meta
return skull
}
is there anything wrong with this function?
I am so confused as to why the items have a owningPlayer that has a different uuid
you're not in offline mode right
nope
because skulls and offline mode don't play nice together
I've checked the player value that goes into that function against the Mojang API / namemc, and they're totally valid
i don't actually quite remember the format of a skull
can you send the itemstack/blockstate serialized info here
/data get block for blocks and /paper dump item for items
although i guess you're probably on spigot
im testing on spigot rn, but I've got a purpur and a paper server set up aswell
p.connect(GlobalMessage.getPlugin().getProxy().getServerInfo("testing1"), new Callback<Boolean>() {
@Override
public void done(Boolean aBoolean, Throwable throwable) {
if (aBoolean) {
queueForCaptureTheClay.remove(p);
}
}
});``` @hidden delta would the aBoolean be true if the Spigot AsyncPlayerPreJoinEvent was disallowed
because it checks if the /send was SUCCESS
but it appears it is "success" when the Spigot event was disallowed
anyone help
try it on paper and send the serialized item data
it might be that set owning player doesn't quite do what one might expect it to
hmm k
i remember the skull data format being super weird
having duplicate data under different names for stuff like the owning player and their uuid
@torn oyster so you need to check in the ServerConnectEvent I guess
what
it will tell you if the player kicked or something
ah yes
great
idk, might this help, it's just skull.toString()
ItemStack{PLAYER_HEAD x 1, SKULL_META:{meta-type=SKULL, display-name={"extra":[{"text":"schweinhd"}],"text":""}, internal=H4sIAAAAAAAA/+NiYOBi4AnOLs3JCSjKT8vMSeVgYPFLzE1l4CxOzihPzczLSGFgAACvmJtBJgAAAA==, skull-owner=schweinhd}}
no that hammers the actual internal data into an unrecognizable state
its just base64
put the item in a chest or a container and run /data get block on it
that's the ghetto way of looking at item internals
you're kind of fucked then
one sec I thought of something
unload the plugin with the menu open and you can grab it i guess
yeah exactly that
can anyone help (all info here: https://www.spigotmc.org/threads/bungeecord-spigot-asyncpreplayerloginevent.504419/)
Looks like it was infinite looping in a async thread LOL.
And every time I chatted a message a new thread was created and if it calls parseKey it's looping again in the new thread.
it's got a bit of data... not much tho
there's also just a Name attribute for the SkullOwner
i'm not sure if set owner actually sets the gameprofile properties and data
I mean it used to
or if it only changes the name that's shown there
if you use paper you'd probably want to use the gameprofile setter instead
yeah ik, im trying to target a broader audience tho
I feel like this used to work
someone over on the paper discord also said they've had issues with skulls just being steve/alex for no apparent reason
just my plugin is simply uuid based
so having uuids which are just random things doesn't quite work
yeah i don't really work much with skulls
I really have a feeling that the setOwningPlayer function is somehow broken
especially since the sessionserver API has been marked as down for a while now
which is where profile data and textures come from
bump
nope there's definitely something broke with skulls/bukkit/mc web api right now
sessionserver queries look fine to me
I thought so too, however the root, https://sessionserver.mojang.com/, does not answer. And I am not the only one experiencing this (or similar) issues with skulls not keeping their owners properties.
it works for online players.... just not for offline
I@m offline and https://sessionserver.mojang.com/session/minecraft/profile/2643e076-2434-4994-bd91-cb076d57f941?unsigned=false responds fine
No, I mean when doing Bukkit.getOfflinePlayers, those players don't work with skulls.
but yeah I tested the APIs and they seem to be working fine
But as seen by https://status.mojang.com/check, the sessionserver is marked red
mmm
the UUID is copied directly from the offlineplayer
@Override
public void setOwningPlayer(OfflinePlayer player) {
Preconditions.checkNotNull(player, "player");
if (player instanceof CraftPlayer) {
this.profile = ((CraftPlayer) player).getProfile();
} else {
this.profile = new GameProfile(player.getUniqueId(), player.getName());
}
}
yeah I tried doing it with NBT just earlier and it resulted in the same thing
wait, you're doing it on itemstacks
this was for the tile state
i don't have any spigot source for the itemstack one
paper has redone it completely
bump
@wraith rapids But my own head works
which is the most confusing part
it uses the same function
are you online?
^
there's an instanceof there that changes how the logic works
if the player is online, the profile is grabbed from the player directly
if not, a new profile is constructed
well GameProfile would just fetch it from the API
well it should
which from what I saw before times out sometimes
but that's the only difference i see
When doing it on like 5 heads the paper thread shut my plugin down for blocking the main thread for more than 10 seconds
@Override
public boolean setOwningPlayer(OfflinePlayer owner) {
if (owner == null) {
setProfile(null);
} else if (owner instanceof CraftPlayer) {
setProfile(((CraftPlayer) owner).getProfile());
} else {
setProfile(new GameProfile(owner.getUniqueId(), owner.getName()));
}
return true;
}
but well this is the under the hood
i don't have authlib source so I can't look at what the gameprofile ctor does
but the fault is probably there
doubt that
well... it works as intended when it's an instanceof craftplayer
so the existing profile works
when doing inventory.setItem(skull
the api call happens
because from there CraftMetaSkull#applyToItem is called
can anyone help (all info here: https://www.spigotmc.org/threads/bungeecord-spigot-asyncpreplayerloginevent.504419/)
here the stacktrace from earlier
this is the point where it laggs and actually calls the API
it doesn't need to call the api for online players
could be the case
eventhough it seems to work when just using it over the browser
paper will try to load it from the usercache
have you checked if it works for a recently visited player on paper
the sessionserver is taking up to 450ms to respond
okay i am being ignored at this point
can anyone help (all info here: https://www.spigotmc.org/threads/bungeecord-spigot-asyncpreplayerloginevent.504419/)
i'm not gonna go on some cancer thread
If you are doing it by url connection are you handling redirects? Mojang has one on their API
?paste
if the AsyncPrePlayerLoginEvent is disallowed
Handling redirects https://paste.md-5.net/aketifetov.php
im not doign redirects
how do i even use that with my AsyncPrePlayerLoginEvent
or bungeecord /send
a browser handles it without you seeing. In code you have to deal with a redirect yourself
@torn oyster idk random suggestion but what about cancelling the login event?
i dont think u can
oh indeed, yes
wdym
disallow the prelogin event
i tried that
but it still comes up as "SUCCESS"
when i /send my alt there
but my alt doesnt connect either
have you tried velocity
it's less shit
it's kind of like bungee but not a veritable fucking shitfest
any one can help
can't compile
my project
from some reason got stuck
at Downloading from jitpack.io: https://jitpack.io/org/spigotmc/spigot/1.16.4-R0.1-SNAPSHOT/maven-metadata.xml
jitpack is probably down
stop downloading spigot from jitpack
aahhh
you need to run buildtools i think
what do u mean
you have jitpack as a repository, and probably spigot maven repo too
but as the nms build isn't on there
it tries to find on jitpack, which it also isn't on
run buildtools
oh thanks
if (p.getEquipment().getChestplate().getType() == null) {
chestplate = "None";
}```
```java
if (p.getEquipment().getChestplate().getType() == Material.AIR) {
chestplate = "None";
}```
ive tried both
and chestplate isn't being set to null
print it out
getChestplate returns null
you calling getType tries to call a method on a null pointer
which throws a null pointer exception
yeah
nullcheck getEquipment and getChestplate
i have lost count of how many times you've asked about trivial NPE's
you need to put some brain juice into it and at least pretend you're trying to learn
I'm trying to remember how I changed other players name tags for one player only with scoreboard packets, but can't seem to recall what it was
Can someone guide me in the right direction as to what packet is used for such
you can add team prefixes and suffixes to names
but changing a player's name tag itself can't be done through the scoreboard
Yeah I meant prefixes and suffixes* ^^
how can I change a BlockBreakEvent to sort of act as a autosmelter. I would use https://kekers.dev/9C1VB8U9.png but it takes a boolean?
setDropItem sets if items drops
get the broken block
and add the smelted version to the players inv
thats what im doing but then they would get both, should i setDropItem(false) and then drop the smelted version there
yes
np
hey, im making my own recipe system (with good reason) and I want to do the following but java's generics won't allow it:
public static <Z extends IRecipeInput> boolean match(IRecipeInput input, IRecipeIngredient<Z> ingredient {
if(ingredient == null) {
return input == null;
}
if(input instanceof Z) {
return ingredient.match((Z) input);
}
return false;
}
Z is unfortunately lost at runtime. Is there a way to circumvent this?
I dont even know what a minecraft composter is lmfao
but like how it works
havent played a version above 1.8 in over 9 years
played 1.9 once for 10 mins when it came out to see the new combat and never used one since
further explanation:
if both ingredient and input is null, it should return true.
if ingredient is null but input is not, it should return false.
if input's type is a subclass of the ingredient's generic typing Z, it should return whatever ingredient.match returns
otherwise, return false.
the generic line is the problem
lol
how have you never at least gone to see what the newest update is at least 1 time
I tried once on my laptop which mind you had an intel Pentium LMFAO and it kept crashing and was 1fps not even
it was advertised on the cover as the "new cool thing" HAHA
does stuff grow in them, do you have to water it? Literally never played it
ah ok
so it breaks down
hey so, I am in need of changing the weather globally, what would be the best way of doing that?
on weather change
should I just mess with chunk packets?
I need to change from snow to rain ecc...
I don't see that done without packets
yes u can