#help-development

1 messages · Page 345 of 1

rough drift
#

hey optic

#

rewrite it

#

I employ this tactic and so far I've achieved nothing

vagrant stratus
#

That's what I'm trying to do so it's more OOP lmao

rough drift
#

No no

#

Don't refactor

#

rewrite

#

scratch everything

#

and rewrite

vagrant stratus
#

One thing at a time

#

Currently have my own solution and @dry yacht 's merged, which makes rewriting hard enough as is lmao

rough drift
#

What are you even making

vagrant stratus
#

While I can't say what exactly, I bugged you guys to fix https://www.youtube.com/watch?v=71qG38X3bcM originally.

The issue being that while it did hover between a specific set of locations (min-max Y coords), they weren't hovering in sync

vagrant stratus
#

correct

rough drift
#

k

#

i'll assume server

#

I don't think you do comms for anything lol

vagrant stratus
#

Comm actually

rough drift
#

oh

vagrant stratus
#

lmao

final monolith
#

Someone told me its not necessary

rough drift
#

Well that was unexpected

vagrant stratus
#

okay tbf I didn't think I'd get any offers either lol

remote swallow
rough drift
#

I mean I don't think you wouldn't get any, I thought you wouldn't offer any services

vagrant stratus
#

Oh I do

rough drift
#

Oh

#

Welp

final monolith
rough drift
#

Average services title

final monolith
# remote swallow they were wrong
                    <relocations>
                        <relocation>
                            <pattern>com.google.code.gson</pattern>
                            <shadedPattern>codes.laivy.npc.relocations</shadedPattern>
                        </relocation>
                    </relocations>

thats correct?

vagrant stratus
remote swallow
#

would be better under codes.laivy.npc.gson but yeah

rough drift
#

in years

#

since you say 5+

remote swallow
#

3

final monolith
#

NoSuchMethodException, like the version is wrong

vagrant stratus
rough drift
#

though roughly 6-6.5 years (recalculated lmao)

remote swallow
vagrant stratus
#

Jun 25, 2017 being the first resource

rough drift
#

(So yeah I don't mean day exact, I mean rough range lmao)

remote swallow
#

i found the exact message @young knoll told me to make my bot in jda instead of node

haughty granite
#

if the file exists, it should not write in but recreating another one with name-1.txt, name-2.txt... how can I do?

remote swallow
haughty granite
#

god

#

I'm already sweating

vagrant stratus
rough drift
#

a simple approach is to just

var i = 0;
var file;
while(true) {
  file = new File(getDataFolder(), "codes" + i + ".txt");
  if(!file.exists()) break;
  i++;
}

lmao

#

don't use this

#

I am tired as fuck

young knoll
#

Node is cursed

worldly ingot
#

monkaS please don't use that

rough drift
#

I'll go lmao

vagrant stratus
rough drift
#

I am tired as fuck

remote swallow
#

hi tired as fuck, im ebic

haughty granite
#

ebicpic is fuck, im tired

young knoll
#

I was going to tell you to use the dead python api for discord

#

But apparently it’s not dead anymore

remote swallow
#

was about to say

#

how do you remember what you were gonna do

#

9 months ago

#

i dont remember what half of the stuff on my todo list is

#

and i made it 8 hours ago

young knoll
#

I was referring to 5 minutes ago

remote swallow
#

oh

formal bear
#

What's the sound enum of breaking ore blocks like iron or emerald blocks?

lost matrix
#

Gonna be fun

vagrant stratus
#

Also @dry yacht I'm stupid, that was not quite it, but useful nonetheless given I'm going to make the API public and I'd bug you for these sorts of things to get some examples anyways lol

Going off the references, A player right clicks a block, the armor stand then hovers above said block between a min/max Y coordinate.

The code I've provided originally would cover this, but is incompatible with the current impl, though so is a lot of the plugin lmao

remote swallow
young knoll
#

Don’t ore blocks use the same sound as stone

#

Or do they have their own now

remote swallow
#

they use stone iirc

formal bear
#

I meant ore_block, k found it BLOCK_METAL

dry yacht
vagrant stratus
#

min/max y coord

#

actually

#

I might just have low braincells after dealing w/ this for so long, I'll resend the original method

stone dust
#

Why do i get NBSP when i use String.format?

Code:

public static String formattedMoney(Integer money) { double doubleMoney = money; return String.format("%,.0f",doubleMoney).replaceAll(","," "); }

vagrant stratus
#

Most of my time coding today has been on this one issue lmao

dry yacht
vagrant stratus
#
if (moving.get(armorStand)) {
            Location next = current.clone().add(0, 0.1, 0);
            armorStand.teleport(next);
            next.add(0, .1, 0);
            subLine.teleport(next);
            if (current.getY() >= start.getY()) {
                moving.replace(armorStand, false);
            }
} else {
            Location next = current.clone().subtract(0, 0.1, 0);
            armorStand.teleport(next);
            next.add(0, .1, 0);
            subLine.teleport(next);
            if (current.getY() <= end.getY()) {
                moving.replace(armorStand, true);
            }
}
#

This would have to be replaced to work with the lines as well

dry yacht
#

Uhm, what's lines real quick? I thought it was n = 2 in your case.

vagrant stratus
#

Correct, for the above code. The top line is the armorStand variable and the bottom is subLine

vagrant stratus
# vagrant stratus ``` if (moving.get(armorStand)) { Location next = current.clone().ad...
moving.put(hologram.armorStand(), false);

        Location currLoc = hologram.armorStand().getLocation();
        Location highestLoc = Utils.getLocalCoord(0, 4, 0, currLoc).add(0, 0.001, 0);
        Location lowestLoc = Utils.getLocalCoord(0, 2, 0, currLoc).add(0, 0.001, 0);

        hologram.armorStand().teleport(start);

        movementTask = new BukkitRunnable() {
            @Override
            public void run() {
                applyToLoc(hologram.armorStand().getLocation(), highestLoc, lowestLoc, hologram.armorStand(), hologram.getLineBelow());
            }
        }.runTaskTimer(plugin, 0, 1);
#

So what the code should do is move the lines between two locations.

In this case, it's the currLoc + 4 on the Y axis, and currLoc - 2 on the Y axis

#

i.e. this

#

err, roughly anyways

#

Red being the highest point it should go, yellow being the lowest point again regardless of where "orange" is

bold vessel
#

With this code :

    private ItemStack createLegendaryShield() {
        ItemStack shield = new ItemStack(Material.SHIELD);
        ItemMeta meta = shield.getItemMeta();
        meta.setLore(Arrays.asList(ChatColor.YELLOW + "Item Légendaire"));
        meta.setDisplayName(ChatColor.GOLD + "Bouclier légendaire");
        shield.setItemMeta(meta);

        @EventHandler
        public void onPlayerInteract(PlayerInteractEvent event) {
            Player player = event.getPlayer();
            if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                ItemStack item = player.getInventory().getItemInMainHand();
                if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
                        && item.getItemMeta().getDisplayName().equals(ChatColor.GOLD + "Bouclier légendaire")) {
                    if (!player.hasPotionEffect(PotionEffectType.HEAL)) {
                        player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 2));
                        player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 15 * 20, 0));
                        player.sendMessage(ChatColor.GOLD + "Vous avez utilisé le bouclier légendaire.");
                    } else {
                        player.sendMessage(ChatColor.RED + "Le bouclier légendaire est en cooldown.");
                    }
                }

        return shield;
    }
}```

I have this error but i dont understand : ';' expected
#

?paste

undone axleBOT
remote swallow
#

you cant have a method in a method

bold vessel
bold vessel
dry yacht
bold vessel
#

like this ?

remote swallow
#

yeah

vagrant stratus
dry yacht
vagrant stratus
#

Saving ourselves both time lmao

dry yacht
#

How are the two locations being defined? Are they constant over the lifetime of the hologram, or are they also subject to change?

vagrant stratus
#

In this case, constant.

If we took into account it being turned into a public API, who tf knows

remote swallow
#

anyone know if JavaPlugin.getResource needs the extension or not

vagrant stratus
#

Better to treat it as subject to change, I can always pass in the params needed regardless of if they're constant or not

vagrant stratus
remote swallow
#

guess its time to tas

vagrant stratus
#

@dry yacht I'll revert back to the original (but broken) code and show some better examples

dry yacht
vagrant stratus
#

I believe?
Once I've reverted I can just show you, and you'd most likely be able to get a better idea lol

worldly ingot
#

Make sure your project encoding is set to UTF-8

stone dust
worldly ingot
#

Yes

stone dust
worldly ingot
#

Or just make sure that whatever code editor you're using isn't inserting NBSP's in place of space chars

#

I can run that snippet fine and it works as expected

remote swallow
worldly ingot
#

Yeah that's your pom.xml encoding

#

(just the property should suffice)

stone dust
#

Yeah, it is also set to UTF-8

#

But i can run it like this

public static String formattedMoney(Integer money) { double doubleMoney = money; return String.format("%,.0f",doubleMoney).replaceAll(",", "SPIGOT"); }

and its still making a fuss

hasty prawn
#

What if you just do replace instead of replaceAll

stone dust
#

Let me try

#

But i think i have tested that, but not 100% sure

#

Nope, same thing

hasty prawn
#

Susge wat

rotund ravine
#

Ur probably using format wrong

vagrant stratus
dry yacht
dry yacht
# stone dust Same thing :/

Are you sure you execute the updated code? Could you just add a sysout right there to see if that shows up? We'd know for sure then.

stone dust
#

You mean like this?

quaint mantle
#

Yes

stone dust
dry yacht
#

I'm sure String#format is used wrong then. I hate the method myself tho, so I'm not sure what's wrong with it's invocation.

worldly ingot
#

Any reason you're formatting money the way you are by the way?

#

There is a DecimalFormat for currency

#

NumberFormat.getCurrencyInstance(Locale.CANADA).format(400000)

stone dust
vagrant stratus
worldly ingot
#

Why a space though?

#

Don't traditional currency formats use , or .?

worldly ingot
#

Or is it different in that language? Looks like Swedish but I'm uncultured lol

lost matrix
#

20.000.000,67 €

remote swallow
#

that is worng

wary mountain
#

i think i may have accidentally perma locked my server and i dont know how to undo it

    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:522)
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:420)
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306)
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1122)
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:303)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
    at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
    at java.base/sun.nio.ch.FileDispatcherImpl.write(FileDispatcherImpl.java:68)
    at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:132)
    at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:76)
    at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:67)
    at java.base/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:285)
    at net.minecraft.util.DirectoryLock.create(DirectoryLock.java:29)
    at net.minecraft.world.level.storage.LevelStorageSource$LevelStorageAccess.<init>(LevelStorageSource.java:398)
    at net.minecraft.world.level.storage.LevelStorageSource.createAccess(LevelStorageSource.java:323)
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:520)
    ... 5 more```
