#help-development

1 messages · Page 2221 of 1

winged anvil
#

should I have like a core plugin that handles/stores the currency of each player and then have the plugins hook into that core plugin

crisp steeple
#

not really giving any information here… i’m asking what the string represents, and where it originated from

harsh totem
crisp steeple
#

ok, so have you checked if the key that the number is being set under and key are the same?

harsh totem
#

yes

#

when I do this @EventHandler public void badOmen(RaidTriggerEvent event){ JsonElement element = JsonParser.parseString(String.valueOf(event.getPlayer().getPotionEffect(PotionEffectType.BAD_OMEN).getAmplifier())); obj.add(event.getRaid().getLocation().toString(), element); Write(); }
it makes the entire json file "null"

#
        try (FileWriter file = new FileWriter(plugin.getDataFolder() + File.separator + "data.json")) {
            Reader reader = new FileReader(plugin.getDataFolder() + File.separator + "data.json");
            Gson gson = new GsonBuilder().setPrettyPrinting().create();
            file.write(gson.toJson(JsonParser.parseReader(reader)));
            file.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }```
#

oh wait

crisp steeple
#

doesn’t look like Write is actually writing anything

harsh totem
#

i see the problem. i am writing an empty json file

#

but how do i write a JsonObject

crisp steeple
#

gson.toJson(obj, writer)

harsh totem
#

ok i'll try

#

ok thx it works

#

finally someone helpful...

crisp steeple
#

neat

tawny otter
#

seems like I am connecting to the Purgatory server, then getting connected back to the Lobby server, I think I might need to somehow cancel the connection to the Lobby when I send the player to Purgatory

00:47:50 [INFO] [/127.0.0.1:53462] <-> InitialHandler has pinged
00:47:51 [INFO] [/127.0.0.1:53464] <-> InitialHandler has connected
00:47:51 [INFO] [Teleputer] <-> ServerConnector [purgatory] has connected
00:47:51 [INFO] [Teleputer] <-> ServerConnector [lobby] has connected
#
        if(plugin.configuration.contains("Purgatory."+String.valueOf(player.getUniqueId()))){
            player.connect(target);
        }
#

any event that I could use that can just re-route the player before bungeecord decides to send the player to the priority server?

#

found it, "ServerConnectEvent" and "setTarget"

lost matrix
tawny otter
#

I am currently using the player's UUID to check if they have any punishments, but is their a way for me to use their IP rather then their UUID?

drowsy helm
#

yes but uuids is probably the better option

#

you could use them in conjuction but i wouldn't use stricty the ip

tawny otter
#

then what about alts?

drowsy helm
#

i can easily change my ip

#

i cant change my uuid

tawny otter
#

. . . an alt

covert karma
#

just do both

#

smh

drowsy helm
#

yeah im saying use both

#

dont just use ip

tawny otter
#

I was already going to

#

oh wait, I think I did a dumb, Im hosting the bungeecord server on my own computer, thats why its always returning the localhost ip

tender shard
#

Is there an easier way to turn an intemstack into JSON (needed for Bungee chat's HoverEvent) than to turn it into an NMS itemstack, then creating a new CompoundTag (what used to be called NBTTagCompound), and then calling #save() on that?

dark harness
#

How can i get mobs to spawn in a forceloaded chunk without a player?

tender shard
# tender shard Is there an easier way to turn an intemstack into JSON (needed for Bungee chat's...

I'm currently doing this but I wonder if there's any way to do this without NMS. COuldn't find anything in Bukkit.getUnsafe() or CraftMagicValues though :<

    @Override
    public String itemStackToJson(@Nonnull org.bukkit.inventory.ItemStack itemStack) {
        final ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
        final CompoundTag compoundTag = new CompoundTag();
        nmsItemStack.save(compoundTag);
        return compoundTag.getAsString();
    }
#

Clone the craftbukkit repo from spigot's stash, and then check out the "nms-patches" folder

#

for example this is the patch added to "PlayerConnection" that calls the PlayerCommandPreprocessEvent

#

no. CraftBukkit consists of patch files that alter the original code, because obviously they cannot just redistribute mojang's code

#

?stash

undone axleBOT
tender shard
torn sedge
#

Hello, does anyone know what should be done so that a boss bar always remains at the top of the screen and no other takes its place. It's for a boss bar that will indicate coordinates, temperatures, time, so it must not move, it's unpleasant. Thanks

tender shard
#

CraftServer#dispatchCommand calls the SimpleCommandMap's dispatchCommand method

#

one more thing:

midnight shore
#

How can i make a player spectate another player without being in spectator mode? I'll like to make a spectate system and the spectator mode hotbar is just ANNOYING

grim ice
#

put the player in creative mode

#

and stop him from clicking anything in any inventory

#

and interacting

#

with anything

#

and give him invisiblity

summer scroll
eternal oxide
#

90% of Creative is client side

harsh totem
#

when the item is air I get java.lang.IllegalArgumentException: Cannot drop air and idk why

        int material = random.nextInt(Material.values().length);
        int amount = random.nextInt(64);
        ItemStack item = new ItemStack(Material.values()[material]);
        item.setAmount(amount);
        event.setDropItems(false);
        if (item.getType() != Material.AIR){
            event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), item);
        }```
#

any ideas?

#

what

#

how

#

ok

#

yeah ik

#

thx

#

