#help-development

1 messages · Page 546 of 1

worldly ingot
#

Pretty much anything. The player hasn't fully joined the world yet so any world state-related methods aren't possible

#

Teleportations, client-bound packets, scoreboards, etc.

#

For the most part, yeah

robust pebble
#

do potion effects effect spectator

kind hatch
#

Yes, but most of them are useless if they are in spectator mode.

#

Nightvision is the most prominent example

worldly ingot
#

Right. Things like night vision will work though

robust pebble
#

like blindness

#

NICE

kind hatch
#

Give them darkness. 😛

worldly ingot
#

Blindness on crack

#

Last

#

Shouldn't be used to modify the state of the event

summer scroll
#

So I have a /sell command and ShopGUI+ has a /sell command too, how can I disable or override the ShopGUI+ /sell command?

worldly ingot
#

Ideally you don't expose that ResultSet at all. You return some data object that contains the result of that query

#

That's especially required because when you close your connection (like all good boys and girls should, RIGHT!?), all statements and result sets close with it

kind hatch
summer scroll
#

Alright, I'll try that, thank you.

undone axleBOT
kind hatch
#

Also wanted to point out that you need an open connection in order to read the ResultSet. I learned that during my database setups. But like Choco said, you'd ideally want to return an object that copies the data from the ResultSet.

#

Not with that code it won't. Try-with-resources closes all object connections once it completes. So you'd lose access to that specific ResultSet's data.

thick gust
kind hatch
#

Ehh, maybe. Your code confuses me a little.

Since ResultSets need a connection in order to be read, that means that you lose a connection from your total pool. So if you ever reach a point where multiple people are using those connections, you'll lock up. That's why Choco and I recommend that you just take whatever data you need from the ResultSet and return that instead of the ResultSet itself.

#

That way the ResultSet auto closes from your try-with-resources, returning a connection to the pool.

#

If you're getting valid ResultSets out of it then sure, but I still advaise against doing it that way.

#

Then what does your #invoke interface method do with it?

undone axleBOT
kind hatch
#

Also, something that's bothering me is the return statement in the try block. I'm pretty sure the resources get closed first before the return statement gets executed, which will mean that the ResultSet that is passed through might be null.

#

Ohh, I see how you are doing it now. The generics are what were throwing me off. They confuse me. :3

#

It's why I hardly use them. lol

#

What in the fuck? I need to brush up on them again. I didn't even know Z and H were types.

worldly ingot
#

They don't actually even have to be single letters either

#

Right because standards, but they definitely don't have to be

kind hatch
#

Wait what? I thought they were tied to specific things. Or is that just how it's taught?

worldly ingot
#

Nah, can be whatever you want

#
public class Foo<MINECRAFT> {

    private final MINECRAFT something;

    public Foo(MINECRAFT something) { this.something = something; }

}

Foo<String> foo = new Foo<>("Hello world!");```
#

Probably fine. Though I personally hate having to deal with consumer hell

#

I would at least have your Query method throw an SQLException or something, otherwise you'll have to try/catch every lambda you make

kind hatch
worldly ingot
#

No I get that, but all ResultSet methods throw explicit SQLExceptions so you're going to have to try/catch

#

The lambda body doesn't care about its calling context

kind hatch
#

Right, I'm used to that, but I thought those were more specific?

#

Take a List<String> for instance.

#

It can only ever contain that one specific object type.

worldly ingot
#

I know, this is what I'm saying

database.executeQuery("foo", result -> {
    try {
        result.getString("bar");
    } catch (SQLException e) {
        e.printStackTrace();
    }
});```
If you don't have a try/catch in that body, it will fail to compile because you have an uncaught exception
#

Because Query's #executeQuery() method doesn't explicitly state that it can throw an SQLException

#

(at least not in the paste you sent)

#

Then you're all good

quaint mantle
#

Plugin measaging

lyric vigil
#

how can i make fall damage off for players with a specific luckperms permision?

kind hatch
#

I appreciate this. This was a good watch and helped clarify some things.

lyric vigil
#
    public void onDamageEvent(EntityDamageEvent e) {
        if (e.getCause() == DamageCause.FALL) {
            rabbitEffects(e);
            e.getPlayer();
        }
    }

how would i get the player who fell?
e.getPlayer() doesn't exist

#

"Cannot resolve method 'getPlayer' in 'EntityDamageEvent'"

#
    public void onDamageEvent(EntityDamageEvent e) {
        if (e.getCause() == DamageCause.FALL) {
            if (e.getEntity().hasPermission("venson.rabbitrole")) {
                e.setCancelled(true);
            }
        }
    }

any reason why this wouldn't work even though i have the permision

#

i removed the permision checker and it still isnt working

pseudo hazel
#

did you register it

lyric vigil
#

thats all my code there
so prob not

#

what does it mean to register it

pseudo hazel
#

register the class to receive events

#

and annotate it as @EventHandler

#

the method that is

#

if this was all the code, it wouldnt compile

grizzled oasis
#
public static void Read(Player player, String tts) {
        String[] split = tts.split(" ");

        for(String letters : split) {
            player.playSound(player.getLocation(), letters.toLowerCase(), 1.0f, 1.0f);
        }

    }

A question related how can i make wait inside the "for" so when the tts says a word that word as a space between them

sullen marlin
#

Wait inside a what?

#

You're trying to make quoted arguments?

grizzled oasis
hasty prawn
#

Looks like their trying to just wait after each iteration in the loop so the TTS speech doesn't say every word instantly

sullen marlin
#

You need to make a scheduler and then increment an int counter each time the scheduler runs

#

Then play the array at int counter

grizzled oasis
#

ok thanks

fervent marsh
#

Hey folks, is there any known places to go for commissions for plugins? I have two plugins I'd like to see, one of which is extremely simple (cancels bee water damage event, they drown 24/7), and another horse based one. If you can point me in the right direction let me know!

sullen marlin
#

?services

undone axleBOT
fervent marsh
mortal hare
#

after a day, i've just realised how dumb i was when I was thinking for how to iterate single dimension array as 2d one column-wise:

int array[] = {
  1, 2, 3,
  4, 5, 6,
  7, 8, 9
};
int arraySize = sizeof(array)/sizeof(array[0]);
int rowSize = 3;

for (int i = 0; i < arraySize; ++i) {
  int row = i % rowSize;
  int column = i / rowSize;
  int element = array[row*rowSize+column];
  // do something with element
}

this would literally iterate it column wise [1, 4, 7, 2, 5, 8, 3, 6, 9]

#

how couldn't I thought of this before lmao

#

this is so simple

#

you can iterate both ways with one for loop too

#

just by creating another element variable with swapped row and column places inside index

unique bay
#

real

mortal hare
#

real

sour mural
#

why cant i import this?

mortal hare
#

as a dependency

#

you need a full blown spigot jar file to import this, you need to generate that jar with buildtools afaik

#

i cant help you with this further sorry

chrome beacon
merry viper
#

hello i just made a item display on chat event (the thing when someone type [item] it show it on chat when hovering on that)

i used HoverEvent.Action.SHOW_TEXT
and i need add any possible information i can from the item (color, enchantments, lore, nbt tag and ech)
then i noticed have the thing called HoverEvent.Action.SHOW_ITEM

so my question is how i can convert ItemStack to be use inside that?

here my code of SHOW_TEXT