remote swallow
#

20,000,000.67 is orrect

lost matrix
#

Nope

remote swallow
#

yep

lost matrix
#

Just looked up the DIN norm

remote swallow
#

uk use that then

bold vessel
#

?paste

undone axleBOT
hazy parrot
stone dust
#

I want it to be formatted:
1 000 000
100 000
10 000
1 000
100

bold vessel
remote swallow
wary mountain
wary mountain
#

is there any way to fix

hazy parrot
bold vessel
#

yes

#

the switch is for the give command

lost matrix
bold vessel
#

for select which item u want to get ig

#

som1 know how to fix that

hazy parrot
bold vessel
#

whole code

remote swallow
#

the shield method is in a sub class

bold vessel
#

its not right ?

remote swallow
#

move the method to be in the same class as the rest

bold vessel
#

whouldnt i get an error ?

wary mountain
remote swallow
#

why?

bold vessel
dry yacht
vagrant stratus
#

also triple checked @dry yacht and yea, the most recent video shows what should actually be done.
I'll keep the entity one and re-work it into the general API once I get the plugin working lol

#

Probably Something#hoverEntity or however I handle hovering in the library lmao

dry yacht
vagrant stratus
#

I believe all that needs changed is the scheduler, which you can make sure is done properly tomorrow.
I need to work on something else for now lmao

signal kettle
#

hello, how I could check if player have item in eq and if not then make certain things?

#

I tried