well now i have this:

            event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), item);
        }```
#

and this error still happens

eternal oxide
#

use Material.isItem()

harsh totem
#

ok

mortal hare
#

afaik

#

?paste

undone axleBOT
mortal hare
#

i have written this a while ago, this serializes NBT tag to read friendly form of map

#

which can be dumped into yaml file

#

and still be readable to humans

valid jolt
#

I keep getting this:

#

Error occurred while enabling Plugin251 v1.0 (Is it up to date?)

java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.soclownish.plugin251.Plugin251.getCommand(String)" is null

at me.soclownish.plugin251.Plugin251.onEnable(Plugin251.java:38) ~[plugin251-1.0.jar:?]

at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]

at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]

at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]

at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:554) ~[paper-1.19.jar:git-Paper-28]

at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:468) ~[paper-1.19.jar:git-Paper-28]

at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:633) ~[paper-1.19.jar:git-Paper-28]

at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:419) ~[paper-1.19.jar:git-Paper-28]

at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.jar:git-Paper-28]

at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1121) ~[paper-1.19.jar:git-Paper-28]

at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:302) ~[paper-1.19.jar:git-Paper-28]

at java.lang.Thread.run(Thread.java:833) ~[?:?]

glass mauve
#

did you add your command in plugin.yml

mortal hare
#

result looks something like this in yaml

#

after serialization

harsh totem
#

how do I make an entity drop nothing in EntityDeathEvent?

glass mauve
#

you could prob clear it

harsh totem
#

ok i'll try

sage patio
vocal cloud
#

?paste error logs please

undone axleBOT
sage patio
eternal oxide
#

Null at Utils.java:53

sage patio
#

so its for the command ig

eternal oxide
#

either region or ProtectedRegion are null strings

valid jolt
minor garnet
#

some know how make a chat align like a table ?

i found some codes on the forum but nothing works 100% and some codes use bars to align

tender shard
lavish folio
#

how can i register recipi with java code

#

?

tender shard
#

Bukkit.registerRecipe

lavish folio
harsh totem
#

im trying to do this @EventHandler public void craftGet(CraftItemEvent event){ event.setResult(itemStack); }
but it says that i should input "Result" in there instead of ItemStack. how do I get a result?

glass mauve
#

I think you use the wrong method

#

Result is an Enum with three fields: ALLOW, DEFAULT, DENY

harsh totem
#

hmm

echo basalt
#

PrepareItemCraftEvent is what you want

sage dragon
#

Hey,

How do I properly send an Item Break particle? Without them flying all over the place

regal carbon
#

hi, trying out custom mobs with nms, but im not sure how to set the custom name, im using mojang mappings

eternal oxide
#

setCustomName takes a String not a Component

regal carbon
worldly ingot
#

If you're using Mojang mappings you should be able to do Component.literal("Hello")

regal carbon
#

seems to work, thanks

harsh totem
#

when I use this code it works but after i click in the crafted item slot the item doesn't disapper, it just turns into another random item.
Event code:

    public void craftRecipe(PrepareItemCraftEvent event){
        event.getInventory().setResult(getRandom());
    }```
getRandom code:```    public static ItemStack getRandom(){
        ItemStack item = null;
        while (item == null || !item.getType().isItem() || item.getType() == Material.BARRIER || item.getType() == Material.COMMAND_BLOCK || item.getType() == Material.COMMAND_BLOCK_MINECART || item.getType() == Material.CHAIN_COMMAND_BLOCK || item.getType() == Material.REPEATING_COMMAND_BLOCK || item.getType() == Material.STRUCTURE_BLOCK || item.getType() == Material.STRUCTURE_VOID || item.getType() == Material.BEDROCK || item.getType() == Material.LIGHT || item.getType() == Material.SPAWNER){
            Random random = new Random();
            int material = random.nextInt(Material.values().length);
            item = new ItemStack(Material.values()[material]);
            int amount = random.nextInt(1, item.getMaxStackSize()+1);
            item.setAmount(amount);
        }
        return item;
    }```
#

any ideas?

echo basalt
#

ohgod

eternal oxide
worldly ingot
#

Well that's certainly a method

echo basalt
#

you can optimize a lot there

sage dragon
echo basalt
#

But pretty sure PrepareItemCraftEvent fires every time the crafting bench is clicked

#

including the result slot

eternal oxide
#

use one where you can specify the speed

#

um itemStack?

sage dragon
harsh totem
#

I want the crafted item to appear as a random item and i want the player to be given another random item which doesn't have to be the same item

#

but when I click on the random item it works and then the crafter slot turns to a random item

eternal oxide
harsh totem
sage dragon
eternal oxide
#

There is no spawnparticle method which accepts an ItemStack as the last parameter

sage dragon
eternal oxide
#

just set zero offsets

#

the extra value is the speed, which should affect them flying

sage dragon
eternal oxide
#

you could try setting the spawn Location setDirection(newVector())

glossy venture
ocean lion
#

I'm using LuckyPerms to create ranks which I pass into a GUI. Before you can choose the rank you must choose the player from the first GUI with the head of every player online at the server. I check if the name is right and then the GUI is specifically opened for them. It works, however when I now get the new rank example "VIP", if you go back onto the selector GUI it will say "VIP name" and therefor the plugin doesnt work anymore?

#

What should I do

glossy venture
# glossy venture i recommend calculating an array without those items and then just using one ran...
static final List<Material> randomItems = new ArrayList<>(Material.values().length);

static {
  for (Material mat : Material.values()) {
    // skip non items
    if (!mat.isItem())
      continue; 

    // skip specific items
    switch (mat) {
      case Material.BARRIER:
      case Material.COMMAND_BLOCK:
      case Material.LIGHT:
        continue; // skip
    }

    // add item
    randomItems.add(mat);
  }
}

Random random;

public Material getRandomItem() {
  return randomItems.get(random.nextInt(randomItems.size()));
}
misty current
#
if(random.nextDouble() > level * 0.1) return;
// code to run enchant

does this look good to make a 10% chance for each level of the enchant to work?

glossy venture
#

the chance gets lower every per level now

#

use <

#

i tihkn

vast raven
#

Somehow I can't change the display of an item, after some debugging, I've noticed that the problem is that the rename code is in a scheduled task, but if I put that code out of the task, it works.

#

Any clues?

misty current
misty current
#

can you send your code?

vast raven
glossy venture
#

because with level 1 its > 0.1 you have 0.9 left aka 90%, but with level 3 its > 3.0 which is 7.0 left so just 70%

ocean lion
#

?paste

undone axleBOT
misty current
#

sorry but that tower is kind of unreadable

#

anyways im pretty sure it's because you are referencing to an itemstack instance that might not be valid anymore

vast raven
misty current
#

inside a task, don't use old item references but get new ones inside the task

vast raven
rich inlet
#

How do I update my localhost server version?
java -jar BuildTools.jar --remapped --rev latest doesnt update to 1.19, it just looks for updates of the current installed version

ocean lion
#

I'm using LuckyPerms to create ranks which I pass into a GUI. Before you can choose the rank you must choose the player from the first GUI with the head of every player online at the server. I check if the name is right and then the GUI is specifically opened for them. It works, however when I now get the new rank example "VIP", if you go back onto the selector GUI it will say "VIP name" and therefor the plugin doesnt work anymore?
What should I do

eternal oxide
#

Stop using names and use the Players UUID

eternal oxide
#

instanceof not ==

iron glade
#

How exactly does ClickType.DOUBLE_CLICK trigger?

#

I mean, does it wait a moment to check that it's not two single clicks or what

wild marten
#

is 1.19 using java 17?

eternal oxide
#

16

wild marten
#

ok thanks

tender shard
tender shard
#

1.18 and 1.19 use java 17

#

1.17 uses java 16

glossy venture
#

yeah

tender shard
#

100% sure

wild marten
#

well may as well install both jdks

tender shard
#

tbh you will never need java 16

#

1.17 also supports java 17

wild marten
#

o

#

well 17 it is then

eternal oxide
#

I don;t even have 17 installed. only 16

tender shard
#

isnt java 16 already dead? 17 has LTS