if(message.contains("[item]")) {

            String new_message = "<" + player.getDisplayName() + "> " + message;

            String[] parts = new_message.split("\\[item\\]", -1);

            BaseComponent[] messageComponents = new BaseComponent[0];

            for (String part : parts) {
                TextComponent textComponent = new TextComponent(part);

                ItemStack item = player.getInventory().getItemInMainHand();
                if (item.getType() != Material.AIR) {
                    ItemMeta itemMeta = item.getItemMeta();
                    if (itemMeta != null && itemMeta.hasDisplayName()) {
                        TextComponent itemComponent = new TextComponent(ChatColor.DARK_GRAY + "[" + ChatColor.YELLOW + item.getAmount() + "x " + ChatColor.RESET + itemMeta.getDisplayName() + ChatColor.DARK_GRAY + "]" + ChatColor.RESET);
                        BaseComponent[] hoverTextComponents = getItemHoverTextComponents(item);
                        itemComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverTextComponents));

                        if(messageComponents.length != 0) messageComponents = TextComponentUtil.append(messageComponents, itemComponent);
                    } else {
                        TextComponent itemComponent = new TextComponent(ChatColor.DARK_GRAY + "[" + ChatColor.YELLOW + item.getAmount() + "x " + ChatColor.RESET + item.getType() + ChatColor.DARK_GRAY + "]" + ChatColor.RESET);
                        BaseComponent[] hoverTextComponents = getItemHoverTextComponents(item);
                        itemComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverTextComponents));

                        if(messageComponents.length != 0) messageComponents = TextComponentUtil.append(messageComponents, itemComponent);
                    }
                }

                messageComponents = TextComponentUtil.append(messageComponents, textComponent);
            }

            for(Player p : plugin.getServer().getOnlinePlayers()) {
                p.spigot().sendMessage(ChatMessageType.CHAT, messageComponents);
            }

            event.setCancelled(true);
        }
tardy delta
#

early returns please

merry viper
#

what you mean?

tardy delta
#

google it

merry viper
#

you want the functions i made too? TextComponentUtil? and getItemHoverTextComponents?

#

@tardy delta

    private BaseComponent[] getItemHoverTextComponents(ItemStack itemStack) {
        ItemMeta itemMeta = itemStack.getItemMeta();

        int number = 1;

        if(itemMeta.hasEnchants()) number++;
        if(itemMeta.hasLore()) number++;

        BaseComponent[] hoverTextComponents = new BaseComponent[number];

        // First line: Display name
        if(itemMeta.hasDisplayName()) hoverTextComponents[0] = new TextComponent(itemMeta.getDisplayName());
        else hoverTextComponents[0] = new TextComponent(String.valueOf(itemStack.getType()));

        if(itemMeta.hasEnchants()) {
            ArrayList<String> enchantmentsText = new ArrayList<>();
            for (Enchantment enchantment : itemMeta.getEnchants().keySet()) {
                enchantmentsText.add("\n" + enchantment.getKey().getKey() + " " + itemMeta.getEnchantLevel(enchantment));
            }
            hoverTextComponents[1] = new TextComponent(ChatColor.GRAY + String.join("", enchantmentsText));
        }

        if (itemMeta.hasLore()) {
            hoverTextComponents[2] = new TextComponent(ChatColor.GRAY + String.join("\n", Objects.requireNonNull(itemMeta.getLore())));
        }

        return hoverTextComponents;
    }
class TextComponentUtil {

    public static BaseComponent[] append(BaseComponent[] baseComponents, BaseComponent... components) {
        BaseComponent[] newComponents = new BaseComponent[baseComponents.length + components.length];
        System.arraycopy(baseComponents, 0, newComponents, 0, baseComponents.length);
        System.arraycopy(components, 0, newComponents, baseComponents.length, components.length);
        return newComponents;
    }
}
obsidian plinth
#

?paste

undone axleBOT
obsidian plinth
#

Learning proxy and channel crap am i just slow or something bc this isnt getting the simpe message
the plugin on the proxy is sending the message but this isnt getting it

https://paste.md-5.net/iwoxiluqaf.java

#

(simple rn but im having problems and cant get any plugin on spigot to get the message on the network)

storm scaffold
#

Is there a way to change the AI of existing mobs to act like others? I'm trying to make zombies ride zombie horses but the zombie horses won't attack the player. I tried setting the zombie horse's target to the target every time a zombie targets something but it still isn't walking towards it - can I make it have the AI of a zombie?

candid plover
#

I'm trying to use reloadConfig(); but the game is not updating, can someone help me? md_5

merry viper
#

@tardy delta hello? can you help me pls?

hazy parrot
#

You get seconds with 100 % 60

#

And minutes with 100 / 60

tardy delta
hazy parrot
tardy delta
#

could probably use a DateTimeFormatter with a custom pattern 👀

merry viper
#

because HoverEvent get only Component[]

#

not ItemStack

#

@tardy delta the code i sent you working, but that not what i wanting i wanting using SHOW_ITEM

pseudo hazel
#

yes

#

thats how maps work

#

or well

#

actually

#

now im doubting myself

#

but should be very easy to test

tardy delta
tardy delta
#

what game

slow oyster
#

Ah you have to change it through JIRA lul

eternal oxide
#

jira is seperate

slow oyster
#

Nope it seems to use the same password for Stash/Jira

eternal oxide
#

only iof you set it the same

slow oyster
#

I'm not on about the forums

eternal oxide
#

they are different auth but your browser gets confused because its not taking sub domain into account

slow oyster
#

No I'm on about these two:

#

Stash doesn't let you change the password because it must be managed by JIRA

eternal oxide
#

ah

slow oyster
#

No 2FA tho 😦

eternal oxide
#

good

#

2FA is so exploitable

#

another vector for attack

obsidian plinth
#

?paste

undone axleBOT
obsidian plinth
eternal oxide
#

you get no incoming message at all?

sullen marlin
#

What's your proxy code

#

And also idk if you can add custom stuff to the bungee channel

obsidian plinth
#

and let me remove my database stuff from it rq

#

?paste

undone axleBOT
obsidian plinth
#

Trying to learn this crap bc why not

candid plover
#

I'm trying to use reloadConfig(); but the game is not updating, can someone help me? uwu

obsidian plinth
#

are u saving the config before reloading?

obsidian plinth
#

Omg md i didn not mean to ping u didnt know u were staff mb

obsidian plinth
#

the proxy gets thje message from the spigot when i do /testbungee but the spigot isnt getting the "simplemessage"

#

Tired it with 3 networks dont ask why i have 3 setup

obsidian plinth
#

bc im using thos lol