if (!player.getInventory().contains(backpack)) {

but then on each action plugin make that ;/

humble tulip
#

Anyone knows a good java 8+ http client and websocket library?

dry yacht
#

Not sure what you mean. What's an eq? When do you want to perform something? On state change?

vagrant stratus
#

I can't wait to make this into a proper non-shit library and never have to worry about the main code again lmao

signal kettle
sullen badge
#

Hi, I'm trying to detect when a block is broken indirectly (e.g. a torch is broken because the block its on breaks), can't figure out how to do it. I can detect WHEN it happens by using a BlockDropItemEvent listener, but I cant get the actual torch block/block state. Is there anyway to do this?

signal kettle
#
        else if (!player.getInventory().contains(backpack)) {
            Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic unapply BACKPACK " + player.getName());
dry yacht
signal kettle
humble tulip
#

Hm

#

You mean parse right?

hazy parrot
#

you would do basically

String[] strings = s.split(",").stream().map(s -> s.replaceAll("\\s+", "")).toArray(String[]::new);
dry yacht
humble tulip
#

wew ok

#

thx

dry yacht
dry yacht
dry yacht
# signal kettle so any resolve here?

Well, I'm not sure if it's actually that easy. There are many cases in which a player's inventory contents might change, like pickup, drop, click, death, programmatically, etc...

An observer for the inventory contents would be cool, but I don't think the API provides such a feature.

Without advising any hacky solutions, you probably just need to listen to a bunch of events and check if the item causing it is your backpack.

humble tulip
#

not quite what im looking for

#

i just want something similar to what java 11 has but in java 8

signal kettle
#

ohhh okay so that's what I think of at first that it will not be that easy but surly first tried with everything that came to my mind and second is ask but okay thank you

dry yacht
dry yacht
humble tulip
hazy parrot
haughty granite
#

I'm trying out what you sent me earlier

#

but I can't use it correctly : I put it in a utils file to use it everywhere, I'm a bit lost

remote swallow
#

anyone know of a config updater library? one thatjust needs a plugin instance of whatever else that doesnt require files to be changed? like i can add stuff to the config.yml in resources and those get added to any already generated config?

#

if not what would be a good way to approach making one

hazy parrot
#

i would just get both configs from resources and from file, then iterate trought resources config sections and if fileconfig#hasSection(ResourceSection.key) (or whatever) continue, if no, just set with value from resources

#

migh not be best solution, but can't really think of other

remote swallow
#

i was thinking like get the config from JavaPlugin, get the InputStream with getResource() and just convert that to YamlConfiguration/FileConfiguration somehow, then do the loop stuff

hazy parrot
#

yeah, that is basically what i said

remote swallow
#

ah lol

hazy parrot
#

iirc you can use inputstream into YamlConfiguration#load or whatever its called

remote swallow
#

looks like its got a reader method so i just need to convert

#

manage to say the same thing at the same time lmao

hazy parrot
remote swallow
#

just googled that lol

bold vessel
#

Hello, when i right click with this shield

private HashMap<UUID, Long> cooldown = new HashMap<>();
   private ItemStack createLegendaryShield() {
       ItemStack shield = new ItemStack(Material.SHIELD);
       ItemMeta meta = shield.getItemMeta();
       meta.setLore(Arrays.asList(ChatColor.YELLOW + "Item Légendaire"));
       meta.setDisplayName(ChatColor.GOLD + "Bouclier légendaire");
       shield.setItemMeta(meta);

       return shield;
   }

   @EventHandler
       public void onPlayerInteract(PlayerInteractEvent event) {
       Player player = event.getPlayer();
       ItemStack item = player.getInventory().getItemInHand();
       if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
               && item.getItemMeta().getDisplayName().equals(ChatColor.GOLD + "Bouclier légendaire")) {
           if (!cooldown.containsKey(player.getUniqueId()) || cooldown.get(player.getUniqueId()) < System.currentTimeMillis()) {
               player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 2));
               player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 15 * 20, 0));
               player.sendMessage(ChatColor.GOLD + "Vous avez utilisé le bouclier légendaire.");
               cooldown.put(player.getUniqueId(), System.currentTimeMillis() + 30 * 1000);
           } else {
               player.sendMessage(ChatColor.RED + "Le bouclier légendaire est en cooldown.");
           }
       }
   }
}```

I get the effect but when its in the second hand its not working how can i made it working in the second hand
rotund ravine
#

getItemInOffHand

bold vessel
rotund ravine
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
bold vessel
#

thx

rotund ravine
sterile token
# bold vessel thx

Something extra, take in care that OFF_HAND is know as the hand for placing blocks and also as the hand for putting the shield

sullen badge
#

What determines whether a class for a block in CraftBukkit inherits from CraftBlockData or CraftBlockState?

rotund ravine
#

?jd-s

undone axleBOT
rotund ravine
#

If it’s a BlockState or BlockData

#

Look at the javadoc

bold vessel
#

?paste

undone axleBOT
sullen badge
#

Yeah, I understand that, but not very helpful. I'm looking to contribute to Spigot, so I'm trying to learn more about how it is structured

bold vessel
bold vessel
#

?paste

undone axleBOT
bold vessel
regal geyser
#

hey, custommodeldata is not working in my server, the server is running Paper version git-Paper-307 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 476ef25)
when i do something like "/give @s minecraft:apple{CustomModelData:1} 1" it says " Unknown item name: minecraft:apple{custommodeldata:1}."

tender shard
#

add a space between the material name and the NBT data

regal geyser
#

ok

regal geyser
torn shuttle
#

man this atlas system is a pain in the ass

tender shard
vast raven
#

Wich is the cover angle of a shield? 180°?

cunning lotus
#

is there something other than model engine for custom models for mobs?

hazy parrot
torn shuttle
#

does anyone have a clue as to how you're supposed to make custom inventory skins for mc 1.19.3?

#

I just can't get it to even try to load

rough drift
#

a bit less iirc

#

like 110-150

#

I forgor

tender shard
torn shuttle
#

I had it working

#

then 1.19.3 broke it

tender shard
#

how

#

like, what broke

torn shuttle
#

I guess I have no clue, seems like it is no longer working for previous versions so I probably messed something up

vast raven
#

Actually I need to check if a damage was behind, when the player is shieldied

#

What about damager.getLocation().getDirection().angle(victim.getEyeLocation().getDirection()) ?

rough drift
#

in that case 180 is fine

vast raven
#

the avarege values goes from 0 to 2.5 max.

rough drift
#

hm

#

just check which values are behind lol

vast raven
#

and the problem are that these values increases only from the laterals

rough drift
#

try damager.getLocation().angle(victim.getLocation())

vast raven
#

it starts increasing only when you are next to the player, so idk

rough drift
#

I kind of forgot how to do it lmao

vast raven
#

the location object hasn't an angle() method 😦

wet breach
vast raven
wet breach
#

You need 3 vectors

vast raven
#

damager.getLocation().getDirection().angle(victim.getEyeLocation().getDirection())

#

But has some problems tho

vast raven
wet breach
#

Doing it wrong give me like 30 minutes to show you

#

At work currently and about to clock off

#

But i will show you the math formula for using 3 vectors for this

vast raven
#

ok..

wet breach
#

Actually, someone cleaned up what i was going to do. So yay free time

#
If((AxB * AxC >= 0) && (CxB * CxA >= 0 )) {
//If check passes B is between A and C
}```
#

Why is this important? Well you can get the location of victim. Then get a point behind victim. Then you have the damagers point. Compare damagers point to the other two. And you can tell if they are behind

#

Api has a util method to turn locations into vectors

#

This should hopefully resolve your issue without trying to compare angles and directions lol

vast raven
#

oh jesus

#

What does A,B,C stands for?

wet breach
#

Lines

#

So in words the equation is as follows

#

If vector AB times vector AC is equal or greater then 0 and vector CB times vector CA is equal or greater then 0 then line B is in between lines A and C

#

And i misspoke earlier. Need 4 locations. The 2 entities and 2 locations to rear sides

#

Which you use 2 locations to form a vector

#

So victim and 1 location to side rear and then opposite side. Then victim and damager. Then you can compare the vectors with above formula