eternal oxide
#

oh I lie, seems I do have 17 installed

#

could have sworn I only has 16

wild marten
#

your ide might have installed it for u

eternal oxide
lethal roost
#

ok i've been at this for like almost 2 days now and i'm kinda mald

so does the if statement execute BEFORE the click event actually happens??

glossy venture
#

yes

tender shard
#

I wonder - are 50% of people here older than the average member? Probably not

glossy venture
#

its so you can cancel it

eternal oxide
tender shard
#

The event itself does NOTHING.

#

the event is only there to control what should be done by the server itself afterwards

eternal oxide
#

getKiller is always a Player or null

glossy venture
#

its like

Event event = ...;
callEvent(event);
if (!event.isCancelled()) {
  // execute code
}
lethal roost
#

ugh so how do i make it so that the if statement executes AFTER the click occurs? i'm a bit confused on the whole "cancelling" thing

glossy venture
#

why

tender shard
#

the server cannot call a clickevent before any click occured

#

what do you want to do exactly?

eternal oxide
#

just remove the instanceof test all together. Also compare enums with == not equals

lethal roost
#

the message sends whenever i take out/unequip the wooden axe which isn't what i wanted

glossy venture
#

you should check the slot type and id

eternal oxide
#

The event cancell is simply a permission to see if the action is allowed. If you cancel the event the click asction was denied and whatever wwas supposed to happen from that click will not happen

tender shard
lethal roost
#

well i thought i did it in these lines but apparently they don't work, so what other way could i check?

glossy venture
#

when the event is called the click hasnt actually been processed yet so the axe is technically not in the offhand yet

#

meaning the offhand will return the previous item

#

also pressing F wont execute this i think

tender shard
glossy venture
#

or like the offhand switch key

lethal roost
tender shard
#

yeah there's many events

#

could also be inventorydragevent

lethal roost
#

ok ty for the help, i'll try the things you guys suggested

wild marten
#

this may be a odd way of doing it, but if you check the item in the cursor slot (and it is an axe), and the item slot clicked (is the offhand slot), you can logger it

#

nvm u said that

#

i didnt read

lethal roost
#

uh would i use getSlot or getRawSlot to check for the offhand slot?

glossy venture
#

getSlot() returns in the inventory

#

getRawSlot() returns in the inventory view (so both top and bottom inv)

lethal roost
#

ah ok

dark harness
#

How can i fix that maven try's to find a dependency in a wrong repository? D:

eternal oxide
#

have the correct repository

#

it will search them all in order

lethal roost
# glossy venture k then use ```java ItemStack itemClicked = event.getCurrentItem(); if (itemClic...

idk what i'm doing wrong here but it's still sending the message whenever i take out the item from the designated slot
and i've tried setting the slot id to 0 because -106 doesn't seem to be working

    public void onInventoryClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        ItemStack mainhandItem = player.getInventory().getItemInMainHand();
        ItemStack offhandItem = player.getInventory().getItemInOffHand();

        ItemStack itemClicked = event.getCurrentItem();

        if (itemClicked.getType() == Material.WOODEN_AXE && event.getSlot() == 0) {
            Bukkit.getLogger().info("Wooden Axe is in the offhand");
        }
    }```
wild marten
#

is it working as you want when you put the item in the slot

#

just not when you take it out?

lethal roost
#

no it sends whenever i take it out, rather than placing it in

#

i want it to work when i place the item IN the slot, not out

#

it always seems to work whenever i take it OUT

#

and it's driving me crazy

glossy venture
glossy venture
lethal roost
#

aight lemme try that thx

tender shard
glossy venture
#

i was thinking of shift click

#

but thats not even possible

#

lol

tender shard
#

not for offhan

glossy venture
#

yeah

wild marten
#

i just messed something up so badly it fixed another issue

#

my brain is so confused rn

dark harness
# eternal oxide have the correct repository

I only get this
Could not find artifact ca.bkaw:paper-nms:pom:1.19-SNAPSHOT in papermc (https://repo.papermc.io/repository/maven-public/) Could not find artifact ca.bkaw:paper-nms:pom:1.19-SNAPSHOT in papermc (https://repo.papermc.io/repository/maven-public/) two times

dusk flicker
#

?paperdev

undone axleBOT
#

Make sure to ask in the appropriate server concerning development towards different JAR types such as PaperMC. (Tip: Google them!)

wild marten
#

try the paper discord

dark harness
#

They're not Supporting papernms maven xd

tender shard
#

neither does spigot

eternal oxide
#

We only support Spigot

tender shard
#

what is "paper nms" supposed to be anyway? NMS is NMS

wild marten
#

nms using a paper jar ig

dark harness
dusk flicker
#

?otherdev still not supported here. go ask whoever made it

undone axleBOT
#

For questions concerning other server software, ask in the appropriate help server.

lethal roost
#

lessgoooo

#

now i just need to figure out the id for the offhand slot :poob:

wild marten
#

log the slot number of whenever you click on a slot, then click on the offhand slot

#

seems like a custom chat mixed with a custom font pack

dusk flicker
#

its a resource pack that changes non commonly used characters.

lethal roost
river oracle
#

yes you can make this by doing that

lethal roost
wild marten
sterile token
#

Hella, i have some questions about class inheritance, let say i have a Super class with some methods, but another class extend it and it have extra methods

#

I dont know why im nighmare with this simple thing

iron glade
#

Anyone has an idea why this is not firing?

sterile token
#

You want to do a plugin that work with custom texture pack?

iron glade
#
if (event.getClick() == ClickType.DOUBLE_CLICK && event.getClick().isShiftClick()) {}```
sterile token
#

Custom texture?

#

Dm me please

river oracle
#
iron glade
river oracle
sterile token
sterile token
iron glade
sterile token
#

Can u upload full code to git and add me to repo

#

So i can check full code

iron glade
#

Is it even possible to trigger the double click when I'm reopening the inventory with single clicks?

sterile token
#

Its easier to help

mortal hare
#

does separate dimension have a separate player's inventory or that's just a multiverse-core thing

iron glade
mortal hare
#

what if i create dimension with normal world generation

#

and travel there without mv core

#

im asking this since im manipulating player's inventories rn and I would need to give player's items back after some time

wild marten
#

I think if you load the world in through code, then tp the player, their inv should remain the same throughout the worlds

#

but I havent worked with custom worlds is a while so i might not be correct

mortal hare
#

not that's just my dementia lol

#

apparently multiverse-inventories is a thing

#

and there are no separate inventories in multiverse-core

sterile token
#

Anyone else love lamda? Looks pretty cool