candid plover
# drowsy helm show your code
 try {
      MainKits.getPlugin().saveConfig();
      MainKits.getPlugin().reloadConfig();
      sender.sendMessage("§aConfigurações reiniciadas.");
    } catch (Exception error) {
      sender.sendMessage("§cOcorreu um erro ao reiniciar as configurações.");
    }```
errant shale
#

hi

#

so does anyone have 10min?

#

i need help with a code

tardy delta
#

?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!

drowsy helm
#

?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!

errant shale
#

im getting to much errors

obsidian plinth
#

What errors

#

?paste

undone axleBOT
errant shale
#

but i need some1 on vc

eternal oxide
drowsy helm
errant shale
#

i will screenshare

drowsy helm
#

what are you trying to achieve

errant shale
#

its easier, bc its alot

eternal oxide
#

like PlayerCount

errant shale
#

so will some1 help me?

coarse galleon
#

?paste

undone axleBOT
drowsy helm
#

Dont think anyone will get on vc, just write it out with accuracy and we can help

#

plus more people will see the issue and be able to help

errant shale
#

did

#

ok

#

so

#

i cant write the errors in chat, bc its to much

#

thats problem

drowsy helm
#

pastebin

coarse galleon
#

?paste

undone axleBOT
coarse galleon
#

open it

#

paste it inside

errant shale
#

ok

#

did

#

and then?

tardy delta
#

save it and send the link

#

theres a save icon on the right

errant shale
#

did

#

im making a script for plugin

tardy delta
#

i think you're better off sending your code 💀

#

are you trying to implment enchantment

errant shale
#

ok

#

here

candid plover
#

The configuration is not saved.

drowsy helm
errant shale
#

how i do this

#

BC im new in InetelIJ IDEA

#

i program in lua and python not in java

drowsy helm
#

on your project view here, right click in the same folder that all your other code isin

#

then go new > java class for each of the enchantments

hard socket
#

help please

tardy delta
#

close stuff that uses that file

hard socket
#

I only have dc and the cmd prompot

drowsy helm
#

also whats getDefaultPlugin?

hard socket
karmic mural
#

You use Eclipse? Maybe it's still open in the background and keeping those files open for quicker launchspeed?

hard socket
errant shale
#

and i cant paste photos here

#

for some reason

drowsy helm
#

alr hop in a call ill help

eternal oxide
#

?img

undone axleBOT
karmic mural
drowsy helm
#

ah you have to be verified for call aswell

hard socket
#

ok

eternal oxide
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

errant shale
#

lets just vc privatly

drowsy helm
#

just verify i dont do private dms

obsidian plinth
#

the spigot part just isnt getting anything

errant shale
#

ok

obsidian plinth
#

but the proxy is feeding the messages

eternal oxide
#

you are sending custom messages so use a custom channel

errant shale
#

did

obsidian plinth
#

whats the point if it cant even get basic ones

errant shale
#

lets go call

#

im in verified

eternal oxide
#

PlayerCount, PlayerList etc are already handled by bungee

obsidian plinth
#

im just trying to get the spigot part to actually get the message but sure ill waste time to use custom channels so it still doesnt work brb

eternal oxide
#

You are not listening

obsidian plinth
#

all i want to verfiy is the spigot is getting anything from the proxy idc what and its not

#

thats why im here asking

eternal oxide
#

stop trying to overide the built in messages then

obsidian plinth
#

how is this a built in message

        String message = "Hello from proxy!";
hard socket
eternal oxide
#

That is not a standard bungee message so shoudl not be sent on teh BungeeCord channel

#

The Bungeecord channel is for accessing the pre programmed BungeeCord messages

merry viper
#

hoverTextComp is just the list text i want

#

but i know you can convert full item to SHOW_ITEM

#

so showing any infomation of item

karmic mural
# hard socket didnt work

Try to delete C:\Users\hp\Desktop\BuildTools\Bukkit\.git\index.lock like the exception message suggests?

obsidian plinth
#

wow its almost like i called it a total waste of my time and the spigot plugin still isnt getting the messages wow

eternal oxide
#

You did it wrong

tardy delta
obsidian plinth
eternal oxide
#

channel name is the full text including the bit before :

obsidian plinth
#

i just fixed it and it still doesnt fget the messages

#

the proxy gets the message from the command tho

eternal oxide
#

show your proxy side

obsidian plinth
#

code or logs

eternal oxide
#

code

obsidian plinth
#

bc the code is in it

eternal oxide
#

sorry I didn't scroll

obsidian plinth
#

its sending broadcastServerInfo that should just be the
04.06 12:04:30 [Server] INFO [BroadcastLogger]: Sent message to player: Person98
04.06 12:04:30 [Server] INFO [BroadcastLogger]: Simple message broadcasted: Hello from proxy!

#

Learning more and more i dislike this and might just start hiring people for bungee crap

#

so i can foucs on the spigot side of crap

eternal oxide
#

sendData("test1:customchannel"

#

thats the channel Spigot is listening on

obsidian plinth
#

yes

#

or i hope

#
    @Override
    public void onPluginMessageReceived(String channel, Player player, byte[] message) {
        getLogger().info("Received a plugin message on channel " + channel);

        if (!channel.equals("test1:customchannel")) {
            getLogger().info("Channel is not CustomChannel, it's " + channel);
            return;
        }
eternal oxide
#

your proxy code isn;t sending on that

obsidian plinth
#
                player.sendData("test1:customchannel", out.toByteArray());

ivory sleet
#

Plugin message channeling wasn’t intended to be used as a message broker

obsidian plinth
#

its this now

#

im jsut trying to get it get anything

eternal night
#

redis

obsidian plinth
#

as it wasnt even getting player count of the servers on the network before

#

it just doesnt get anything from the proxy

#

even the basics

eternal oxide
#

with the correct channel it should work

ivory sleet
#

well it relies on player connections

obsidian plinth
#

it doesnt for some reason

#

im online

eternal oxide
#

I've used it myself so I know it works

obsidian plinth
#

so why am i hot getting the logs on spigot?

#

not

ivory sleet
#

Have u enabled bungeecord in spigot yml, and like done the configy stuff correctly?

obsidian plinth
#

yea spigot is true bukkit is -1 and the other thing is set to flase

#

false

#

ip fowards is true

#

servers work as i can swap to each

#
settings:
  debug: false
  sample-count: 12
  bungeecord: true
  player-shuffle: 0
  user-cache-size: 1000
  save-user-cache-on-stop-only: false
  moved-wrongly-threshold: 0.0625
  moved-too-quickly-multiplier: 10.0
  timeout-time: 60
  restart-on-crash: true
  restart-script: ./start.sh
  netty-threads: 4
#

unless i missed a step that isnt the 3 of them lol

warm saddle
#

Is there a way to spawn just the firework effect without actually playing the sound of the firework launching and possibly hiding the firework itself?

obsidian plinth
#

ig ill try swaping to spigot not paper to see if that makes a diff

ivory sleet
#

if (!channel.equals("customchannel")) {

#

Shouldn’t u compare against test1:customchannel?

eternal oxide
#

yes

ivory sleet
#

Yeah and then also send to test1:customchannel and not just customchannel mayber? 😅

obsidian plinth
#

at least point i just have the network setup wrong tbh

#

bc if i add

    private void checkIfBungee()
    {
        if ( !getServer().spigot().getConfig().getConfigurationSection("settings").getBoolean( "settings.bungeecord" ) )
        {
            getLogger().severe( "This server is not BungeeCord." );
            getLogger().severe( "If the server is already hooked to BungeeCord, please enable it into your spigot.yml aswell." );
            getLogger().severe( "Plugin disabled!" );
            getServer().getPluginManager().disablePlugin( this );
        }
    }
```it always show sthe message even tho the bungeecord is true in the spigot.yml
young knoll
#

You are checking settings.settings.bungeecord

obsidian plinth
#

thats the code from their wiki

#

lol

young knoll
#

I see no code on that page

obsidian plinth
#

Ah ur blind

young knoll
#

Oh wait

obsidian plinth
#

thats cool

young knoll
#

Why did that take me to the installing bungee page

#

Discord plz

obsidian plinth
#

naw

#

i sent the wrong one firtst

eternal oxide
#

I don;t see that code anywhere

obsidian plinth
#

its a scrool down

#

on the bottom one

ivory sleet
#

Bad wiki

#

Don’t trust wiki pages blindly

#

Any1 can edit them

obsidian plinth
#

Ah

young knoll
#

Speaking of which

eternal oxide
#

yeah bad page

obsidian plinth
#

but is their anywhere else that i could have setuip wrong

#

for the spigot server to not get messages

ivory sleet
#

Yes, u have to use test1:customchannel everywhere

obsidian plinth
#

i am

ivory sleet
#

Not just when registering

#

Send ur updated code

obsidian plinth
#

ok

#

?paste

undone axleBOT
young knoll
#