vast raven
#

omg I never thought that could be so difficult

#

thanks for your time

wet breach
#

Its not hard. The two points to rear side you can just subtract from victim and move over a block or two. You just want to ensure those rear points make it so the damager is in between

#

But that is the simplest math using vectors for this without using raytracing or angles lol

#

Dont let this intimidate you. Give it a try, do some researching and learning if need be. And if you still need help come on back and show your progress or what you came up with thus far. This is how you learn

#

And with that. I am now clocking off from work and going to drive home so be back somewhere like an hour

unborn kiln
#

Can I use something like PVector from the processing library to create a vector with xyz axis even if I’m not drawing and am just using it in a plugin?

river oracle
#

Why not use Vector from bukkit

#

That'd be much easier for compatability with other objects

#

Otherwise you'll need to make a method to translate a PVector into a Vector

#

Than use the Vector output of that method

unborn kiln
#

Well I’m coding something with processing and am going to transfer it over to a plugin so I thought it would be easier.

quiet ice
unborn kiln
#

I guess you could just create a new location then store it in a vector, right?

quiet ice
#

Beware of GC

#

Java is good at identifing short-lived objects, but unnecessary allocation still takes it's tall

#

If you can avoid allocating stuff without creating an overhead somewhere else, you might want to use the other approach

unborn kiln
#

The pvector?

#

Or vector?

#

I’ll just use pvector, see how it goes. Then swap to vector for compatibility sake.

quiet ice
#

Well if you go PVector <-> Vector <-> Location you'll have a tremendous issue

#

Bukkit's vector should be used for velocities and directionality where as Bukkit's Location class is meant for storing positions (since it also stored the world)

#

What PVector is used for should be known to you - up to you to decide whether it is to be used over bukkit's classes

echo basalt
#

nah I got stuff to do

#

but basically

#

if you're already using your own data class

#

no point in keeping it as a table

novel vine
#

Anyone know how .schem files hold nbt & the block types?

quiet ice
#

WE might use a different, but similar specification

novel vine
#

thanks

icy beacon
#

how do i alter the position of a player in tablist? i wanna make them last. i tried adding them to a team "zzzzz" for it to be last (alphabetical order) but it didn't help

#

is it possible without packets?

#

related code (no errors, nothing changes at all and the player remains at where they were):

public void makePlayerLastInTab(final String player) {
  if (latestTeam == null) return;
  latestTeam.addEntry(player);
}

// onEnable
final Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
if (scoreboard.getTeam("ZZZZkwfake") != null) {
  latestTeam = scoreboard.getTeam("ZZZZkwfake");
} else scoreboard.registerNewTeam("ZZZZkwfake");

// invoking in onJoin
plugin.makePlayerLastInTab(randomName);
twilit roost
tardy delta
#

what happens

twilit roost
#

Looks like it has to be declared public

twilit roost
tardy delta
#

make it public?

twilit roost
dry yacht
twilit roost
icy beacon
#

oh bruh

#

lmaooo

#

thx i'll test it now

icy beacon
#

alright it still does not work

#

i made sure that the method is getting called and the addEntry is getting called too

#

it still won't do though it seems

eternal oxide
#

addEntry takes a player by name or an Entity by stringed UUID

torn shuttle
#

@echo basalt say hello to my favorite method in the entire plugin

#

that's my manager which keeps neutral mobs angry

chrome beacon
torn shuttle
chrome beacon
#

Villager

torn shuttle
#

you can tell this is old code

eternal night
#

gotta decrease reputation somehow

torn shuttle
#

if it was written in 2022 it would be tellWitnessesThePlayerIsSus

icy beacon
eternal oxide
#

be sure it is their actual name and not a UUID if a Player

#

unmodified name. so raw name from getName() of Player

icy beacon
#

it is indeed their raw name

#

maybe i should've clarified that i'm talking about a fake player created with packets

eternal oxide
#

then so long as all players involved are using the same scoreboard it should work

eternal oxide
#

um a packet only Player will not be able to be added to a Scoreboard

#

not unless you create it server side

#

have to add to world

icy beacon
#

goddammit

#

well what if instead of putting the fake player to the bottom i'll put the real ones to the top hm

eternal oxide
#

or manually send teh scoreboard packets

icy beacon
#

i'll try that

icy beacon
bold vessel
#

?paste

undone axleBOT
tardy delta
#

is that class included in essentials? i assume so

bold vessel
#

Which class ?

tardy delta
#

user ex thing

bold vessel
#

yes it is

onyx fjord
#

whats the keybind by default to optimize imports in ij

icy beacon
bold vessel
#

Ctrl alt l ?

icy beacon
#

nvm

bold vessel
#

idk mine is this

onyx fjord
icy beacon
#

yeah

onyx fjord
icy beacon
#

yeah i said nvm

bold vessel
#

for me its optimize

icy beacon
#

i have key promoter x so it should say the keybind let me try

#

it did not

#

is there even one?

tardy delta
icy beacon
onyx fjord
#

i dont want it to be automatic to prevent messing when working on fork

icy beacon
#

just tested

onyx fjord
#

yoo

#

W

icy beacon
#

Settings -> Keymap btw

#

there's a search bar

bold vessel
icy beacon
#

try to Class.forName the classes that are missing

tardy delta
#

mismatched essentials version/ essentials dependency version?

bold vessel
icy beacon
#

/ver Essentials

#

then compare to what you have in your dependency

tardy delta
#

oh thats a thing too

icy beacon
#

or EssentialsX

bold vessel
#

okk

icy beacon
#

2.19.7 cool

#

now check your dependency

bold vessel
#

okk its that

icy beacon
#

yeah 😄

bold vessel
#

Som1 know why the vault is in orange ?

tardy delta
#

ignore it

icy beacon
#

1.7.1 is latest though afaik

#

nvm

tardy delta
#

oh map::merge is a thing

bold vessel
remote swallow
#

reload maven

bold vessel
#

already do

#

oh

#

its wasnt finish

#

its good

tardy delta
#

playerBalances.merge(uuid, amountPerMinute, Integer::sum) or smth

bold vessel
#

merge give the money ?

tardy delta
#

its a combination of put and get, should check javadocs

bold vessel
#

okk i check this

tardy delta
icy beacon
#

what's a good way to check if the player is falling (aka in the air & is not flying)? is checking y velocity > 0 enough?

glossy venture
#

it should be yVelocity < 0, negative is down and i would check if the player is flying or has fly enabled as well

#

otherwise going down in creative or something might be counted as falling

icy beacon
#

thanks 🙂

#

oh and i'm trying to think of a way to get the closest non-air block below the player and i have literally no idea how to do it

#

the idea of just subtracting Y one by one and checking if it's air sounds too goofy

untold patio
#

Hello, guys can anyone please give me an idea about how to make a plug-in that allows me to add and edit an arraylist into a yml