claim.getMembers().stream().map(Bukkit::getOfflinePlayer).map(OfflinePlayer::getName).collect(Collectors.toList())```
mortal hare
sterile token
#

Yeah, but meh i dont worry so much on performance

#

Because it just for a command

#

Ima be wrong but just discovered that mongo has an async driver for java

umbral olive
#

wait offline players store uuids if they have joined the server before correct?

sterile token
#

😡 🤡

sterile token
mortal hare
#

usercache.json

sterile token
umbral olive
#

ah, didn't know that and i made a whole system to save them

#

wow

wild marten
mortal hare
#

there's bazillion of devs who don't know that and save it too

sterile token
#

Dovidas, do you know any tuto about annotations and construtos with anno? like:

boolean execute(Command command, AnnotClass argument);

So them i can do argument.name(), etc

mortal hare
#

but I always skip them for some reason

sterile token
#

Oh the same happen to me, im wondering learn annot proccessing and i dont do it because either dont have time nor forget it

viral grail
#

I'm unable to modify a Spigot message via BungeeCord on 1.19. I made 2 test plugins to add "Test" to the start of my message and broadcast it on both servers, and this is what happens

Here's a thread with more info: https://www.spigotmc.org/threads/1-19-chatevent-setmessage-doesnt-affect-message-on-spigot.560995/

#

Does anyone know if that's intentional or not?

sterile token
#

How are you sending/receiving the messages? PMC (Plugin Message channel), Redis? Just for being curious

iron glade
#

Guys one dumb question, but is this a proper sentence?
"Edit the height from which anvils are dropped when /anvil [player] is used"

sterile token
sterile token
viral grail
iron glade
viral grail
#

Bungee

public class BungeeChatTest extends Plugin implements Listener {
    @Override
    public void onEnable() {
        getProxy().getPluginManager().registerListener(this, this);
    }
   
    @EventHandler
    public void onChat(ChatEvent event) {
        event.setMessage("Test " + event.getMessage());
        getProxy().broadcast(TextComponent.fromLegacyText("Bungee: " + event.getMessage()));
    }
   
}

Spigot

public class BungeeChatTest2 extends JavaPlugin implements Listener {
    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
    }
   
    @EventHandler
    public void onChat(AsyncPlayerChatEvent event) {
        Bukkit.broadcastMessage("Spigot: " + event.getMessage());
    }
   
}
#

This worked as intended on 1.18.2 and below

sterile token
viral grail
#

Changes in 1.19

sterile token
iron glade
tardy delta
#

only that first thing is adding "Test"

viral grail
#

Spigot, because it doesn't recognize the change

sterile token
iron glade
#

Oh nice, it's morning in uruguay right now?

viral grail
#

However, if I cancel the ChatEvent on bungee, it cancels it on Spigot

sterile token
iron glade
sterile token
#

Yeah, they check if player has moved or not in a specific amount of time

wild marten
#

There is an event called PlayerMoveEvent, and you record down intervals between when that event was last fired, if the interval is too long, you assume they are afk

tardy delta
#

the server keeps track of that?

wild marten
#

well your plugin needs to

mortal hare
#

Central Europe

#

or Northern Europe

#

for you

tardy delta
#

middle earth

wild marten
mortal hare
tardy delta
#

correct (╯°□°)╯︵ ┻━┻

neat galleon
#

Hey all, I'm working on a fix to a dead mod, emojichat, from this change in 1.19: https://bugs.mojang.com/browse/MC-251764

I had tried the suggestion of replacing \u0020 characters with \u0000, but it looks like it just changes it to another character, [sp].

I'm not super familiar with all of the ins and outs of the Minecraft Unicode stuff, I had previously added some custom emotes for a small server which just took editing the resource pack itself.

I wasn't sure if anyone had come across this character before and could point me in the right direction, I'm sure I'm just doing something dumb.

minor garnet
#

and does anyone know where i can find for the other versions?

viral grail
#

I'd recommend checking for walking + head movement separately and check if both have changed. That way getting pushed by water doesn't consider them active

tardy delta
#

im not sure if a playermove event is fired whenever the player moves it head, would makes sense as the yaw or pitch changes but you could check that out

#

also ^^

wild marten
viral grail
sterile token
#

world.getPlayers().stream().filter(Object::equals).forEach(CraftPlayer::sendPacket); you can simply it

tardy delta
#

wouldnt be too difficult

minor garnet
#

k

viral grail
tardy delta
#

performance will go bro if you scale that or if there are a lot of players

viral grail
#

Because I was thinking PlayerMoveEvent already listens to those packets

tardy delta
#

why are people calling a Player object 'all' in their foreach lambda anyways?

sterile token
tardy delta
#

makes sense

sterile token
#

But on newer versions, they are more optimized

tardy delta
#

streams are still slow fuckers in most cases

sterile token
tardy delta
#

and enhanced for loops can look fancy too 😏

dusk flicker
#

streams r nice tho

#

lol

sterile token
#

I dont like shity foreach without lamda

minor garnet
tardy delta
#

i only use a forEach if i can use a method reference in it

minor garnet
#

k

#

some know ?

sterile token
tardy delta
#

¯_(ツ)_/¯

minor garnet
tardy delta
#

people being weird i guess lol

minor garnet
#

what byte i use to make player dont pull the bow more..?

wild marten
sterile token
minor garnet
sterile token
#

?protocol

true perch
#

is there a way in 1.19 to change the direction a player is facing without having to teleport them?

viral grail
#

I don't think so

#

Why?

sterile token
#

Wouldnt hep changing his yaw and pitch location?

tardy delta
#

that doesnt reflect on the player iirc

minor garnet
sterile token
#

If he want to change the player camera, change his pitch and yaw

#

i used to do that on older versions

wild marten
sterile token
#

Oh good point

#

Im just giving suggestion

wild marten
#

i remember a old donny bobes video where he had a plugin that moved their pitch/yaw

#

so there definitely is a way to do it

peak depot
#

are you sure it wasnt scripted?

wild marten
#

maybe idk

#

was like 5-6 years ago

sterile token
#

Any alternative, for getting an OfflinePlayer by his name? Because looks deprecated

river oracle
echo basalt
sterile token
tardy delta
#

if you only have a name theres no other way

true perch
tardy delta
#

?tryandsee

undone axleBOT
sterile token
#

?tryandsee

undone axleBOT
glossy venture
neat galleon
glossy venture
#

isnt there supposed to be an embed

tardy delta
#

idk

sterile token
sterile token
#

You are telling, entity.horse

glossy venture
#

weird spawn mechanics or smth

#

idk why they would do that

sterile token
#

To make a entity follow a player i need to?

echo basalt
#

with paper, getPathfinder.moveTo

glossy venture
#

maybe you need to use nms idk

tardy delta
#

pathfinder goals

echo basalt
#

without paper, nms

sterile token
#

Wouldnt a way, setting the velocity?

#

I think someone sent something here

earnest forum
#

that wouldnt have a walking animation though

sterile token
#

Its a hide entity

#

So meh i dont care

glossy venture
#

then just tp it

#

to the player

#

or do you want it to trail behind a bit

sterile token
#

but teleport require lot of resources

glossy venture
#

if you make it a marker it wont be sent to the client i think

#

and thats done async anyways

#

updating the position isnt intensive

sterile token
#

Its cuz of tracking the player movements

sterile token
#

You can imagine what yeath im try to reply

echo basalt
#

top is paper, bottom is nms

sterile token
#

Its for a trying of an ac that why

earnest forum
#

we love the letter methods

sterile token
#

Also is extrange that hipixels ac have some bugs

#

At some time you can see the entity on tab or screen

tardy delta
#

weirdest thing ive seen today

sterile token
#

Hmns shity methods

tardy delta
#

check if they have played before smh

glossy venture
#

and otherwise take in as a player name

sterile token
#

He?

glossy venture
#

then you can do both Orbyfied and e32e2-23dniu-blablabla

true perch
#

is there a way in 1.19 to change the direction a player is facing without having to teleport them?

true perch
glossy venture
#

pretty sure you have to use teleport

#

that updates the views of other players automatically too

earnest forum
#

unless you wanna use packets

glossy venture
#

otherwise use nms to set the direction

#

and then use packets

#

yeah

sterile token
tardy delta
#

regex or checking the length and trying to parse it and catching exceptions

quaint mantle
#

any one got good resources on using nms im completly new to nms ?

tardy delta
#

nms is undocumented lol

#

what are you using nms for

quaint mantle
#

changing playername

tardy delta
#

oh..

#

dont ask me i dont learn that shit

#

lmao

quaint mantle
#

haha

glossy venture
#

@sterile token

String plrArg = args[0];

UUID uuid = null;
try {
  uuid = UUID.fromString(plrArg);
} catch (/* not a (valid) uuid */ IllegalArgumentException ignored) { }

Player player;
if (uuid != null)
  player = Bukkit.getOfflinePlayer(uuid /* use uuid */);
else
  player = Bukkit.getOfflinePlayer(plrArg /* use name */);
#

its a bit stupid and messy

#

but yeah

#

that should work

tardy delta
#

wouldnt regex be faster than throwing an exception?

glossy venture
#

bruh no def not

tardy delta
#

hm idk

glossy venture
#

regex slow af

#

doesnt really matter here

tardy delta
#

exceptions slow too

glossy venture
#

ima make benchmark

#

to generate random strings and pass them to get exceptions

normal prism
#

Hi dose anyone know how to set a players nametag colour onPlayerJoin?

cosmic spear
#

Hi guys how i can take status of server from bungeecord, i've tried with ProxiedPlayer but i don't like this method

#

Its possible have something like ProxyServer.getInstance().getServerInfo("dev").getPing()

sterile token
#

Also, how can i order the command?

#

So it more clean

tardy delta
#

use brackets lmao

sterile token
#

i cannot even paste it n discord

#

Imagine the clean it has

earnest forum
#

?paste

undone axleBOT
earnest forum
#

...

sterile token
#

I cannot open google it frose my pc

#

That why

tardy delta
#

oh no this.plugin.getApi().getMessage().send

sterile token
#

What?

tardy delta
#

every time

sterile token
#

Oh ok

#

What better?

#

A var right?

tardy delta
#

kinda

sterile token
#

Allright, and what about creating 2 vars of claim

#

Can be reued?

tardy delta
#

bruh you gotta be kiddin me, one line

this.plugin.getApi().getMessage().send(player, "Claim.Info", "{prefix}", this.plugin.getConfig().getString("General.Prefix"), "{owner}", Bukkit.getOfflinePlayer(claim.getOwner()).getName(), "{home}", claim.getHome(), "{flags}", claim.getFlags(), "{members}", claim.getMembers().stream().map(Bukkit::getOfflinePlayer).map(OfflinePlayer::getName).collect(Collectors.toList()));```
sterile token
#