Blah idk where the edit button is on mobile

#

I’ll fix it later

ivory sleet
#

🙏

obsidian plinth
#

tbh bungee seems like a pain i miss just if block do that if that do this

#

I dont see why its not getting the message from the proxy tbh

#

and now u said not to trust the wiki so

#

lol

#

idk how to feel

eternal oxide
#

typo player.sendPluginMessage(this, "test1:customchannelor", out.toByteArray());

obsidian plinth
#

not the broken part

#

thats the command part

ivory sleet
#

Its a different channel

obsidian plinth
#

test1 is the spigot

#

its not getting messages

ivory sleet
#

customchannelor

obsidian plinth
#

it can send them

ivory sleet
#

U register for customchannel

#

Without the suffix or

obsidian plinth
#

that was a typo while copying bc i was 2x checking before sending the code

#

but that wouldnt even break the onPluginMessageReceived

#

as ik the plugin can reach the proxy and the proxy can get messages from the plugin

#

but test1 (the spigot plugin) isnt getting simplemessage

hard socket
#

I cant build remapped 1.16.5 with BuildTools?

ivory sleet
#

Like does any direction work?

obsidian plinth
#

yes

eternal oxide
#

I see nothign else wrong in your code

obsidian plinth
#

the spigot can send a messagfe to the proxy and it gets it

#

when the proxy trys to talk to the spigot it doesnt get it

#

i tired it on 2 differnt proxys and 2 differnt networks that r hosted in differnt palces

#

the proxys are hosted both at apexx 2 servers on one proxy is a custom panel the other is on pebble

hard socket
#

I cant build remapped 1.16.5 with BuildTools?

eternal oxide
#

remapped starts around 1.18.2

#

maybe 1.18.5

#

I forget which

worldly ingot
#

1.18.3+ definitely doesn't exist KEKW

obsidian plinth
#

tbh i give up fuck this

#

cant even get a simple hello working

quiet ice
#

probably meant 1.16 and not 1.18

worldly ingot
#

It was added to BuildTools in 1.17

ivory sleet
quiet ice
#

I could swear it was there before that...

ivory sleet
#

Since that ought to queue it

#

But tbh idrk what’s actually going wrong here

obsidian plinth
#

same

#

and im pissed

eternal oxide
#

I can;t test anything at the moment

obsidian plinth
#

ill just go back to making fukin blockbattles instead of learnign new crap

obsidian plinth
ivory sleet
#

Maybe use redis 😊

#

But yeah I can try to look into source, see if it blocks any channels or filters out sth specific

#

Cuz iirc it def prevents certain channels from being used etc

hard socket
ivory sleet
#

Don’t

obsidian plinth
#

it tells me im dumb as shit

ivory sleet
#

You’ll get trolled

obsidian plinth
#

and i told it to off itself

#

idk its 9am i should probs sleep

tardy delta
#

chatgpt cant even calculate me a tangent properly

obsidian plinth
#

no it works well if u use it well

#

but not for bungee

tardy delta
#

it tells some bs that it found on internet

#

especially for coding lol

obsidian plinth
#

Def a user error their

ivory sleet
#

like just any number or when cos(x) approaches zero?

tardy delta
#

well in some formula

ivory sleet
#

Ah

tardy delta
#

it had to simplify it and it decided to mess with it

fluid river
#

free calculus lessons

tardy delta
#

half of its responses are "no your answer is wrong, the answer is <repeats input>"

fluid river
#

Imaginary numbers, sin/cos formula for Z

quiet ice
#

Isn't it just f'(n)x + f(n)?

tardy delta
fluid river
#

ok start

obsidian plinth
# ivory sleet Ah

any better docs for bungee or what u think ill need later on plz dm me them

fluid river
obsidian plinth
#

read up

eternal oxide
#

If I get time later I'll throw a demo together

obsidian plinth
#

thx dm me when

#

its 9 am i need sleep

#

rn i have the proxy odin the other styuff it needs

fluid river
#

you can't send a plugin message to proxy or what

obsidian plinth
#

the spigot part isnt getting messages

#

at all

#

from any channel

fluid river
#

umm

quiet ice
#

Is there even a player connected?

fluid river
#

probably you are doing something wrong

quiet ice
#

Bungee cannot send data if no players are connected

fluid river
#

yup

obsidian plinth
obsidian plinth
fluid river
#

showcode

obsidian plinth
#

read up

#

as i said i give up and im tired

#

?pate

#

?pate

#

?paste

undone axleBOT
fluid river
#

alr call me tomorrow

#

we'll try to solve this

obsidian plinth
#

was just a simple thing bc it wasnt even getting player count numbers

#

or the basic messages

#

so i went to helloworld type shit

quiet ice
#

Look - it gotta be something obvious

obsidian plinth
#

the spigot sends the test mesage find and the proxy gets it

#

but the spigot isnt getting the message from the proxy and it sends it

quiet ice
#

Okay in that case a connection is actually made

fluid river
#

so in bungee you registered it

obsidian plinth
#

yea the channel works

#

but spigot isnt getting anything

fluid river
#

and what is your code in spigot part

obsidian plinth
#

its test1

fluid river
#

i mean

obsidian plinth
#

FelyProxy is the code on the proxy

fluid river
#

spigot plugin code

obsidian plinth
#

its in the link

#

scroll down

fluid river
#

oh

obsidian plinth
#

to me it seems how i think it would work

fluid river
#

so that's not triggered

obsidian plinth
#

yea

fluid river
#

like at all

obsidian plinth
#

nothing triggers it

fluid river
#

alr

#

gonna now look at my old code

obsidian plinth
#

once i get a plugin that can get messages the rest is easy lol

#

Than i get to break even more code in a working gamemode to use bungee lol

fluid river
#

i'm quite sure official bungeecord guide on spigotmc is hella obsolete

#

i had one somewhere on my pc

obsidian plinth
#

theirs not much on bungeecord that i could really find

fluid river
#

just need to find it

obsidian plinth
#

this is 1.19 btw

quiet ice
#

I guess you could just check whether wireshark or any other packet analysis program picks up on the packet (make sure to disable compression beforehand though)

fluid river
#

i coded for 1.16 but i don't think anything really changed

obsidian plinth
#

than 1.20 in like 3 fucking days

#

i have zero clue if i can do that on apex

obsidian plinth
orchid gazelle
#

Well yes

#

Display Entities

quiet ice
#

but those won't change PMCs, or?

orchid gazelle
#

Tf is a PMC

obsidian plinth
#

i fotgot about thos

fluid river
#

bungeecord guide is stuck somewhere on 1.12

obsidian plinth
#

ngl

#

i wonder how i could use them

fluid river
#

pdc?

obsidian plinth
#

its stuck somewhere pissing me off

fluid river
#

or display entitites

quiet ice
#

And jesus, is discord getting DDoSed right now? The ping I'm getting is otherworldly

obsidian plinth
#

SAME

orchid gazelle
#

Yes

fluid river
#

they haven't been changed since like 1.14

obsidian plinth
#

yea

#

its bad rn

#

thought it was just me

#

I sent this messafge at 9am est

#

yea

fluid river
#

thought russian government started blocking discord for me heh

tardy delta
obsidian plinth
#

lol

#

a

#

a

coarse galleon
#

ah that's why just now I sent a message and it wasn't sending(not here)

quaint mantle
#

messages deleted ?

tardy delta
#

shaded it?

karmic mural
#

I think showing the class might help

tardy delta
#

do you have a pom.xml

#

damn discord going brr

#

set the scope to compile for that dependency?

#

bruh cant even sent my message

chrome beacon
#

It probably doesn't

#