remote swallow
#

whats the difference between File.seperator and File.pathSeperator

untold patio
#

I made one but for some reason when I reload the server, the yml file with the arraylist gets erased. I mean; before reload (class: name: x) after reload (class: name: ‘’ )

icy beacon
#

    File.pathSeparator is used to separate individual file paths in a list of file paths. Consider on windows, the PATH environment variable. You use a ; to separate the file paths so on Windows File.pathSeparator would be ;.

    File.separator is either / or \ that is used to split up the path to a specific file. For example on Windows it is \ or C:\Documents\Test
bold vessel
bold vessel
#

but i dont understand why

icy beacon
bold vessel
#

how i use this ?

icy beacon
#

Class.forName("com.earth2me.essentials.api.UserDoesNotExistException") I think, off the top of my head. btw make sure that your plugin gets loaded after essentials (you gotta depend on it in plugin.yml)

bold vessel
#

okk

hazy parrot
#

isnt it depends ?

icy beacon
#

looks good to me

icy beacon
hazy parrot
#

yeah its not

icy beacon
#

i'm trying to think of a way to get the closest non-air block below the player and i have literally no idea how to do it. the idea of just subtracting Y one by one and checking if it's air sounds too goofy, do you have any ideas?

bold vessel
remote swallow
#

the way you have is fine

icy beacon
#

hey epic

icy beacon
#

i'm contemplating creating a method and actually subtracting one-by-one

remote swallow
#

might be able to ray trace and check for air but other than that no idea

icy beacon
#

sounds way too complicated for such a small task

#

ah man

#

i mean ray tracing is not a lot of code thankfully

#

but still

dry yacht
remote swallow
#

heh?

#

how does that work

icy beacon
#

man made obs screen in minecraft 💀

dry yacht
dry yacht
remote swallow
#

you code for minecraft? i code in minecraft

tardy delta
#

imagine your internet dying then

dry yacht
bold vessel
#

so cool

onyx fjord
#

how do i setup IJ to auto restart the server when i build my plugin (gradle)?

#

rn i have an action that launches the server

#

and build action that builds directly on server

tardy flame
# onyx fjord and build action that builds directly on server
austere cove
#

are varshorts even used in the protocol?

#

bungee's defined packet has read/write methods for them

worldly ingot
#

varshort? I don't believe so. Shorts are

#

That being said, the protocol supports it. It's just data. So if developers want to make use of varshorts for some reason I don't see why not

quaint mantle
#

so im using github packages and im having this issue of not shading other libraries, though it does at package phase, it just does not at deploy phase

austere cove
#
public static int readVarShort(ByteBuf buf) {
    int low = buf.readUnsignedShort();
    int high = 0;
    if ((low & 0x8000) != 0) {
        low = low & 0x7FFF;
        high = buf.readUnsignedByte();
    }
    return ( ( high & 0xFF ) << 15 ) | low;
}

Well it exists in Bungee

#

also don't understand what's happening with the #readUnsignedShort() call

#

shouldn't it be #readUnsignedByte() like with varints/varlongs

#

this looks like a 3 byte number

quaint mantle
#

i need to shade in both deploy and package phase 🤨

dry yacht
# quaint mantle how can i shade in deploy phase?

Phases always also call their predecessors, so deploy already called package, you already shaded. Might be that you're deploying the wrong artifact. You probably need to add a classifier when shading which you can then explicitly deploy.

dry yacht
haughty granite
#

to use the API of a plugin from its jar file, I import it from Project Structure > Modules > Add JARs

#

I have to do something else to use it afterwards?

hazy parrot
#

or gradle

haughty granite
hazy parrot
#

they have api, but didnt provide way to use it 🤔

haughty granite
#

and on the discord it says that "You need to import the old fashioned jar"

hazy parrot
hasty prawn
#

@tender shard ^

tardy delta
#

i believe alex is dead

quiet ice
#

alternatively use file:// repos

#

e. g.

    <repositories>
        <repository>
            <url>${project.basedir}/deps</url>
            <id>local-potemkin-repository</id>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>empty</groupId>
            <artifactId>modlauncher</artifactId>
            <version>999.0.0</version>
        </dependency>
    </dependencies>
#

Might also be <url>file://${project.basedir}/deps</url> if you want to be safe

haughty granite
remote swallow
#

hes swapping his vm stuff to another datacenter

#

one sec ill find the stuff

#

mvn install:install-file -Dfile=JARNAME.jar -DgroupId=groupid -DartifactId=artifact -Dversion=ver-Dpackaging=jar

quiet ice
#

The layout within your deps folder would then looks somewhat like that:

.
└── empty  // {group}
    ├── log4j // {artifact}
    │   └── 999.0.0 // {version}
    │       ├── log4j-999.0.0.jar  // {artifact}-{version}.{type}
    │       └── log4j-999.0.0.pom
    └── modlauncher
        └── 999.0.0
            ├── modlauncher-999.0.0.jar
            └── modlauncher-999.0.0.pom

the .pom files are not required per-se but can be useful from time to time

#

I'm working too much with maven resolvers...

vale ember
#

is it possible for the plugin to delete the jar containing itself?

remote swallow
#

heh?

vale ember
#

the plugin deleting itself from plugins directory

remote swallow
#

it can if you make it do that

vale ember
#

ok thanks

#

i was just worried it might cause crash or something

quiet ice
#

might not work on windows computers

vale ember
#

what i wanna do is make an auto updater for my plugin, and after downloading the new version i wanna delete the current, how can i do it so that it works on all machines?

tardy delta
#

put the new version in /plugins/update

#

the server will remove the old and move the new

#

should reload tho

vale ember
#

oh didn't know about that

#

thanks!

tall holly
#

i have error:

#

getDatabase() in nick.nick.nick cannot implement getDatabase() in org.bukkit.plugin.Plugin

#

how to fix it

remote swallow
#

in console or intellij

tall holly
#

intellij

remote swallow
#

?paste the class

undone axleBOT
tall holly
remote swallow
#

you have a method in a method

river oracle
tall holly
#

i don't understand

#

sorry

river oracle
#

?learnjava

undone axleBOT
tall holly
# river oracle ?learnjava

i only need to fix this error ( getDatabase() in nick.nick.nick cannot implement getDatabase() in org.bukkit.plugin.Plugin )

river oracle
#

Learn Java it'll fix your issue

#

Your issue is inherently syntactical. Which learning Java will help you with

austere cove
river oracle
tardy flame
#

What's this path bruh

sterile token
#

I would straight forward suggest learning Java before coding a plugin

tardy flame
#

^

sterile token
#

Because happen the same when cooking, You cannot make a cake without experience and also reading the recipy before

#

So please before coding something in any lang, you first must learn the lang where You are coding

.

#