Hahaha

#

I cannot live without one line

tardy delta
#

looks like i cannot live with you 💀

sterile token
#

Not only you

sterile token
#

claim.getMembers().stream().map(Bukkit::getOfflinePlayer).map(OfflinePlayer::getName).collect(Collectors.toList()));
this the novel of my one line code

tardy delta
#

tf

sterile token
#

So claim can be reused?

#

shit fkcd google

#

It hella the hole pc

tardy delta
#

have you uploaded your claim plugin to gh yet?

sterile token
#

What do you need to see

#

i can send it

tardy delta
#

all :kekw:

sterile token
#

Lol, why edge, open nodejs service?

sterile token
tardy delta
#

wanna see it lol

tacit drift
# glossy venture <@406057762376908800> ```java String plrArg = args[0]; UUID uuid = null; try {...
#

just use regex

mighty bane
#

So I'm testing a new plugin and am getting this error code:
Could not load 'plugins\LifeShareTeams-0.1.jar' in folder 'plugins': uses the space-character (0x20) in its name

Does anyone know what this means?

eternal oxide
#

Thats a 9 year old question. Exception raising has greatly improved since then

river oracle
#

what the hell are you on

eternal oxide
#

I never said they were

#

oh not me 🙂

tardy delta
#

lmao

glossy venture
#

i dont really care if its an anti pattern as long as its performant

#

you shouldnt use it everywhere

river oracle
#

throwing exceptions purely makes sense for some things

glossy venture
#

but i expect regex to be quite a bit slower

eternal oxide
sterile token
#

I never understand pattern

#

And i read alot about them

echo basalt
sterile token
tardy delta
#

not me lol

sterile token
#

That why i came here to ask recommendations

#

Dont bullshit me

echo basalt
#

write simple code

sterile token
echo basalt
#

No

#

I mean like basic code

sterile token
#

why?

#

if-else

#

Are you trying to make me using shity if-else

desert tinsel
#

switch-case

tacit drift
echo basalt
#

yeah but don't stick a stream between every line of code just because it makes complicated actions in 1 line

tardy delta
#

just write a for loop

sterile token
echo basalt
#

you say "don't bullshit me" and then say shit like that

glossy venture
#

ok im stupid ofc regex is slower because you need to parse it afterwards too

#

but just for checking regex is actually faster i think

glossy venture
#

with an avg 174ns / pass

sterile token
#

Also why switch over if?

#

Its a big dicussion

tardy delta
#

what is slower

glossy venture
sterile token
glossy venture
#

and i doubt youll ever only need to check

tardy delta
#

mye as it will check it twice

glossy venture
#

yeah

sterile token
#

Altoguht i cannot do a switch

tardy delta
#