Oh slow discord today

tardy delta
#

you doing that?

#

bruh wtf

quiet ice
#

NoClassDefFoundExceptions can also hint at classloading failures

#

NoClassDefFoundExceptions can also hint at classloading failures

tardy delta
#

ye

quiet ice
#

Yeah, switching to IRC might make sense at this point

tardy delta
#

18 secs response time 💀

quiet ice
#

Yeah, switching to IRC might make sense at this point

tardy delta
#

heehee i respond to your message and mine arrives earlier than yours

quiet ice
#

Could you give us the entire log?

#

NCDFE hints at classloading failures. Usually the class is not in the jar but sometimes other reasons could cause this

tardy delta
#

bruh what aabout that scope i was talking about

quaint mantle
#

how do i get all faces of a block? with loop ?

quiet ice
#

Okay it is caused by the class file NOT being present in the jar

#

You don't even use maven. So that is your issue

tardy delta
#

just sent pom.xml

quiet ice
#

... or apparently not - though how do you build the jar anyways?

tardy delta
#

bruh what aabout that scope i was talking about

quiet ice
#

That should work, but setting the scope io.socket:socket.io-client to compile should work better

tardy delta
#

just sent pom.xml

#

bruh what aabout that scope i was talking about

quiet ice
tardy delta
#

uh ye

#

dont even remember what i sent cuz the message is just gone

quiet ice
#

Also is your discord scuffed or do you send your messages a bazillion times?

tardy delta
#

dont even remember what i sent cuz the message is just gone

quiet ice
#

Also is your discord scuffed or do you send your messages a bazillion times?

tardy delta
#

discord is fucked up

#

lemme guess, their replication is having issues

#

?ping

undone axleBOT
#

Pong.

tardy delta
#

💀

quaint mantle
#

Is there a method that takes all the faces of the block?

tardy delta
#

have you set scope to compile?

quiet ice
#

Could you send the fully compiled jar?

tardy delta
#

loop over BlockFace.values() and call getRelative

quiet ice
quiet ice
#

Yeah, try explicitly setting the scope to compile for good measure, though it should be compile by default

#

okay it is shading it

tardy delta
#

alr we back

#

should be found then?

#

should be found then?

#

alr we back

quaint mantle
quiet ice
#

Why the hell are you using cc.craftlink.utils.WebsocketClient in source code and cc.craftlink.Utils.WebsocketClient in the jar?

#

Try nuking all caches I guess. Something is fishy

quaint mantle
#

i have lag or ...??

quiet ice
#

Could you show pseudocode of what you are attempting to achieve @quaint mantle?

quiet ice
#

Just do mvn clean

#

I still have no idea what you are going for

quaint mantle
#

test

quiet ice
#

I still have no idea what you are going for

#

no it's under "target" in your project folder

#

These is also maven local located under "%userhome%/.m2" but it is irrelevant for your issue