With that being said, i need suggestions for creating a queue for redis. So when a payload is received it queue it and once u call the get for the payload Will renove it from the queue

orchid gazelle
#

hello. How do I "rotate" a BlockData based on a BlockFace?

orchid gazelle
#

this is a Rotatable, not a BlockData

warm mica
#

Cast the BlockData

orchid gazelle
#

and before that check if the block is rotatable?

warm mica
#

Likely yes

orchid gazelle
#

is there an API method to check if it is rotatable?

pseudo hazel
#

you dont need one

orchid gazelle
#

why not

pseudo hazel
#

if (data instanceof rotatable rotatbleBlock)

#

then it will be rotatable

warm mica
orchid gazelle
#

sooo im good with this?:

          BlockData blockdata = block.getBlockdata().clone();
          if(blockdata instanceof Rotatable) ((Rotatable)blockdata).setRotation(direction);
vivid skiff
#

How can i use the meta.spigot().setPages(BaseComponent) in NMS?

pseudo hazel
#

yeah but you dont have to cast like that

#

you can do it like I did and then rotatableBlock will already be the casted variable

#

oh is that literally a j17 thing?

#

sad

orchid gazelle
#

I am on J17

pseudo hazel
#

oh well there you go

orchid gazelle
#

but I directly set the data, not save a boolean

#

rotatedBlocks.add(new SchematicBlock(center.getBlockX() + x, center.getBlockY() + y, center.getBlockZ() + z, blockdata));

#

I am doing that here

#

thats my own API

#

lol

pseudo hazel
#

but like doesnt it also clone it when casting it normally?

orchid gazelle
#

but sadly this seems to not work

pseudo hazel
#

yes because if the cast makes a clone then it doesnt apply the rotation on the original blockdata

#

thats why I said i wasnt sure

#

no I was just referring to how java works presumably

orchid gazelle
#

BlockData is blockdata, thats not on me. Im just saving a BlockData in my class :D

#

uhm what

#

so the cast clones the blockdata, so that setRotation will affect the clone and not the origin blockdata. Thats what u mean?

#

ahhh ok

pseudo hazel
#

yes thats what I was referring to

orchid gazelle
#

well but then how do I reapply it to blockdata instead of Rotatable?

pseudo hazel
#

so using the casted variable in the if is the same idea

#

data = rotatedBlockData

cursive lance
#

Can anyone tell me how to add condition on full Armor set required in executable plugin (custom Armor)

#

Yes

vale ember
cursive lance
#

Oh Thanks ♥️

orchid gazelle
#

cannot find setBlockData

#

BlockState != BlockData

#

thats Block

#

not BlockData

#

I do not have a Block anywhere there lol

#

blockdata = rotated;

#

what about that? XD

#

uhm

echo granite
#

How can I customize(colors, and re-design in general) the default help page in the ACF library?

orchid gazelle
#

for (SchematicBlock block : this.getBlocks()) {

#

it can't

#

its literally relative and non-existant in the world

#

later

#

player.sendBlockChange(new Location(center.getWorld(), block.getX(), block.getY(), block.getZ()), block.getBlockdata());

remote swallow
#

that isnt persistent

orchid gazelle
#

I know but it needs to work with that too

#

Placing is:

#
center.getWorld().setBlockData(new Location(center.getWorld(), block.getX(), block.getY(), block.getZ()), block.getBlockdata());
#

wdym?

#

sendBlockChange has BlockData

#

and as you can see, it shows it on the Client

remote swallow
#

if you reload or restart that block will disappear

orchid gazelle
#

yes and? This is a temp-menu

remote swallow
#

if you click that block it will disappear

orchid gazelle
#

it is an editor menu and will place the Block when the player confirms it

#

the server does not need to do anything

#

it just needs to rotate the block DATA

#

not the Block itself

#

explain

#

not possible

#

needs to be accessed without being visible

#

and I know that sending BlockData-Rotations does work

vale ember
#

should i use bukkits async task or completablefuture for downloading files?

orchid gazelle
#

Do I really have to take a random block in the world and use it as a temp-block to transform a Rotatable to blockdata?

opal juniper
vale ember
#

also can i use plugin's logger in CFs?

untold patio
#

Guys how can I create a plug-in that stores an arraylist of a class in a yml file and allows me to add an object of that class from the yml or from in-game command

lavish wing
#

Hey guys help me pls
Why i ve got this error?

21:10:52 [SEVERE] Could not pass event WORLD_INIT to ArmlixSkyGeneration
java.lang.ClassCastException: org.bukkit.craftbukkit.CraftWorld cannot be cast to net.minecraft.server.World
        at net.doh1221.Listener.onWorldInit(Listener.java:12)
        at org.bukkit.plugin.java.JavaPluginLoader$48.execute(JavaPluginLoader.java:777)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:354)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:217)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:151)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:344)
        at net.minecraft.server.ThreadServerApplication.run(ThreadServerApplication.java:13)
#

I just want to cast CraftWorld to World from nms