havent even looked at UUID#fromString lmao

glossy venture
#

so fromString is preferable imo

sterile token
echo basalt
#

fromString just does fancy int parsing

tardy delta
#

4 nibbles

echo basalt
tardy delta
#

ok looks pain

echo basalt
#

still faster than regex

sterile token
#

what the heck are 0x0FFF

#

Shit

echo basalt
tall dragon
glossy venture
sterile token
glossy venture
#

but regex only checks

echo basalt
glossy venture
#

so its actually kinda uncomparable

echo basalt
#

so it's the new java9+ method

tall dragon
#

yea

glossy venture
#

because to get the uuid you need fromString anyways lol

echo basalt
tall dragon
#

you defo shoult try to avoid java 8 with UUID#fromString

#

the newer method is quite a bit faster

echo basalt
#

java8 does string checks iirc

sterile token
echo basalt
#

this is java8

tall dragon
glossy venture
#

wait bruh

#

my regex pattern is broken

#

lol

#

that might be why

#

it validated this

#

lmaoo

sterile token
cosmic spear
#

Hey guys its possible ping a server with bungee for take the status of the server? Without ProxiedPlayer?

echo basalt
#

you gotta add dashes

echo basalt
#

no need for bungee even

glossy venture
#

oh wait im not checking the result of the regex

#

it might not be

#

broken

echo basalt
#

just try to open a socket or something

cosmic spear
tall dragon
sterile token
#

Its possible to send data encoded from proxy-spigot and backwards doing pings?

echo basalt
#

ehhh

sterile token
#

I have read that on forum spigot one

echo basalt
#

very not good

#

lol

glossy venture
#

ok most performant way to do this (cpu time, idk about memory) is

if (uuidPattern.matcher(str).matches()) {
   // account for parsing done in fromString
   UUID.fromString(str);
}
#
+- UUID_RegexDontParse: 1000000 Passes (MAX)  | Total Time: 185964899ns (185ms) | Avg. time/pass: 185ns (0ms)
+- UUID_RegexDoParse: 1000000 Passes (MAX)  | Total Time: 132492801ns (132ms) | Avg. time/pass: 132ns (0ms)
+- UUID_Exception: 232006 Passes  | Total Time: 1000126999ns (1000ms) | Avg. time/pass: 4310ns (0ms)
echo basalt
#

this is just proof that trycatch is a slow method

sterile token
glossy venture
#

benchmartk code

tall dragon
#

its pretty generally known you should never catch an exception that you can avoid.

echo basalt
#

make an internal server protocol that communicates data

glossy venture
#

now i bet with random lengths too fromString is faster tho

#

because it will stop immediately

#

so idk

tall dragon
#

Redis pub/sub is a godsend for cross server data communication

#

imo

glossy venture
#

interesting how parsing is faster than not parsing 🤔

#

i have concluded that java has a pretty fast vm

sterile token
#

SO

#

Is possible to reuse Claim var or not?

true perch
#

I hear the word "packets" being tossed around quite a lot. I'd like to learn more. My current objective is being able to manipulate a client's packets to force their camera location, but I would love to get a better understanding of packets in general. It seems packets can be used to make a truly unique experience.

sterile token
#

PAtience

sterile token
iron glade
#