quiet ice
quaint mantle
# quiet ice Could you show pseudocode of what you are attempting to achieve <@45622657779813...
    @EventHandler
    public void onPlace(PlayerInteractEvent e) {
        if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
        if (e.getItem() == null && e.getClickedBlock() == null) return;

        ItemStack item = e.getItem();
        Block block = e.getClickedBlock().getRelative(BlockFace.UP);

        if (item.getType() == Material.PAPER) {
            block.setType(Material.TRIPWIRE, false);
            item.setAmount(item.getAmount()-1);
        }

    }```
#

this flower is paper

#

and when player right click to target block face puts block to face

eternal oxide
#

this line should be an || if (e.getItem() == null && e.getClickedBlock() == null) return;

tardy delta
#

geols message keeps returning for me lol

quiet ice
quaint mantle
#

fixed

tardy delta
#

discord having pleasure

#

poor devs gotta get out of their bed

quaint mantle
#

oh finally

quiet ice
#

I have no idea how discord managed to mess up that bad. Shouldn't messages have UUIDs to prevent double-posting in case of routing issues?

quaint mantle
#

OH NOT FIXED IM STILL LAGGING OMG

tardy delta
#

maybe the node replication is fucking up?

#

i have no idea how it works

quiet ice
#

Discord is probably getting DDoSed, the only "cure" would be to wait until it is over
Or just use IRC

tardy delta
#

whats irc btw

quiet ice
#

?irc

undone axleBOT
tardy delta
#

lol

quaint mantle
#

OH NOT FIXED IM STILL LAGGING OMG

quaint mantle
#

oh finally

orchid gazelle
#

lol

tardy delta
#

test

orchid gazelle
#

oh really?

tardy delta
#

more like "you sent 4 times that you deleted it"

orchid gazelle
#

lol

west pollen
#

how can i start the server with java 11 instead of java 8????

tardy delta
quiet ice
tardy delta
#

linux :)

quiet ice
#

the best kind of linux

#

what exactly do you mean

tardy delta
#

reminds me i need to fix my dualboot

#

that message took a suspicious amount of time to be sent

quaint mantle
#

test

quiet ice
#

sure you can do

public class X {
  public void m() {
    m();
  }
}

if you want to

tardy delta
#

oh man im going to be called 8 times now

zealous osprey
#

You can call a method from inside a method, even itself. If you call the method you are in it's called "recursion", which can lead to many weird issues.
However you cannot create methods inside methods. Except if you consider "lambdas" methods.

quaint mantle
#

test

#

test

#

wuaa

tardy delta
#

you good?

zealous osprey
tardy delta
#

discord is going brr but i think your internet is also going brr

signal kettle
#

Hello how I can drop each item from ArrayList of ItemStacks?

There is array

    private final List<ItemStack> BrewingBarrelItemsList = new ArrayList<ItemStack>();

This one add items to this arraylist from slots

    @EventHandler
    public void onInventoryClose(final InventoryCloseEvent event) {
        if (!event.getInventory().equals(invBrewingBarrel)) return;
        final ItemStack slot1 = event.getInventory().getItem(0);
        final ItemStack slot2 = event.getInventory().getItem(2);
        final ItemStack slot3 = event.getInventory().getItem(4);
        final ItemStack slot4 = event.getInventory().getItem(6);

        BrewingBarrelItemsList.add(slot1);
        BrewingBarrelItemsList.add(slot2);
        BrewingBarrelItemsList.add(slot3);
        BrewingBarrelItemsList.add(slot4);
    }

And now I want on BlockBreak drop each of this items on the ground

    @EventHandler
    public void onBlockBreak(final BlockBreakEvent event) {
        Block block = event.getBlock();
        Player player = event.getPlayer();

        if (block.getType() != Material.BARRIER) return;
        FurnitureMechanic furnitureMechanic = OraxenFurniture.getFurnitureMechanic(block);
        if (furnitureMechanic == null) return;
        if (!furnitureMechanic.getItemID().equals("medieval_market_decoration_v1_barrelsword")) return;

        block.getWorld().dropItemNaturally(block.getLocation(), BrewingBarrelItemsList.);
    }
orchid gazelle
#

ikr

tardy delta
#

reminds me i need to fix my dualboot

#

iterating my friend

#

man stop sending ikr

orchid gazelle
#

ikr

signal kettle
#

Thank you

tardy delta
#

iterating my friend

#

man sent ikr and i received it 8 times 💀

#

oh now your LOL is also arriving again

orchid gazelle
#

ikr

tardy delta
#

hasnt happened

signal kettle
#

Discord have issues today and messages got sent like 2-4 times 💀

tardy delta
#

oh god

orchid gazelle
#

LMAO

zealous osprey
#

I'm confused what you want to do

orchid gazelle
#

discord doing late april fools joke?

#

you already told him that ;)

#

"ikr"

#

LMAO

signal kettle
#

lol

zealous osprey
#

Is that on the main thread?
If so, definitely make a seperate thread for that.

#

Is that on the main thread?
If so, definitely make a seperate thread for that.

tardy delta
#

bruh my messages keep coming back

orchid gazelle
#

woohoo its going down

tardy delta
#

bruh my messages keep coming back

quiet ice
#

LOL

orchid gazelle
#

HAHAHA

tardy delta
#

maybe in five hours your call will arrive

#

ikr

orchid gazelle
#

ICANT

quiet ice
#

Nah, I already had my fair share or disruptions

orchid gazelle
#

ICANT

#

HAHAHA

tardy delta
#

man resends his messages on purpose 💀

zealous osprey
#

Then make a cache for all players that need to be verified and make so that your API can take multiple players as input. So you can dump the cache quicker and the responses are faster for more players.

quiet ice
#

no, but you can use locks

zealous osprey
#

There's something called CompleteableFuture

quiet ice
#

Or just use CF

tardy delta
#

why not running it in sync then

#

or are we talking about thenAccept

zealous osprey
#

@rare aurora yeah this is good

tardy delta
#

i hope i wont get called the moment i go to my bed

orchid gazelle
#

Ye

tardy delta
#

im scared

orchid gazelle
#

Its fixed

#

trust

#

I believe in Physics

tardy delta
#

i dont believe in trust

quiet ice
#

Lost to the aether

orchid gazelle
#

Fixed

quiet ice
#

?jd-s

undone axleBOT
west pollen
#

how can i start the server with java 11 instead of java 8????

quiet ice
#

So

Bukkit.getScheduler().callSyncMethod(myPlugin, () -> {
  // Sync stuff
  return null;
});
west pollen
#

how can i start the server with java 11 instead of java 8????

quiet ice
#

Yep

quiet ice
west pollen
#

thank you

quiet ice
shadow night
#

How do I rename the item (I have the ItemStack and the ItemMeta) without that font that happens when u rename items on an anvil

signal kettle
#

okay morice_0 I made it and it's working, really thank you but now when one of this slots are empty then it's print null error
Is there any easy way to avoid this eg in loop like of any of ItemStack are null then skip it and go to others?

shadow night
#

Ok

signal kettle
#

will this make a work?

#

ohh thank you now I learned a new one thing that continue exist and what it makes

shadow night
#

Void air and cave air be like

sick edge
#

Hi I have a question regarding fat-jar creation in gradle...for some reason when I build a fat jar in a task and not through the default jar{} I get a "Could not find or load main class" error even though everything is exaclty the same just in a custom task
Thx in advance

quiet ice
#

what is your build.gradle?

sick edge
#
application {
    mainClass = "$main"
}

// THIN JAR
jar {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE

    manifest {
        attributes 'Main-Class': "$main"
    }

}

// FAT JAR
tasks.register('fatJar', Jar) {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE

    manifest {
        attributes 'Main-Class': "$main"
    }

    from {
        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    }
    archiveBaseName = project.name+'-fatJar'
}
#

If I add the from part to the normal jar it works with my dependencies

quiet ice
#

Is this spigot-related or nah?

sick edge
quiet ice
#

just wanted to be sure you didn't do stuff you aren't supposed to

#

Generally I don't use the traditional manual fat jar task way but rather use the shadow plugin so I don't have much experience with this but it seems like it is correct for the most part

#

Did you verify whether all classes are present inside the jar?

sick edge
# quiet ice Did you verify whether all classes are present inside the jar?

No how can I do that again?
The way I understand the shadow plugin it always shadows the dependencies so that there are no conflicts when different jars bring the same included dependencies but if I have multiple plugins for example that use the same then I only want it once and not shadowed...is that possible with the shadow plugin?

quiet ice
#

If you wisely make use of the compileOnlyApi and implementation scopes there is no difference

#

However there is absolutely no difference between what you just did and the shadow plugin from what I know

#

No how can I do that again?
Just open the jar as a zip file

sick edge
quiet ice
#

I feared that

#

Add

  from jar.getSource()
  dependsOn javaCompile  

to your fatJar task

#

It's a little bit hacky but whatever - it should work

sick edge
#

yeah it works and it seems like the shadow plugin does exactly the same thing...so does it not "shade" the dependencies or is that just not visible through the classes?

quiet ice
#

Well I have no real idea what shadowing is called shadowing to be honest

#

I just know that it basically means adding all the classes that need to be present at runtime into the shadowed jar

#

it probably does a few extra things though

sick edge
quaint mantle
#

test

#

is dc fixed ?_

#

yes

quiet ice
#

that person complaining about shadow jar being a plugin is wrong. But oh well

sick edge
#

yeah but what would be the way to go when two plugins for mc use the same dependency (and you know it and don't want it packed in each jar) would I use implementation on one and compileOnly on the other and then just build a fatJar on both in case of other dependencies needed?

eternal night
#

That would raise a dependency from plugin b to plugin a

quiet ice
#

Use spigot's libraries feature

sick edge
eternal night
#

yea

#

but then you don't have to even add the other library

eternal night
#

just have plugin a expose its libs

#

java-library has configurations for that iirc

quiet ice
#

In plugin A:

dependencies {
  api myLib
}

In plugin B:

dependencies {
  compileOnlyApi pluginA
}
#

pluginA and myLib won't be on the runtime classpath of plugin b and thus won't get shaded

quaint mantle
#

hi guys
im trying to make block place with item when player right click the clickedblock's any face will form the block on clicked face
so i how can i get face from clickedblock ?

Is this explanatory?

quiet ice
#

However mylib is on the runtime classpath (as per api) of plugin a and thus will get shaded into plugin a

quaint mantle
eternal night
quiet ice
#

BlockFace.values()

#

What the fuck is the all block face?

eternal night
#

magic

quaint mantle
#

wait

quiet ice
#

there is no such thing as the all block face

#

There is just an array of all available block faces called BlockFace.values() and the method you are searching for, PlayerInteractEvent#getBlockFace()

#

Unless you mean the facing of a block

zenith gate
#
for(Entity target : nearest){
                            if(player.hasLineOfSight(target) && target instanceof LivingEntity && !target.isDead() && target != player){
                                arrow.setVelocity(target.getLocation().toVector().subtract(arrow.getLocation().toVector()));
                                // make the arrow travel slower
                                arrow.setVelocity(arrow.getVelocity().multiply(0.25));
                            }
                            else{
                                cancel();
                            }
                        }

Shouldn't this only make the arrow fly towards a target that is in line of sight of the player using the bow? It keeps shooting the arrow backwards into entities, but it it should have oine of sight for the arrow to target someone.

#

??

#
List<Entity> nearest = arrow.getNearbyEntities(HomingRadius, HomingRadius, HomingRadius);
#

it is thats the problem. its trying to target someone the player cannot see.

#

itll shoot the arrow behind them and hit a cow or something

#

its not suppose to.

quiet ice
#

LOS does not check the FOV

#

Yes, duh

zenith gate
#

what?

quiet ice
#

The server cannot know what the FOV of the client is

zenith gate
#

so it does 360 fov

quiet ice
#

Obviously

#

Testing for the FOV would be interesting - I'd guess you'd compare the LOS vector with the vector of the player's eyes. How exactly it is done is not instantly clear to me though

mellow edge
#

how can I get all the boss bars that were ever created (Bukkit.getServer().getBossBars() only returns some created by commands!¨)

#

the ones I created with createBossBar();

#

lol now I have the current ones and idk how to remove them

#

when I created them I did not store them anywhere

#

they just are still there (on my screen) and idk if there is any list of them

#

I know but HOW because I don't know if there is an list of them

#

oh I think I "found" a solution lol

young knoll
#

Bossbars can be made with namespaced keys and they will persist

still adder
#

I'm trying to make a plugin for a gear enhancement system, but I've been having some issues. Would anyone be able to look through my code?

sterile axle
#

It’s better if you explain what issue you’re having, what is not working that should be, and relevant code snippets. Very few people will engage with that

#

?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!

still adder
#

there is a section of my code where if a player clicks on a "enchanted anvil" within a custom GUI that opens up, it consumes a certain item.
right now, the player is not able to click on the enchanted anvil at all.

mellow edge
opal juniper
#

firstly, do not use the title to detect the inventory, use the inventory holder

#

and the problem is because you cancel the event immediately

worldly ingot
#

If I had a dollar for every time someone suggested abusing the InventoryHolder for custom GUIs, I'd have a lot more loonies than I'd be comfortable having

opal juniper
#

ok but it’s better than the inventory title. You can use the inventory instance though and store the instance

worldly ingot
#

InventoryView, yes. The preferred means of doing this

opal juniper
#

yep

still adder
#

sorry, still quite new to plugin dev

karmic mural
#

If I have a method for updating a custom items data, should I place that in the class I have to create that item, or should I give it it's own class in my itemfactory package?

unique bay
#

for the first time my plugin is functioning as intended

#

this must mean I need to abandon it now so it doesn't break

coarse galleon
#

I want to build a spigot jar with a custom class in NMS, how can I add a .java file to NMS?

quaint mantle
#

i have problem i just one tap but my code puts two tripwirejava public void onPlace(PlayerInteractEvent e) { if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return; if (e.getItem() == null || e.getClickedBlock() == null) return; BlockFace blockFace = e.getBlockFace(); Block block = e.getClickedBlock().getRelative(blockFace); block.setType(Material.TRIPWIRE, false); }

#

need i do scheduler for fix this ?

echo basalt
#

?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
}
echo basalt
#

prolly

#

yeah

eternal oxide
#

you didn't cancel the event

zenith gate
#

can someone explain to me why i cant do anything with the wither? like I dont get any options to modify the creature.

@EventHandler
    public static void witherSpawn(CreatureSpawnEvent event){
        if(event.getEntity() instanceof Wither wither){
            wither.setCustomName(ChatColor.DARK_RED + "");
        }
    }

The setCustomName has a red line, and wants me to create the method. But the method already exists.

echo basalt
#

1 - why static?

#

2 - invalidate caches

zenith gate
#

static doesnt change anything. I have all my spawn classes static.

tardy delta
#

sir those are methods

#
  • if you have anything with dependency injections, that wont work
celest sonnet
#

how can i set a blocks facing back to its original facing after I have set the type ?

zenith gate
young knoll
#

Use Material#createBlockData with the new type

celest sonnet
young knoll
#

Then .merge the BlockData that’s already at that location

celest sonnet
#

Caused by: java.lang.IllegalArgumentException: Data not created via string parsing

young knoll
#

Yeah hang on that’s the wrong method

fierce salmon
#

What can I do to check to see if the inventory that is clicked on is the player's inventory or not?

young knoll
#

I thought for sure there was a method to copy matching states from one BlockData to another

#

I guess I was wrong

celest sonnet
#

i actually just found the answer

#

BlockFace facing = ((Piston)event.getClickedBlock().getBlockData()).getFacing();
event.getClickedBlock().setType(Material.STICKY_PISTON);
Piston data = (Piston) event.getClickedBlock().getBlockData();
data.setFacing(facing);
event.getClickedBlock().setBlockData(data);

fierce salmon
#

thanks

hard socket
#

why the attribute is always null?

celest sonnet
#

?

hard socket
#

null not false mb

hazy parrot
#

What

hard socket
celest sonnet
#

maybe ender dragons dont have that attribute?

hard socket
#

dont they?

karmic mural
#

Could it be a paper thing?

celest sonnet
young knoll
#

Probably not

#

Dragons are wacky

celest sonnet
#

GENERIC_MAX_HEALTH

#

see if it works. if it doesnt its probably that dragons just dont have attack damage like that

maiden geode
#

I thought about using HolographicDisplay plugin for that, thought about using API but some dude told me that this NMS code is very specific and it can't be replaced with API.

#

I'll try that out later, have to finish login plugin

sharp bough
#

does anyone know why this is happening? placeholderapi not replacing any values, the chat message is my own code, and the other one is a premade one

wet breach
# hard socket

only the wings and head of the enderdragon is able to attack

#

also the ender dragon is technically like 4-5 entities

#

one of the reasons it is a pain to work with

celest sonnet
#

how do i get the durability of shears?

flint coyote
celest sonnet
#

oh my god please try

wet breach
#

its no different then how doors are 2 blocks

#

and you could therefore have half doors

flint coyote
#

guess that depends on what packets exist. Whether all 5 entities send packets or only the one "dragon"

young knoll
#

Why would you need the vault extension for player name

#

Aah the scoreboard

#

IIRC the extension for player name is just Player

signal kettle
#

Hello guys I want to make a plugin that on block click its open custom inventory and then when player put there a specific item eg apple and click on "accept" item in gui then it will change a block on to another one, is there even a way to make it? Like thrue pdc or smth?

young knoll
#

You could use the block PDC lib

signal kettle
#

Because in InventoryClickEvent there's no way to get the block and I think pdc needs what block it's need to save

young knoll
#

So store it somewhere when the player clicks on your block

#

Like a map, or make a custom inventory wrapper class that takes it as a parameter

tawdry echo
#

Player insted of valut i guess

robust pebble
#

my instant decreases my time even though Im not logged in

#

to the server

young knoll
#

Yes

#

Time does not stop when you are not online

robust pebble
#

how can I stop it?

young knoll
#

How can you stop time?

#

Idk if we are qualified for that question

#

Use PlayerCommandPreprocessEvent and link it to a function

robust pebble
#
Instant expires = Instant.ofEpochMilli(pdc.getOrDefault(key, PersistentDataType.LONG, Instant.now().toEpochMilli()));
#

I want to stop the instant

young knoll
#

When the player leaves calculate how long is left and save that

eternal oxide
#

you don;t stop an Instant. it's just a number

young knoll
#

Then when they join create a new instant with the saved value

eternal oxide
#

all you needs to to set a PDC value of teh Instant they log off

robust pebble
#

I need log out event im guessing

young knoll
#

PlayerQuitEvent

robust pebble
#

thanks

eternal oxide
#

when they rejoin you take the Instant you saved on quit, subtracted from Instant.now() when they rejoin and add that to their clock

signal kettle
eternal oxide
#

actually no that will not work

signal kettle
#

and now how I can get this there:

eternal oxide
#

I lie it will work

signal kettle
#

yes so I can change block that player clicked when opening Inventory

robust pebble
#

can I create a method in deathclockutills to save time

eternal oxide
#

yes

#

public static void pauseClock(player)

robust pebble
#
public static void saveTime(Player player, Instant time) {

        PersistentDataContainer pdc = player.getPersistentDataContainer();
        pdc.set(key, PersistentDataType.LONG, time.toEpochMilli());
    }
eternal oxide
#

you need to create a second NamespacedKey(plugin, "paused")

robust pebble
#

makes sense

eternal oxide
#

then pdc.set(pause_key, type.LONG, Instant.now().toEpochMilli())

robust pebble
#
private static NamespacedKey pause = new NamespacedKey(JavaPlugin.getProvidingPlugin(Main.class), "pause");
eternal oxide
#

you don;t need to pass in an Instant, just the player

#

call that method on PlayerQuitEvent

#

create another method for unPauseClock

robust pebble
#
public static void saveTime(Player player) {

        PersistentDataContainer pdc = player.getPersistentDataContainer();
        pdc.set(key, PersistentDataType.LONG, getTime(player).toEpochMilli());
    }
eternal oxide
#

no

#

you are storing the time they log out

robust pebble
#
public static void saveTime(Player player) {

        PersistentDataContainer pdc = player.getPersistentDataContainer();
        pdc.set(pause, PersistentDataType.LONG, getTime(player).toEpochMilli());
    }
#

pause

eternal oxide
#

no

#

pdc.set(pause_key, type.LONG, Instant.now().toEpochMilli())

dusty swan
#
public class BlockBreakEvent implements Listener {
    @EventHandler
    public void block(BlockBreakEvent event) {
        Block block = event.getBlock();
    }
}```
"Cannot resolve method 'getBlock' in 'BlockBreakEvent'"
robust pebble
#
private static NamespacedKey pause = new NamespacedKey(JavaPlugin.getProvidingPlugin(Main.class), "pausekey");
#