#
  @EventHandler
    public void onWorldInit(WorldInitEvent e) {
        this.world = (World) e.getWorld();
        SkyGrid.chunkGenerator = new ChunkGenerator(world, 1);
    }```
eternal oxide
#

getHandle

lavish wing
vale ember
#

how can i disable a plugin after a specific CompletableFuture is done without blocking the main thread?

sterile token
vale ember
lavish wing
#

but where i should use it?

sterile token
#

Yes its called getHandle() the method

eternal oxide
#

cast World to CraftWorld and .getHandle()

lavish wing
lavish wing
eternal oxide
#

you need CraftWorld to have access to getHandle

lavish wing
sterile token
eternal oxide
#

you need the CraftWorld so cast it

lavish wing
eternal oxide
#

fix your ( )

lavish wing
#

?

eternal oxide
#

( (CraftWorld) e.getWorld() ).getH...

lavish wing
#

Oh

sterile token
# lavish wing ?

Have you learnt how to code Java before? Im not wondering to be rude. Because from personal experiences i wouldnt code without learning Java

untold patio
#

Thank you, imma try it this way because right now I tried coding it but when it saves the rule in the yml I can’t edit it from in game because it just erases the arrributes

untold patio
#

Even when I reload it it just erases the attributes values

sterile token
untold patio
#

Yes sure, but can’t share it right now because I’m not home :c but I can at night

#

Would you mind if I sent you a friend request?

#

Imma try it anyways!

orchid gazelle
#

mmm still no way to rotate the blockdata

#

might have to overwrite the String-Data manually

onyx fjord
#

hey uh i have problems comparing uuids

so i have uuid a which is equal to 8667ba71-b85a-4004-af54-457a9734eed7 when printed
and another uuid which is also equal to 8667ba71-b85a-4004-af54-457a9734eed7

So comparing those returns true, however i have an if check if (a != b) Do something
and something happens (it shouldnt)

#

am i doing something wrong?

#

i compare UUID objects btw

eternal night
#

no no I read that I am just confused if kacper really meant that

#

I always thought they had a bit of java knowledge 😅

grizzled oasis
#

Hi, I wanted to ask a general java question, I'm using java 11 with threads on a cpu with 64 cores and 128 threads to run the best with threads on my app how many threads i should use?

(i tried 128 th and works very well but I wanted to ask for be sure and have some more knowledge about that)

eternal night
#

I mean, only really makes sense if your app actually scales to that level in terms of parallel execution

#

usually throwing more threads at the problem does not solve everything

#

unless your code base is specifically designed to work that way

grizzled oasis
#

seems with 64 to work even more faster (3 minutes and scanned half of it)

onyx fjord
tardy delta
#

i just saw the discord integration thing is made in kotlin 💀

sterile token
tardy delta
#

not jda

sterile token
#

ohh Ij integration

#

No maybe you ar eusing another plugin

#

I have decompiled the one im using and its fully written in Java

desert tinsel
#

How to compile a plugin to make it to have less size?

#

I tried packaging it, but not all the repository was used

tardy flame
#

It ruins your brain

sterile token
desert tinsel
#

how

sterile token
#

But most of the time your plugin must depend on all the dependencies

desert tinsel
#

my plugin has 14mb

sterile token
#

LOl

hazy parrot
sterile token
#

Its really huge plugin

desert tinsel
#

it s not

hazy parrot
#

You are probably also using one by alpaca

desert tinsel
#

but I compiled it with

tardy delta
#

are there dependencies that youre not actively using in your code but that needs to be provided, otherwise you can use the libraries section in your plugin.yml

#

use maven to compile

#

dunno if thats maven

sterile token
desert tinsel
#

maven

onyx fjord
bold vessel
#

som1 know how i can make gold armor to have more durability ?

tardy delta
#

where are those problems

tardy flame
sterile token
tardy flame
#

I don't understand

bold vessel
desert tinsel
sterile token
desert tinsel
#

?paste

undone axleBOT
desert tinsel
tardy delta
onyx fjord
desert tinsel
tardy delta
#

how do you haev 14mb with only those

desert tinsel
#

idk, I m just using the default maven build configuration

tardy flame
#

😘

hazy parrot
tardy delta
#

sqlite is included by spigot

#

so dunno why you would shade it

hazy parrot
#

Well he doesn't have provided scope

tardy delta
#

thats probably the cause of the big size then

desert tinsel
#

how can I use sqlite included in spigot?

hazy parrot
#

Just add <scope>provided</scope>

desert tinsel
#

thx you

subtle folio
#

is there any real way to store list of items in a relational database, or is it just a no go?

sterile token
subtle folio
sterile token
#

So well, you will have to make your own serizator/deserializator

#

Because i dont think there is another way

subtle folio
#

bummer

#

nosql may be interesting to me

sterile token
#

Its more or less the same

subtle folio
#

not really..

sterile token
#

Because for serialization/deserialization still need to use base64 cuz of how itemstack works

subtle folio
#

im talking about basic strings,

#

if I were to store itemstacks I would probably destructor it more

sterile token
#

oh right

#

Yeah noSQl is really good when you dont want to get headaches with sql

subtle folio
#

but json is ugly

#

i wish there were more database types that were like

#

relational but like

#

not

sterile token
#

Lol

#

Json is amazing

subtle folio
#

ehh

sterile token
#

You because are a sql lover

#

happen the sam e with Eclipse and IJ

remote swallow
#

item stack can be serialized to byte[] and saved as blob in sql iirc

sterile token
#

What bas64 does 🤔

desert tinsel
#

serialize and deserialize an object into a string

quaint mantle
#

as that isn't what base64 does

desert tinsel
#

i described it for the context

eternal night
#

I mean, technically it serialises bytes into text 🤔

quaint mantle
#

It encodes bytes into text

#

so not entirely wrong, no

#

but not quite right either

desert tinsel
#

my wrong then

eternal night
#

the funniest byte-to-text encoding scheme for sure tho

quaint mantle
#

100%

sonic phoenix
#

Hey, I would like to combine spigot and bungee plugins into a single jar. I saw a few posts on the forum, but they didn't metion anything related to maven.

Here is how my current build config looks like: https://pastebin.com/h9S8ih7j

I know I could replace the mainclass for the other one which is net.hardgaming.mc.hardgamingplugin.bungee.plugin.HardGamingBungeePlugin, and that would work just fine... but I really don't want to have two jars, I am lazy. Is there a standard way of doing this?

#

I already have the .yml s in place, so that should be already ok, just wondering how can I make maven work with this

sterile token
#

its too long

#

Maven doesnt care if you are building for spigot/bungee, so i dont really understand your quetion?

remote swallow
#

net.hardgaming.hardgamingplugin.bungee.Class

glad prawn
#

hardgaming.hardgamingplugin

sterile token
#

Too long

#

I would call it like:

<domain>.<plugin name>.[<module name>]

sonic phoenix
sterile token
#

🤔

sonic phoenix
#

How should I specify that to maven

remote swallow
#

you dontneed to

sterile token
#

Maven doesnt care that, its only an enviroment for bulding

sonic phoenix
#

So I don't even need to specify one of them, or do I

remote swallow
#

maven only cares about artifact and group id

sterile token
#

Just nee din plugin.yml

remote swallow
#

plugin.yml tells the spigot/bukkit main class, bungee.yml tells the bungee main class

vast raven
#

How basically relocation works?

remote swallow
#

relocates org.example.example to specified.pack.age

#

moves it to say

vast raven
#

I mean, not on theory, but technically how I have to write the relocation

remote swallow
#

maven or gradle

vast raven
#

Maven

vast raven
#

For example, what do I have to do with the exclude fields?

sonic phoenix
sterile token
sonic phoenix
#

the mainclass

sterile token
#

its simple maven just need a gorup id and artifact, then nothing else

remote swallow
#

maven doesnt care about that though

remote swallow
sterile token
#

What you should do is then create the plugin.yml and bungee.yml in your case

#

<package>
-> bungee

  • TestBungee
  • TestSpigot

So then spigot main class: <package>.TestSpigot and bungee <package>.bungee.TestBungee

sonic phoenix
#

Yeah, I know about that and already have it in place, I was thinking that I may need to edit the build for my plugin pom 🤔 . I am packaging many libs of mine into it

sterile token
#

🤔

#

I dont understand your point

remote swallow
sonic phoenix
# sterile token I dont understand your point

just was confusing to have a mainclass declared in the pom that could not be the same as the one from the ymls, but I guess from what you are saying that I can just leave it as is since it is only used for building but does not really affect the package

remote swallow
#

where are you declaring mainclass? that isnt needed

#

the only place that needs it is plugin.yml or bungee.yml

sonic phoenix
#

in the pom.xml

#

here is my project structure

#

I am using maven assembly to merge all those into a single jar

#

and that I think asks for mainclass

vast raven
remote swallow
#

the shade plugin

vast raven
remote swallow
#

?paste your pom

undone axleBOT
remote swallow
#

those things shouldnt be in plugin

#

you need the maven shade plguin

#

the entire section is on the link i sent

vast raven
#

as so?

remote swallow
#

still no

#

the group id and artifact should be for maven shade

vast raven
#

wdym

remote swallow
#

its all on the link i sent you

vast raven
onyx fjord
#

can i cancel blockbreakevent without client seeing air for a moment?

remote swallow
vast raven
sonic phoenix
#

never mind, got it working removing the mainclass 😛

#

I will paste the pom anyways

#

previously I had the archive -> manifest -> mainclass inside the maven assembly plugin config, but that is not needed

#

anyways, probably bungee / spigot do some reflection magic

sterile token
#

Bungee and Spigot uuid, do they change? Or the uuid asigned by bungee is the same as the uuid from spigot?

#

right thanks

sterile token
sullen wharf
#

Any specific reason for ItemStack not having NBTData (Altought it should have) when retrieving it with PlayerDropItemEvent#getItemDrop().getItemStack(), any other related events like PlayerInteractEvent return the ItemStack with NBTData which is very weird 🤔

icy monolith
#

Hey, whats the difference between paper plugin and spigot plugin? Which one should i use and why?

onyx fjord
#

same thing basically

rotund ravine
#

Not much, a paper plugin using their methods won't run on a spigot server.

#

A spigot plugin will run on a paper server.

onyx fjord
#

spigot compatible with paper

#

paper incompatible with spigot

#

but if you make a plugin use spigot api

sterile token
#

yeah and here ofc you wont get paper suppport, because this is mostly spigot comm

desert tinsel
#

how can I edit the name above the player head?

#

setCustomName and setCustomNameVisible dont work

sterile token
#

What do you mean by not work?

#

Because its a ueseless statement

desert tinsel
#

it doesnt display the new name

sterile token
#

ok

ruby sky
#

i cant import mythiclib and mmocore api need help

chrome beacon
#

What have you tried?

ruby sky
#

except Compiling MythicLib part that i dont understand

icy monolith
#

How do i get on right click of a specific item event?

rotund ravine
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
rotund ravine
#

check the getAction of that event.

onyx fjord
#

whats the event for block being destroyed?

#

BlockDamageEvent right

rotund ravine
#

By what

#

a player

#

a entity

#

a bed+

desert tinsel
#

why I cant find the CraftPlayer of PlayerProfile classes in spigotApi?

rotund ravine
onyx fjord
rotund ravine
onyx fjord
#

nah not the break

#

the progress of breaking

rotund ravine
#

There is none, maybe PlayerInteractEvent, but not much else.

onyx fjord
#

basically i want block progress to be reset to 0 all the time

#

(something like bedrock)

rotund ravine
#

PlayerInteractEvent then

onyx fjord
#

and what do i do with it to change progress?

#

just cancel?

rotund ravine
#

yes

tawdry echo
#

Some event catch when player use elytra?

onyx fjord
#

i can still break it

#
    @EventHandler
    public void onBlockInteract(PlayerInteractEvent event) {
        if (event.getAction() != Action.LEFT_CLICK_BLOCK) return;
        event.setCancelled(true);
    }
tawdry echo
#

BlockBreak?

onyx fjord
#

same effect when cancelling that one

rotund ravine
#

What are you breaking it with?

onyx fjord
#

hand

#

grass block

rotund ravine
#

Then the interact event should work fine.

#

You can always send a blockchange to the block if it’s some graphicsl glitch ur thinking about

orchid gazelle
#

Hello, its me again, lmao. I wanted to ask how to make my calculations Async(Using BukkitRunnables). I need to use some arguments and also, the method has to return an ArrayList<>

rotund ravine
#

Yeah nah.

#

That’s not how concurrency works.

onyx fjord
#

cancelling BlockDamageEvent doesnt actually stop the animation tho

#

i want either to cancel the animation or make breaking the block never stop for the player

rotund ravine
#

Try just sending a blockchange or update the physics on the block.

#

when canceling the event.

upbeat hornet
rotund ravine
#

?tryitandsee

upbeat hornet
#

😦

#

?idontwannawastemytimepls

rotund ravine
#

Then use somethign else

dry yacht
upbeat hornet
#

fine ill try it

rotund ravine
dry yacht
onyx fjord
#

Or even smarter tbh

#

I can give slow digging to player

#

Thanks for the help

dry yacht
onyx fjord
#

Block doesn't matter in my case

#

Because the logic is location specific

#

Shit I need to find the person who was able to achieve this

halcyon mica
#

Question, how come commands that I attempt to register dynamically are simply not registered despite the code being called?

#
    public static boolean register(SimpleCommand cmd) {
        if(isRegistered(cmd.getName()))
            return false;
        if(cmd.register(NMSUtils.getCommandMap())) {
            REGISTRY.add(cmd);
            NMSUtils.syncCommands();
            return true;
        }
        return false;
    }```