Is there a better way of doing something like

    public Object getValue() {

        Object o = plugin.getConfig().get(getPathToSetting());

        if (o != null) {
            if (o.getClass() == Boolean.class) {

                return plugin.getConfig().getBoolean(getPathToSetting());

            }
            else if(o.getClass() == Double.class) {

                return plugin.getConfig().getDouble(getPathToSetting());
            }
            else if(o.getClass() == Integer.class) {

                return plugin.getConfig().getInt(getPathToSetting());
            }

        }
        return plugin.getConfig().get(getPathToSetting());
    }```
umbral olive
#

why doesn't spigot have packet events?

iron glade
#

getting an object from config

#

Boolean / integer / Double

chrome beacon
#

Just use get directly like you did on the 2nd line?

iron glade
#

I tried

#

but int settingsValue = (Integer) setting.getValue(); gave me an exception

chrome beacon
#

Send it

#

?paste

undone axleBOT
iron glade
#

java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')

#

yeah idk why it says it's a double

sterile token
#

if number have a "," or "." its a double

sterile token
chrome beacon
#

It changes nothing

crisp steeple
sterile token
#

Lmao, why the heck copilot every 2-4d has a new update?

crisp steeple
#

ah

sterile token
#

Yeah, we denote decimals with the "," because "." for us means thousans

tender shard
#

same here. 1.000.000,00 is a million

sterile token
#

1.000.000__,00__m

the underline is the decimal part

chrome beacon
#

Because they change stuff?

sterile token
#

Im thinking for creating an intellij plugin, for auto update for intellij plugins

sage dragon
#

If you want to hide a player, but don't want to remove them from tab, why don't you just use invisibility?

#

You can still see the nametag while invisible? That's definitely a plugin doing this

kind hatch
#

Or a client. Invisibility hides the nametag. Unless you are on the same team using scoreboards, the player will be invisible.

wild marten
#

o wait

#

u want them on tab

kind hatch
#

That removes them from the tab list. Which isn’t what they were wanting.

tender shard
#

hideEntity

wild marten
#

well you could simulate the player on tab

kind hatch
jagged quail
#

my 20GB free is sobbing

tender shard
jagged quail
#

@tender shard i just change the 1.18.2 to 1.19 in pom.xml to update it?

tender shard
#

to update what?

kind hatch
#

You need to run build tools as well.

jagged quail
#

like this

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

to

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
tender shard
#

yes

#

just change it to 1.19

#

more isnt needed

jagged quail
#

is latest i believe

#

oh 3.0.0 is latest

iron glade
#

I just found out about ChatPaginator.wordWrap and holy shit is this useful

tender shard
kind hatch
#

It is, but it’s annoying because it only accepts a String[] instead of a List<String>.

It’s not hard to convert, but it would be nice if it just had more overloaded methods.

tender shard
#

just use put

iron glade
tender shard
#

no, I just never needed to know at what place a line would break

jagged quail
#

alex

#

what does update checker 3.0.0 change?

tender shard
#

read the changelog

#

in the spigot thread

iron glade
kind hatch
tender shard
iron glade
#

noo

kind hatch
#

It returns a string array. So use it wherever you need it.

#

Whether that be chat or item meta.

iron glade
#

metaLore.addAll(Arrays.asList(ChatPaginator.wordWrap(lore, maxLoreLength)));

#

That gives me a nice lore that only has lines at a max length of maxLoreLength

#

if one line would be longer the word is just put in the next line

tender shard
#

I wonder why it's called "ChatPaginor" then lol

iron glade
#

ikr

tender shard
#

I would have thought it breaks it so that you know how the client would add line breaks when using the default font

#

in chat

iron glade
#

oh

#

yeah misleading name it has

#

but now that I found out I think I'm gonna use it on lores regularly

#

Before that I made custom breaks in the lines

urban kernel
#

how does one register an event that runs when someone died

#

dies*

iron glade
#

PlayerDeathEvent

urban kernel
#

ty

#

lass do i need to import

#

what class do i have to import

#

@iron glade

wintry badger
#

hi, what is the max. amount for ItemStack class?

#

i am looping through the player inventory and i was expecting to have another itemstack instance for every 64x of the item

#

but i think its not how it works

iron glade
#

and of course some can't be at all

urban kernel
#

ty

#

?

wintry badger
#

white wool for example

#

is it possible?

humble tulip
#

U can't stack past 64 normally

eternal oxide
#

Stack size is hard coded in teh Material data

humble tulip
#

There's a way to get to 127 but that doesn't work properly

eternal oxide
#

you can alter it using reflection, but its not easy

#

mfnalex has a plugin that allows you to alter teh stacksize (premium)

#

code is on GitHub

tender shard
#

Yes but I also limited it to a max of 64, because the vanilla client has 64 as limit hardcoded. Even if you set the stack size of e.g. COBBLESTONE to 128, the client wouldnt let you stack 2x64 cobble stacks. One would have to do all this manually.

To change the stack sizes, the following things are required (will reply again in a minute):

#

get the "maxStack" field of the bukkit Material class. It's a private final int. Change it to the value you want.
Then get the appropriate NMS Material. You can get it through CraftMagicNumbers, it's a net.minecraft.world.item.Item. It has a private static final int called "MAX_STACK_SIZE" in mojang mappings, "c" in obfuscated 1.17-1.19. Simply also change this

#

in 1.16 and below, or in "spigot mappings", it's called "maxStackSize"

#

and then you have to deal with a shit ton of bugs that this results in, mostly for items that can be "used" with right-click and that normally cannot be stacked. For example using a stack of 64 water buckets will result in only one empty bucket. For potions however, it works fine. This is all pretty random

eternal oxide
#

So the answer is, yes you can, but you will regret it.

wind tulip
#

Hello, I need help with a math problem. This isn't in spigot but it is in minecraft, I was wondering if it'd be appropriate to post here?

tender shard
#

sure

ocean lion
#

?ask

undone axleBOT
#

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!

worldly ingot
#

The answer is probably, somehow, twelve

dusk flicker
#

yes.

tender shard
#

probably

tall dragon
#

very likely

glossy venture
#

answer is x = amogus(y)

dusk flicker
#

error undefined variable y

tall dragon
#

i love how there are like at least 6 people patiently waiting for him to finish typing

dusk flicker
#

yes

glossy venture
#

amogus takes a y value and maps it to the x value i nthe amogus

wind tulip
#

I am trying to rotate a group of points (armorstands) around the structure's center of mass. Rotating the positions themselves is easy enough (I am simply getting the offset in position from the center of mass for each point and then rotating that as a vector on each axis by the desired amount)

To rotate the armorstand's head, it takes in two different types of parameters:
A) A vector (The top of the armorstand's head will face that way, not the front, but this should not matter with this context)
B) Three numbers (X-Axis, Y-Axis, Z-Axis, these numbers are degrees)

As said, I am simply getting the difference in location from each point to the center (Point - Center).
This is not giving me a vector representing the structure's overall orientation, it is giving me a vector pointing away from the center towards the new location of the point, so I can't just input that for the rotation.

glossy venture
#

do you have the overall orientation accessible somehow

#

or is this with command blocks or smth

wind tulip
#

there is no location/entity representing the overall orientation

#

it's variables

#

although not spigot

#

might be confusing

glossy venture
#

because applying that should give the desired result right

wind tulip
#

yes the task is to construct the view vector

glossy venture
#

for each block right

#

to make it a smooth cube

wind tulip
#

yes

#

but all I have is the degrees

glossy venture
#

yeah

#

ah

#

wait 3 angles?

wind tulip
#

basically, degrees to rotate the offset vector for each point on all 3 axes

glossy venture
#

ok

wind tulip
#

although in the video it's only rotating on 2

#

but I will need all 3 to work

glossy venture
#

isnt the orientation attribute 3 angles

#

tag

#

i mean

wind tulip
#

well might be for command blocks but this isn't that

glossy venture
#

what is it?

wind tulip
#

a custom coding language designed to run on a server

glossy venture
#

ah

wind tulip
#

it's not even text based, it's inside the game basically

glossy venture
#

you can use sin and cos there right?

#

and tan and shit

zenith gate
#
p.addPotionEffect(PotionEffect.slowness(10, 2));

Is this how you would add a potion affect?

wind tulip
wind tulip
#

not sure if duration goes first

wind tulip
#

might be amplifier before duration I don't remember

zenith gate
#

its duration first, then amplifier

wind tulip
#

k

wind tulip
glossy venture
#

nah me neither hold on

#

im trying to figure it out

wind tulip
#

Math is not exactly my strong point I'll be honest lol

glossy venture
#

just had sin and cos and shit

#

lmai

#

lmao

#

oh wait

#

i think i might know

#

its weird

#

cuz you need 2 axis on the look vector per angle

#

i think

#
Vector lookvec = new Vector();

float yaw   = ...;
float pitch = ...;
float idk   = ...;

/* yaw */           lookvec.add(/* x */ Math.cos(yaw), /* y */ 0, /* z */ Math.sin(yaw));
/* pitch */         lookvec.add(/* x */ 0, /* y */ Math.cos(pitch), /* z */ Math.sin(pitch));
/* the other one */ lookvec.add(/* x */ Math.cos(idk), /* y */ Math.sin(idk), /* z */ 0);
``` @wind tulip idk lol
#

maybe this

#

thats in java tho

#

so idk how your thing works

wind tulip
#

so yaw would be the degrees of rotation on the Y axis?

#

then "idk" would be Z

glossy venture
#

yes

wind tulip
#

wait no I meant Y

glossy venture
#

idk = Y

verbal copper
#

Does anyone have an example on how I can give a player a pre rendered map with an image on it?

glossy venture
#

pitch is also Y

#

but then like on the X

#

or Z

#

i mean

wind tulip
#

well yaw would rotate around Y

glossy venture
#

yeah

#

like that

#

pitch around X

wind tulip
#

yeah

glossy venture
#

and idk around Z

#

i think

wind tulip
#

yup

#

I'll try it out

glossy venture
#

if it works ill be shocked

wind tulip
#

lol

glossy venture
#

ah its called roll

#

the idk one

wind tulip
#

yes

#

ik

#