This is namespace key

#

which one do I use

#

pause or pausekey

eternal oxide
#

pause

robust pebble
#

ok now I need to do quit event

eternal oxide
#

no, you need to create an unpause method

robust pebble
#

ok

#
public static void pauseTime(Player player) {

        PersistentDataContainer pdc = player.getPersistentDataContainer();
        pdc.set(pause, PersistentDataType.LONG, getTime(player).toEpochMilli());
    }
    public static void resumeTime(Player player) {

        PersistentDataContainer pdc = player.getPersistentDataContainer();
        Instant expires = Instant.ofEpochMilli(pdc.getOrDefault(pause, PersistentDataType.LONG, Instant.now().toEpochMilli()));
        pdc.set(key, PersistentDataType.LONG, expires.toEpochMilli());
    }
eternal oxide
#

no

robust pebble
#

huh

eternal oxide
#

no to both methods

robust pebble
#

wy

eternal oxide
#

to pause you are storing the time it is NOW, not the players time

#

pdc.set(pause, type.LONG, Instant.now().toEpochMilli())

quaint mantle
#

can i silent to block break sounds ?

eternal oxide
#

I posted that three times now

hazy parrot
#

why not save duration instead of instant ?

#

if i understood you right

eternal oxide
#

I like Instant

robust pebble
#
pdc.set(pause, PersistentDataType.LONG, Instant.now().toEpochMilli());
eternal oxide
#