hazy parrot
#

what is REGISTRY

#

and also NMSUtils.syncCommands();

halcyon mica
#

The nms utils are this btw: ```java
public static CommandMap getCommandMap() {
return ((CraftServer)Bukkit.getServer()).getCommandMap();
}

public static void syncCommands() {
    ((CraftServer)Bukkit.getServer()).syncCommands();
}```
#

Registry is simple a map of names and the command instance

hazy parrot
#

and what is SimpleCommand#register

halcyon mica
#

The function you're looking at above

#

Simpelcommand inherits Command

#

And as such calls the register function present there

hazy parrot
#

no reason for that function to be static then, anyway when do you actually add command to CommandMap ?

hazy parrot
hazy parrot
onyx fjord
#

Progress doesn't reset after the tick

devout shell
#

Hey, i just started programming but already fighting myself threw erros, can someone help me? I have the complete code from the spigot starting to code website

public class CommandKit implements CommandExecutor {
    @Override
    public boolean onCommand(Commandsender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {
            Player player = (Player) sender;
            // Here we need to give items to our player

            // Create a new ItemStack (type: diamond)
            ItemStack diamond = new ItemStack(Material.DIAMOND);

            // Create a new ItemStack (type: brick)
            ItemStack bricks = new ItemStack(Material.BRICK, 20);


            // Give the player our items (comma-seperated list of all ItemStack)
            player.getInventory().addItem(bricks, diamond);

        }

        return false;
    }
}

and my erros are:

sterile token
devout shell
#

what do you mean, can you say it in beginner language :D ?

sterile token
#

Oh right

#

So let start fom beginning habe You learnt Java before

devout shell
#

so, the command is registrated already in the onEnable

devout shell
sterile token
#

But wait wait, i'm clnfused