it would be so cool if you could adjust that in mc

glossy venture
#

oh yeah

#

your head like upside down

#

or to the right

wind tulip
#

lol yup

#

a lot of funky rotation issues would be fixed if they didn't automatically flip the yaw once you try to look upside down

glossy venture
#

wait what

eternal oxide
#

To avoid you prevent flipping, or you rotate using quarternions

glossy venture
#

waht the fuck

#

thats som e weird rotation

#

wait but they do look like they are rotation correclty

#

wtf

#

h no

#

nvm

#

some axis do

wind tulip
#

hm

glossy venture
#

can you show the directions

#

the axis

#

in f3

wind tulip
#

k

#

f3 doesn't show you that for armorstands actually

#

but I can display it using particle lines

#

gimme 1s

glossy venture
#

nah like show which axis everything is

eternal oxide
#

you seem to be double rotating. you are rotating them all about an origin, but you are also rotating them about their own axis

glossy venture
#

yeah thats to make it look seamless

wind tulip
glossy venture
#

like one cube

#

they need to rotate

wind tulip
#

I don't have the direction that the whole structure is facing

eternal oxide
#

yes, but when you are rotating them about their axis you are doing it in reverse

wind tulip
#

if I did I could just input that

glossy venture
#

like

wind tulip
glossy venture
#

the workd axix

eternal oxide
#

I assume you are trying to rotate them all as one big cube

wind tulip
#

no

#

ok so

#

what I'm doing is rotating a group of points (armorstands) around another point

#

they are rotating properly but then I need to rotate their heads too so that it's smooth

#

the problem is, I don't know, in the code, which direction they should face (as a vector)

eternal oxide
#

but are they supposed to remain in formation, as if its a BIG cube rotating?

wind tulip
#

yes

eternal oxide
#

then yes, your individual rotation is wrong, you are doing that in reverse

wind tulip
#

doing what in reverse

eternal oxide
#

the rotation of each block

wind tulip
#

so multiply the vector by -1?

#

is that what you mean

eternal oxide
#

look at your video, they are holding teh correct position in the formation, but they rotate in the reverse of the way they should

wind tulip
#

ah I see what you mean

glossy venture
#

can you even set the look vector on armor stands

#

i cant do it with spigot api

#

only euler angle

wind tulip
#

this isn't in spigot though

#

they probably converted the vector

glossy venture
#

yeah ik but thats interesting

wind tulip
#

somehow

glossy venture
#

oh wait

#

no i d=still dont know

#

oh yeah wait in minecraft source code they invert the y component

#

and they also multiply, not add

hexed rover
#

Hi, is there a way for me to get all minecraft commands on plugin loading?
It seems like the "knownCommands" don't contain them when my plugin is loaded, at that time it only contains the servers commands (bukkit, spigot, and depending on if its paper or not also the paper commands)

tender shard
hexed rover
iron glade
#

How do I avoid Raw use of parameterized class 'Class'

#
    public Class getInstanceOf() {

        return switch (getSettingType()) {
            case BOOLEAN -> Boolean.class;
            case DOUBLE -> Double.class;
            case INTEGER -> Integer.class;
        };

    }```
quiet ice
#

Use Class<?>

ocean lion
#

How would I use this + get the UUID cause when I use rank plugin it changes the displayname of the player so the GUI wont work

#

target = player.getServer().getPlayerExact(ChatColor.stripColor(event.getCurrentItem().getItemMeta().getDisplayName()));

iron glade
eternal oxide
crisp steeple
#

yeah, you could put the players uuid on the items pdc, and then get that when needed

ocean lion
#

pdc?

crisp steeple
#

persistent data container

tender shard
eternal oxide
#

If this is for your admin menu just use FIxedMetadataValue in the heads Meta

ocean lion
crisp steeple
#

but also yea, you dont really need to use pdc for this, metadata would probably work

eternal oxide
#
head.setMetadata("player", new FixedMetadataValue(plugin, player.getUniqueId().toString()));```
hexed rover
# tender shard ah I misunderstood. Anyway, you'll have to wait a tick, then it'll also include ...

is it fine with 1 tick though?
What I'm trying to do is loading/unloading modules dynamically and if I replace a minecraft command, re-register it when the module gets unloaded.
This far it works, but I've only tried it when the module was loaded while the server was already on, the moment i restarted the server with the module turned on, and i turned the module off, the minecraft commands didn't come back, already debugged so this is why i was asking about this.
I'm afraid that if I delay the loading of the modules by a tick that it could end up in weird behaviour .-.

eternal oxide
#

You don;t need to toString, just store teh UUID

hexed rover
tender shard
hexed rover
#

alright ty

tender shard
#

incoming "Damageable" question

eternal oxide
#

To read the UUID back```java
if (!head.hasMetadata("player")) return;

UUID id= UUID.fromString(head.getMetadata("player").get(0).asString());```

ocean lion
crisp steeple
#

without the tostring stuff

eternal oxide
#

yep

eternal oxide
hexed rover
tender shard
#

np! IT's a bit weird that the vanilla commands get registered after the bukkit ones etc

#

should be other way around imho lol

#

but yeah that's the way it is

hexed rover
#

yea true, delaying the loading by a tick was pretty much my first idea, but I was just wondering if theres a cleaner solution since delaying on init doesn't seem like the best thing to me

tender shard
#

there is no other way

#

this is from CraftServer

#

it first loads all plugins and enables them, then after they are all enabled, it adds the vanilla commands to the map

hexed rover
#

I highly assume it sets the plugin commands beforehand so they override the minecraft commands

ocean lion
#

?paste

undone axleBOT
eternal oxide
crisp steeple
#

youll want to make sure the player is online though

ocean lion
#

could you maybe come online on my test server and see what im talking about?

eternal oxide
#

They will be, he creates teh skulls from online players

#

I guess they could have logged off in the ser seconds between

crisp steeple
eternal oxide
#

yep

crisp steeple
ocean lion
#

so he understands my problem and maybe could help further

crisp steeple
#

the problem being?

eternal oxide
#

getOwnign Player should be fine as it returns an OfflinePlayer

crisp steeple
#

just get the owner of the head

#

yea

ocean lion
#

I HAVE IT IN MY CODE

#

but it doesnt work which clearly means u dont know what im saying the problem is

crisp steeple
#

dont see how seeing it on the server would change that...

ocean lion
#

Exactly

#

but maybe is you actually saw you would understand no?

crisp steeple
#

i do not see how seeing this inventory would change your problem

eternal oxide
#

where you need to find who the player is for that head java ItemStack head = clickedItem...; SkullMeta headMeta = (SkullMeta) head.getItemMeta(); return headMeta.getOwningPlayer();

#

That give you the OfflinePlayer for that head