because this is time relative, not a count

hazy parrot
#

instant is basically wrapper around system.currenttimemills

robust pebble
#

whats wrong with the other method

quaint mantle
#

hi bro i can't fix this, still

    @EventHandler
    public void onPlace(PlayerInteractEvent e) {
        if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
        if (e.getItem() == null || e.getClickedBlock() == null) return;

        BlockFace blockFace = e.getBlockFace();
        Block block = e.getClickedBlock().getRelative(blockFace);
        Block block2 = block.getRelative(BlockFace.DOWN);

        if (e.getHand() == EquipmentSlot.HAND && e.getItem().getType() == Material.PAPER &&
        block.getType() == Material.AIR && block2.getType() == Material.GRASS_BLOCK) {
            e.setCancelled(true);
            e.getPlayer().swingMainHand();
            block.setType(Material.TRIPWIRE, false);
        }
    }``` need i add scheduler ?
robust pebble
#

PersistentDataContainer pdc = player.getPersistentDataContainer();
Instant expires = Instant.ofEpochMilli(pdc.getOrDefault(pause, PersistentDataType.LONG, Instant.now().toEpochMilli()));
pdc.set(key, PersistentDataType.LONG, expires.toEpochMilli());

eternal oxide
#

to unpause you read the value under "pause" then set key to key + (Instant.now() - pause)

robust pebble
#
PersistentDataContainer pdc = player.getPersistentDataContainer();
        Instant expires = Instant.ofEpochMilli(pdc.getOrDefault(key, PersistentDataType.LONG, Instant.now().toEpochMilli()));
        Instant paused = Instant.ofEpochMilli(pdc.getOrDefault(pause, PersistentDataType.LONG, Instant.now().toEpochMilli()));
        expires = expires.plusMillis(Instant.now().until(paused, ChronoUnit.MILLIS));
        pdc.set(key, PersistentDataType.LONG, expires.toEpochMilli());
#

does this look good

eternal oxide
#

reverse Instant.now().until(paused, ChronoUnit.MILLIS)

robust pebble
#

wdym

eternal oxide
#

paused.until(Instant.now())

robust pebble
#
expires = expires.plus(paused.until(Instant.now(), ChronoUnit.MILLIS), ChronoUnit.MILLIS);
eternal oxide
#

looks ok

robust pebble
#

now to the quit event?

eternal oxide
#

yes

#

quit event you call pause, join you call unpause

robust pebble
#
@EventHandler
    public void PlayerLeftEvent(PlayerQuitEvent event) {
        // get time and save in pdc
        Player p = event.getPlayer();


    }
errant shale
#

hi

#

does some1 have 10min?

#

i would need some1 help

tardy delta
#

you know the answer

errant shale
#

its hard to explain

#

can some1 VC with me, so i can screenshare?

robust pebble
#

public void PlayerLeftEvent(PlayerQuitEvent event) {
// get time and save in pdc
Player p = event.getPlayer();
pauseTime(p);
}

errant shale
#

bc its kinda alot

#

and hard to explain

#

please

robust pebble
#

if (!p.hasPlayedBefore()) {
p.sendMessage(DIALOG + ChatColor.GREEN + "Welcome to the server!");
// set time
setClock(p, 10);

    } else {
        p.sendMessage(DIALOG + ChatColor.GREEN + "Welcome Back!");
        resumeTime(p);
    }
eternal oxide
#

playerLeftEvent as it's a method

errant shale
#

VC?

eternal oxide
#

looks ok

errant shale
#

ok come

#

general 1

robust pebble
#

alright

#

imma register the event rq

flint coyote
#

= doesn't react to changes

celest sonnet
#

salb just try to describe it

errant shale
#

i cant screenshar

hazy parrot
#

i doubt its that hard to explain

celest sonnet
#

Fr

#

Yes

errant shale
#

so basiclly im tryin to make an plugin with custom enchants

celest sonnet
#

Fr

tardy delta
#

with 4 in call now 💀

errant shale
#

but i have alot of errors

celest sonnet
#

Most active spigot discord bc

hazy parrot
celest sonnet
#

maybe lol

errant shale
#

3 out of 5 enchant are not working

celest sonnet
#

ok so that doesn’t actually help

gloomy thunder
#

Why is nobody allowed to put the protection?

celest sonnet
#

you need to screenshot the code/errors

robust pebble
celest sonnet
#

Is it hard or easy to do

errant shale
#

how?

#

to long

celest sonnet
#

The errors are too long?

hazy parrot
#

?paste

undone axleBOT
errant shale
#

yea and the code

celest sonnet
#

Show the errors in whatever application you’re using there should be like an error section atleast

hazy parrot
#

just send error, we are not magicians smh

#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

celest sonnet
#

LMFAO

#

I’m new to coding in general and I wanted to try it to develop my skills

#

do you just use like listeners when something happens and check if the tool has certain meta data or smth

hazy parrot
#

you would most likely want to use pdc for custom enchants

celest sonnet
#

oh I see

hazy parrot
#

use pdc 😭

gloomy thunder
#

help

errant shale
#

here:

#

my script and there errors