#help-development

1 messages ยท Page 254 of 1

smoky oak
#

supplier?

tardy delta
#

to not instantiate a bunch of those objects

smoky oak
#

ah well theres a reason its a set, and that is that the names of the effects dont matter, also, each of those effects should get instantiated since each of them does something unique on the world.
what im doing is extending effectPreset and writing the functionality in those classes
then im looping over the set and trigger them

#

internally its actually handeled via a <string, effectpreset> map but thats cuz there's 'secondary' effects

tardy delta
#

uhh i think i lost you

smoky oak
#

?paste

undone axleBOT
smoky oak
#

what im asking is how do i best sort/assign the configurationSections to the classes extending the preset

tardy delta
#

well doesnt it work to give a configurationsection to each of those classes?

smoky oak
#

well yes. Each of the classes expects a different structure, but in the top there's a entry that gives the type of the effect

#

im just really not sure how to create and assign the map of those effects

last sleet
#

Hey, I have a question concerningarrow damage calculation :


    Multiply that by the arrows damage (defaults to 2) and then round it up (always) to the next integer.

    If it is a critical, add a random whole number between and including 0 and (previous amount/ 2 +1). (my understanding of critical in the context of arrows is the bow must be fully charged)

    Add enchantment damage.```
I found this, but I'm not sure it's relevant in 1.18.2 or above anymore, or what "arrow damage" is, is it always 2 ?
smoky oak
#

the effect arrows might have different values

last sleet
#

I heard magic damage gets added at the end or something, not affected by velocity

#

I'm trying to make my custom damage handling, but for arrows, I'll need to use velocity (as to not allow players to spam floppy, but damaging arrows)

smoky oak
#

cant u just print out arrow type and arrow damage to console and spam ur bow for 3 minutes

last sleet
#

(?)

#

arrow type is irrelevant

#

I'm trying to find out how the damage is calculated according to arrow momentum

#

or even, how and where that momentum comes from. Still sqrt(xmotion2 + ymotion2 + zmotion2)?

smoky oak
last sleet
#

ah, ok

smoky oak
#

see theres that thing called

#

?jd-s

undone axleBOT
last sleet
#

is momentum still multiplied by it?

last sleet
#

It's about how momentum modifies that damage value to output one that scales with speed

smoky oak
last sleet
#

I think I found it, google hid it well before the first page though. Weird that reddit posts about this come out before the mc wiki does

smoky oak
#

right blast chamber

#

i forgot about that

#

some people thought it fun to build a railgun

last sleet
#

just to be clear, blocks/tick (in z) is given by arrow.getVelocity().getZ

smoky oak
#

either tick or second

last sleet
#

it returns the block the arrow is in

#

oh nvm was looking at the wrong thing

#

thanks anyway ^^

remote swallow
#

in placeholder api?

onyx fjord
#

java.util.ConcurrentModificationException: null whats this shit

#

happens when i remove an item from a List

tardy delta
#

dont remove an item from a list when iterating over it

onyx fjord
#

i see

echo basalt
#

unless it's a concurrent list

torn shuttle
#

tfw I don't want to use bootstrap but I was using some stuff I liked from bootstrap

molten hearth
#

has anyone used MiniMessage? it seems that new lines are not uh working

#

they're not being displayed even though I added either empty components or used the correct tags

#

eg java MiniMessage mm = MiniMessage.miniMessage(); Component lore = mm.deserialize("<dark_gray>stuff</dark_gray><newline><br>"); lore.append(Component.empty()); lore = lore.append(mm.deserialize("<dark_gray>more stuff</dark_gray><newline><br>")); lore = lore.append(Component.empty()); not a single new line is displayed lol

remote swallow
#

is that even a link

#

a link?

#

a thing

molten hearth
#

huh

#

a link?

#

a tag?

remote swallow
#

is that actually a thing in mm

rotund ravine
#

@molten hearth Does it work in a chat message?

molten hearth
#

<newline> or <br>

remote swallow
#

either

molten hearth
#

hm let me see one sec

#

and yeah

#

<br> doenst render I saw it in the Kyori discord

#

newline is the kyori newline its broken

#

oh yeah

#

it works in chat

#

just not as a lore

#

wadafuc

remote swallow
#

jank

molten hearth
rotund ravine
#

Can the lore take a list?

#

Of components

molten hearth
#

no it only takes a component

rotund ravine
#

Go ask in the devs discord i guess

molten hearth
#

I did but its quite desolate

remote swallow
#

ask paper

#

they use minimessages

molten hearth
#

oh alright

#

ill go there too tx

remote swallow
#

i just remembered that they use minimessages by default so i would guess they know

#

oh yeah, does sqlite accept byte[] as a collumn, if it does is it just BYTE as the name in the statement

molten hearth
#

it turns out I got scammed and it does indeed accept List<Component>

#

now I dont understand why c.text(...).append(c.empty()).append(c.text(...)) works on the other hand but whatever

river oracle
#

have some mercy

#

the guy just doesn't wanna go to paper discord

#

can you blame him

#

๐Ÿ˜จ I'm just really scared of paper discord excuse my incompetence

#

I've been in there once man

remote swallow
river oracle
#

๐Ÿ’€

molten hearth
#

I wasn't using paper though

#

Nah

remote swallow
#

its its own lib

molten hearth
#

It is for many things my frien

torn shuttle
#

fren

remote swallow
#

just paper use it by default

#

and their reason is "minecraft are removing & colouring"

chrome beacon
#

ยง

torn shuttle
#

they can take away my amp-based coloring system from my cold, dead hands

remote swallow
remote swallow
chrome beacon
#

Components aren't that bad

remote swallow
#

i will stay however many versions behind

kind hatch
#

Annoying and unnecessarily lengthy.

torn shuttle
#

components are sort of annoying to deal with

#

honestly I probably have some of the most stupidly overcomplicated implementations of components

#

because I thought it would be cute to have book-based displays

#

that was a bad idea

kind hatch
#

I feel you.

remote swallow
#

icl minimessage Components are better than our components

#

easier to write

torn shuttle
#

I mean they look cool, just don't try to translate them, use a resource pack with a different font or use bedrock crossplay

#

or customize them in general

chrome beacon
#

MiniMessage takes care of everything

#

So it's not annoying to use

kind hatch
#

PR it into spigot then. ๐Ÿ’€

torn shuttle
#

pr paper into spigot, let's have a laugh

remote swallow
#

april fools

#

md accepts it

torn shuttle
#

april fools spigot is now paper and paper is now spigot

remote swallow
#

paper chan happens tho

#

but that would be cool

torn shuttle
#

what the hell are my neighbors doing

kind hatch
#

Nah, april fools would be md_5-chan.

torn shuttle
#

man I need to get a house

remote swallow
torn shuttle
#

people who claim high density apt blocks are the future can suck it

remote swallow
#

also did you all notice that md is now in christmas mode

torn shuttle
#

15 years in, can't wait to get out

kind hatch
smoky oak
#

u dont need spigot for that

remote swallow
#

we need the logo to become snow instead of water

smoky oak
#

the game has an christmas easteregg

austere gull
#

really?

kind hatch
remote swallow
#

thats better

smoky oak
austere gull
#

where to find it? I've been playing like for 4 hrs daily

smoky oak
#

its not active yet

#

iirc its the last 2 weeks of the given year

austere gull
#

ohh.. got it

copper scaffold
#

is it possible to get from the server console each line? that i can send it to a website?

smoky oak
#

look up remote shell

balmy valve
#

Anyone know how I could fix a problem similar to this one? https://www.spigotmc.org/threads/preparesmithingevent-custom-result.469769/
My custom result gets properly set but I cannot take out the result item from the smithing table.
The problem is that the recipes are generated dynamically so I cannot just register the recipes with bukkit.
Is there anyway I can fix it?

balmy valve
#

Anyone have any ideas?

fathom island
#

Hello, I do not find how to do with the API to give a goat horn by specifying the sound. Any ideas ?

ancient plank
#

Idk if there's API for that, at least I can't find anything for it. Might have to use nms

worldly ingot
#

There was a PR that didn't get merged

ancient plank
#

๐Ÿ˜ฉ a shame

fathom island
eternal night
#

PRs to spigot are not really public, you need an account and sign the CLA

balmy valve
fathom island
#

ho

misty ingot
#
    private boolean playerRegistered(UUID uuid) {
        AtomicReference<Boolean> isRegistered = new AtomicReference<>(false);
        plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
            try {
                PreparedStatement statement = plugin.getConnection()
                        .prepareStatement("SELECT * FROM cosmicbans_bans WHERE UUID = ?");
                statement.setString(1, uuid.toString());
                ResultSet results = statement.executeQuery();
                isRegistered.set(results.next());
            } catch (SQLException err) {
                err.printStackTrace();
            }
        });
        plugin.getLogger().info("Player registered: " + isRegistered.get());
        return isRegistered.get();
    }

even when there is a column for the user in the database, it returns false

#

it has been doing that since I made it asynchronous

#

was working perfectly fine before

lofty belfry
#

Flight toggle on sneak

remote swallow
#

that reminds me

#

i never checked if my cla got accepted

misty ingot
#

well I need it to be async

strong parcel
acoustic widget
#

Hello, anyway to integrate a search function in a GUI ? I would like something for search a player and refresh the list of players found when tiping ?

remote swallow
ancient plank
#

?jd-s

undone axleBOT
remote swallow
#

i dont remember what the wait time said was

balmy valve
acoustic widget
ancient plank
#

Creative inventory is client side

acoustic widget
#

ok ok ๐Ÿ˜ฆ

#

i'll cry thanks

ancient plank
#

I'd recommend using a chat message, since inventories are scuffed to work with, but like the other person said you can use things like books, anvils, etc

#

Though anvils have a char limit

#

Like 16 iirc

remote swallow
#

i thought that got changed to 50

tardy delta
ancient plank
#

Not a clue

misty ingot
balmy valve
#

Anyone know what packets are sent to the client for the main rendering when a player logs on or loads a new chunk?

tardy delta
undone axleBOT
tardy delta
#

it tries to deserialize it using reflection but its not smart enough to actually set some fields accessible or smth

strong parcel
tardy delta
#

looks like it doesnt if it throws that exception

#

wheres line 57 too

#

and why are you creating two gson objects on every method call

#

those objects are very costly so have it as a field

#

could you show the PlayerData class?

final monolith
#

BungeeCord:

Any event that is fired when the player quits the proxy? ive tried using ServerDisconnectEvent, but it fires when i switches a server too...

misty ingot
lavish wing
#

Guys,how can I change the plugin's code?Decompilation gives errors

#

Im trying to decompile CoreProtect 2.14.4

final monolith
#

look for the github

lavish wing
#

Most of the code is missing

final monolith
#

๐Ÿคทโ€โ™‚๏ธ

tardy delta
#

tf am i looking at

chrome beacon
final monolith
tardy delta
#

what

chrome beacon
chrome beacon
#

But why

lavish wing
#

It has only 20.1 an higher

final monolith
tardy delta
lavish wing
strong parcel
chrome beacon
#

Extra work comes with being on outdated versions

tardy delta
strong parcel
lavish wing
tardy delta
#

didnt ask that

chrome beacon
final monolith
tardy delta
#

?

chrome beacon
#

Or find the commits on the github page

strong parcel
tardy delta
#

bruh what a mess is this plugin

misty ingot
#
    private boolean playerRegistered(UUID uuid) {
        AtomicReference<Boolean> isRegistered = new AtomicReference<>(false);
        plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
            try {
                PreparedStatement statement = plugin.getConnection()
                        .prepareStatement("SELECT * FROM cosmicbans_bans WHERE UUID = ?");
                statement.setString(1, uuid.toString());
                ResultSet results = statement.executeQuery();
                isRegistered.set(results.next());
            } catch (SQLException err) {
                err.printStackTrace();
            }
        });
        // wait for async to finish
        while(isRegistered.get() == null) {}
        plugin.getLogger().info("Player registered: " + isRegistered.get());
        return isRegistered.get();
    }

it returns false even when the player is in the db

#

I am confused, very

tardy delta
#

i told you did you even listen

misty ingot
#

I asked how I would do the thing you told me to do

strong parcel
#

What do you want to know?

tardy delta
#

send TribeData

#

pfff

misty ingot
#

wat

remote swallow
#

fourteen be helping everyone in here

chrome beacon
tardy delta
smoky tinsel
#

how can i use Entity PLayer in 1.19.2?

tardy delta
#

or use callbacks

smoky tinsel
#

cant find any code about it

remote swallow
chrome beacon
misty ingot
tardy delta
remote swallow
#

?spoonfeed vibes

#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

tardy delta
#

if you dont, declare the field as transient, then gson will ignore it

smoky tinsel
#

i mean i cant inport EntityPlayer in 1.19.2

#

anymore

remote swallow
#

are you using spigot or spigot-api

smoky tinsel
#

i used to use EntityPLayer in 1.16.5

chrome beacon
smoky tinsel
#

but cant anymore

chrome beacon
undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

smoky tinsel
chrome beacon
#

Spigot api doesn't contain nms

remote swallow
#

you need to use spigot then

chrome beacon
#

It never has

smoky tinsel
#

ahhh

remote swallow
#

run buildtools

#

?bt

undone axleBOT
smoky tinsel
#

then what do i have to use?

chrome beacon
#

Spigot

smoky tinsel
#

what dependence

remote swallow
#

run build tools, remove the -api from the dep

tardy delta
smoky tinsel
#

spigor.jar?

remote swallow
strong parcel
#

JSON GSON Problem

chrome beacon
remote swallow
#

run buildtools, then import spigot not spigot-api

smoky tinsel
#

ok ill try

strong parcel
fresh timber
#

I am trying to make a trading system where you can trade with another player with the command /trade <player> and it will open a GUI and you can put the items you want to trade on the left side and the right side is always the other player's items and if you accept, both players get the items on the right side of their GUI which is the other player's offer and if you cancel, both players will get the items on the left side of their GUI. Both players must accept for the trade to be made but only 1 needs to cancel to cancel the trade. For an example, this will be like Hypixel Skyblock's trading system for items only. I have tried multiple things but I just cannot seem to get it to work. Does anyone have a good way to do this?

ancient plank
#

world's longest sentence

fresh timber
#

true

#

I am professional at run on sentences

chrome beacon
fresh timber
#

;-;

chrome beacon
#

Listen to the inventory close event to cancel the trade etc

fresh timber
#

thats what i tried to do

#

yea

#

it keeps doubling ppls items and like canceling when u put an item in the gui

tardy delta
chrome beacon
#
  1. Don't freeze main thread with a while loop
smoky tinsel
tardy delta
#

help is it transient final or final transient?

smoky tinsel
#

how can i download build tool

chrome beacon
undone axleBOT
ancient plank
#

right there

tardy delta
opaque sleet
misty ingot
# tardy delta use a CompletableFuture, which also removes the need for an AtomicRef 2: close y...
    private boolean playerRegistered(UUID uuid) {
        CompletableFuture<Boolean> future = new CompletableFuture<>();
        plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
            try {
                PreparedStatement statement = plugin.getConnection()
                        .prepareStatement("SELECT * FROM cosmicbans_bans WHERE UUID = ?");
                statement.setString(1, uuid.toString());
                ResultSet results = statement.executeQuery();
                future.complete(results.next());
                
                statement.close();
                results.close();
            } catch (SQLException err) {
                err.printStackTrace();
            }
        });
        // wait for async task to finish
        while(!future.isDone()) {}
        return future.join();
    }

something like this?

tardy delta
#

oh no no

chrome beacon
worldly ingot
#

Don't wait a future to be done. Return the future

remote swallow
opaque sleet
opaque sleet
#

i dont want them to be OP bc it kinda ruins the server

final monolith
#

BungeeCord:

Any event that is fired when the player quits the proxy? ive tried using ServerDisconnectEvent, but it fires when i switches a server too...

remote swallow
worldly ingot
# misty ingot huh

When you're working with a CompletableFuture, the entire point of it is that you don't know when it's going to complete, just that it will. You're meant to use the CompletableFuture<Boolean> as your return type.

#

You can then invoke methods on the result of it such as .thenAccept() or .whenComplete()

chrome beacon
worldly ingot
#

However if you're querying from a ban table, I don't know if your goal is to be doing this to check if a player is banned, but if you are... you should probably do this synchronously anyways but in the AsyncPlayerPreLoginEvent

smoky tinsel
#

Unable to access jarfile BuildTools.jar

#

this masage pop up when i type java -jar BuildTools.jar --rev 1.19.2 in to cmd

tardy delta
#

you can either do:

private void ifPlayerRegistered(UUID uuid, Runnable callback) {
  Bukkit.getScheduler().runTaskAsynchounously(plugin () -> {
  // will close connection and statement afterwards
    try (Connection conn = plugin.getConnection(); PreparedStatement ps = 
         conn.prepareStatement("SELECT * FROM cosmicbans WHERE uuid=?;")) {
      ps.setString(1, uuid.toString());
      if (ps.executeQuery().next()) { // the player is registered
        callback.run();
      }
    } catch (SQLException e) {
       e.printStackTrace();
    }
  });
}```
or 
```java
private CompletableFuture<Boolean> isPlayerRegistered(UUID uuid) {
  return CompletableFuture.supplyAsync(() -> {
    // same logic, return the boolean value
  });
}

isPlayerRegistered(someUUID).thenAccept(val -> { // this will run when the db call finished, not blocking the main thread
  if (val) { logger.info("got em"); } else { logger.log("nah"); }
})```
fluid river
#

use eyes

tardy delta
#

my finger hurts

#

@misty ingot ^^

misty ingot
#

thanks for the help, I will try them out

ancient plank
tardy delta
#

-> invest

remote swallow
#

-> sell
-> profit

misty ingot
#

@tardy delta if I just run the methods from inside AsyncPlayerPreLoginEvent, then they are already running async tho right

tardy delta
#

yep so no need to run async

#

thats what im doing too, loading playerdata in there

misty ingot
#

?paste

undone axleBOT
misty ingot
tardy delta
#

are you talking about whether to run it async?

misty ingot
#

no no

#

I have to run it async as its currently sync

tardy delta
#

i just have a class that does all db operations in sync and then i have a wrapper that uses the async stuff

misty ingot
#

that code is part of a command (/ban command)
basically bans the player in db

elfin atlas
#

Question does I'm able to set with the Crossbow meta the charged state?

misty ingot
#

I just wanna make the code run async thats all

tardy delta
#

wrap it using a a cf or bukkit scheduler or smth?

misty ingot
#

so just.. put the whole thing inside a scheduler and thats it?

worn perch
#

Unsupported API version while loading plugin

snow compass
#

Is strange how the recipe api is made. If you make an furnace recipe and use gold_ore (with custom metadata) it break the cocking time if you change it for the custom recipe.

I know if the player for example learn the recipe self it keep metadata on the recipe, but the api not allow you force same recipe to the client.

So seams you has to use nms or is it other way around it?

remote swallow
tardy delta
#

uhh that could work yes, i hope you wanna check if that db call actually succeeded

misty ingot
#

Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {}); ima just put the code inside this scheduler and hope it works

snow compass
#

I not get way the api not allow itemstacks as ingrediens (when minecraft own sorcecode seams to understand it).

peak depot
#

what to code my guys?

remote swallow
#

essentialsX recode

misty ingot
#

fuck it, lets make EssentialsY

#

because Y not

peak depot
#

whats the prob with the normal one?

misty ingot
#

the problem with the normal one is that its normal

remote swallow
#

yes

tardy delta
#

^^

#

and its codebase is a mess to look at

remote swallow
#

command classes called Commandlowercasecommandname

eternal oxide
#

its build system (gradle) is a nightmare

snow compass
remote swallow
tardy delta
#

i looked too much thro its code and now i regret

#

not

quiet ice
#

It's how it's being used that is the issue

eternal oxide
#

go import it into an IDE and see how many warning/errors you have

remote swallow
#

what the actual fuck is that

#

i just looked at their build.gradle

tardy delta
#

why does gradle have that many files in your project

#

build files, config files :/

remote swallow
#

settings.gradle being the only fucking kotlin file

tardy delta
#

lol

undone axleBOT
remote swallow
#

who can i kill for this

misty ingot
#

IT WORKS

#

THANK GOD IT WORKS

kind hatch
#

@wet breach You still trying to help me with that MySQL issue? ๐Ÿ‘‰ ๐Ÿ‘ˆ

chrome beacon
tardy delta
chrome beacon
#

Essentials but paid

tardy delta
#

concurrent modification ixception

rotund ravine
tardy delta
#

whats wrong with you

smoky tinsel
#

@EventHandler
public void testtest(PlayerInteractEntityEvent e)
{
Player p = e.getPlayer();
Entity en = e.getRightClicked();

    if(p.getItemInHand().getType() == Material.SHEARS)
    {
        if(p.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.GOLD + "kidnap"))
        {
            p.setPassenger(en);
        }
    }
}
#

why this does not work?

#

like villiger and horse,llama working but not for golem or rabbit

eternal oxide
#

it will not be ChatColor.GOLD on the item. It will have been parsed

smoky tinsel
#

no i have a item that have ChatColor.GOLD

remote swallow
smoky tinsel
#

but p.setPassenger(en) did not work

echo basalt
remote swallow
echo basalt
#

texture pack shenanigans

austere gull
#

Guys, i have a plugin which runs on 1.18 and I want it to run it on 1.19.3,
Does anyone know how to do it??

echo basalt
austere gull
#

No

remote swallow
#

doesnt need updating, should just work

echo basalt
#

basically the steps are:

  • try and see
  • fix issues
  • repeat
austere gull
remote swallow
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

austere gull
#

The server just crashes without any error

#

idk how

remote swallow
#

there would be an error somewhere in logs

eternal oxide
#

then it won;t work on 1.18 either

austere gull
#

Let me try again then

river oracle
sterile token
#

Who tagg me?

#

oh i didnt say anything i just seen it - MY bad

sterile token
river oracle
#

lol

#

wanna look

sterile token
#

oh yeah please

#

I need ideas tho

worn tundra
#

Even hid the player inventory like Mcc Island

echo basalt
#

all linked together under the same page

river oracle
#

yea isn't that just a list

echo basalt
#

I mean

#

not really

#

you can do 1-2-3-1-2-3 but it just looks stupid

worn tundra
#

Make it a component and follow OOP ๐Ÿ˜

echo basalt
worn tundra
#

PaginatedComponent with slots

echo basalt
#

code looks a bit long but it should be understandable

echo basalt
#

make a selection :)

worn tundra
#

Yeah that

#

But still based on slots

echo basalt
#

a selection is just a wrapper for a List<Integer> slots

#

you can make a MultiSelection which just merges multiple selections, useful for weird shapes

#

shapes and hollow shapes for stuff like borders n all

worn tundra
#

๐Ÿ˜ญ

echo basalt
#

is that some widespread engine?

#

I just made this over like 2 hours

worn tundra
#

Was looking for a gui thing thatd support resource packed menus

#

Wym widespread engine

echo basalt
#

popular / open-source

gray drum
#

Hello, I'm developing a Spigot plugin, where I'd like a connection to a MongoDB database (I was following along this guide: https://www.spigotmc.org/wiki/using-mongodb/#using-the-mongodb-driver-in-your-server). The JAR file build and stuff are fine, only when I put it in my server's plugins folder, it gave me an error:
java.lang.NoClassDefFoundError: com/mongodb/MongoException

I already did my own research and clicked on every link I could, here are some things I've tried:

  • Changing the startup command to java -classpath "server.jar;lib/*" org.bukkit.craftbukkit.Main
    * Gave me an error,
       Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.Main```
- Changing `java -classpath "server.jar;lib/*" -jar server.jar`
       * Gave the same error as error #1
- Tried shading the driver in but failed, as the shading plugin wasn't working for me...

I've tried a few more things, but those ones failed as well. So now I'm kinda stuck and I don't know what to do. If you could help me I'd greatly appreciate that.
echo basalt
#

I can also just do something a lot more basic type deal

sour tundra
worn tundra
#

But honestly should be

#

Also made it in like a few hours

gray drum
sour tundra
gray drum
#

Yes the JAR file is on the classpath

sour tundra
#

maybe manifest

#

Manifest-Version: 1.0
Class-Path: lib/* mongo-driver.jar

gray drum
#

Let me try that

echo basalt
#
BaseMenu menu = new BaseMenu(player.getUniqueId(), Component.text("Test"), 6);
BaseLayer layer = new BaseLayer(menu);

menu.addRenderable(layer);

Button button = new Button(new ItemStack(Material.DIRT), (event) -> {
  event.getWhoClicked().sendMessage("you clicked on the dirt. are you proud?");
});

layer.applySelection(SlotSelection.of(12, 13, 14), button);

menu.forceUpdate();
menu.open();
gray drum
sour tundra
#

well then

worn tundra
#

Does it support visual components though

echo basalt
#

aren't those just inventory titles?

worn tundra
#

Yyp

#

Yup

echo basalt
#

you can change titles on the fly

worn tundra
#

Yeah but having components to manage that is much cooler

echo basalt
#

and just make a patternmask selection

#

I mean

worn tundra
#
  • can calculate the offsets easier
#

Compiling the title

echo basalt
#

I have elements that are a lot more complex than buttons if you want htose

#

like MultiSwitch and all

worn tundra
#

What do those do

#

Do you have buttons with the visual that can change on press

#

;D

echo basalt
#

Uh ye

worn tundra
#

Did you make it specifically to be used w resource packs or?

echo basalt
#

I made this specifically to be a menu engine

#

not some willy wonka stuff

worn tundra
#

Nicee

#

Closed source?

echo basalt
#

if I want to make a 2d game, I can do so

#

yeah for now

worn tundra
#

Got it

rare gorge
#

Hello, i have a event handler antiFortification(PlayerInteractEvent e) that works for ops only for some reason. How do i make it work for all players?

serene sigil
#

hi, i made a compass that tracks a player... i made it constantly update the itemmeta but the item always goes up and down in the hand... is there a way to solve this?

rotund ravine
rare gorge
# rotund ravine give code and we'll tell you.
public class RightClickBlock implements Listener {
    @EventHandler
    public void antiFortification(PlayerInteractEvent e) {
        Player p = e.getPlayer();
        log.info("8");
        //only handle right click
        if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;

There is no 8 or 7 showing up in terminal

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
}
rare gorge
#

i dont think that is for my usage

#

im handling clicks on blocks, not every interaction of a player (i think)

untold jewel
#

Any ideas for a cool plugin?

#

I'm bored

serene sigil
rare gorge
#

my main class

public class MyPlugin extends JavaPlugin {
  public static Logger log = Bukkit.getLogger();
  @Override
  public void onEnable() {
    ...
    //register event
    getServer().getPluginManager().registerEvents(new RightClickBlock(), this);
    ...
  }
#

right clicking with your main hand on a block calls the event

#

wtf i am left clicking and its working

remote swallow
#

?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
}
remote swallow
#

you need to check the hand

rare gorge
#

onPlayerInteract and antiFortification can only handle left clicks for non ops for some reason

turns out, the freaking spawn protection in server.properties was messing it up

serene sigil
#

is there an event that calls when u lodestone a compass?

worn tundra
#

PlayerInteractEvent probs

serene sigil
#

ye i took that

cold field
#

Hi guys, what is the common way to handle registration of events that doesn't exists in older versions of spigot?

sullen marlin
#

try catch?

eternal oxide
#

if they don;t exist they will be ignored

cold field
#

lol, I was expecting smth more complicated. But i guess that's works too

eternal oxide
#

you register a listener not the events

worldly ingot
#

You'll get a missing class exception though ;p

eternal oxide
#

oh imports

worldly ingot
#

Imports don't exist at runtime, but the server won't know that the class exists as a method parameter

sterile token
#

Recommend spigot command frameworks

copper scaffold
#

what is the best api for http request?

jade perch
#

the built in one

worldly ingot
#

Java 11's HttpClient API is great

zealous scroll
#

Does anyone know why when I add a regeneration potion effect to a player, my client has the effect and my hearts show the regeneration animation, but my health doesn't actually go up?

Might it have to do with the fact that I apply the effect every 4 ticks for 20 ticks duration?

            if (currentTick % 4 == 0L) { // Every 4 ticks we give people regeneration
                val entities = LocationUtils.getEntitiesInCircle(totemLocation, RADIUS) // This also includes the totem
                entities.keys.filterIsInstance<LivingEntity>().filter { it in owner.team }.forEach {
                    // TODO: maybe find a better way to handle potion effects ?
                    // We give them regeneration
                    it.addPotionEffect(PotionEffectType.REGENERATION.createEffect(20, 1))
                }
            }
fluid river
#

?chatevent

#

๐Ÿ˜ญ

jade perch
#

which is like 50 ticks

lavish wing
#

Hey guys how i can use BukkitScheduler in bukkit beta 1.7.3?
runTaskLater doesn't exist in this version

scheduler.runTaskLater(auth.getInstance(), () -> {
            
        }, 3L);
tacit night
#

Can i randomize an Integer[] {} with numbers in it?

jade perch
lavish wing
copper scaffold
jade perch
copper scaffold
#

ah okay thx

lavish wing
#

?md-5

worldly ingot
#

bukkit beta 1.7.3
jesus

lavish wing
#

Its Infdev 20100618

#

But api like beta 1.7.3

worldly ingot
#

Or be sane and just use a for loop to skip the Stream all together, but really it's up to you

jade perch
#

auth.getInstance is null

lavish wing
#
    public static auth getInstance() {
        return auth.instance;
    }```
jade perch
#

It's still not defined

lavish wing
#

?

jade perch
#

auth.getInstance() still returns null. You haven't given your private auth variable a value

lavish wing
#

Oh

#

thx

#

im forgot add auth.instance = this;

warm mica
lavish wing
wet breach
#

just woke up not long ago. Today is my day off ๐Ÿ™‚

golden turret
#

Hi, I am trying to create a custom font to create custom guis but when I try to set the image file to something like 300 the character becomes invalid

#

How can I fix that

tacit night
#

How can i add items from all entrys out of an enum via an for?

jade perch
tacit night
#

yeah thx i found it at this time ๐Ÿ˜‚

#

im really dumb at this time

wary topaz
#

how would I print a 'รก ' to my console? it keeps sending รŸ

vast kelp
last sleet
#

is there a way of getting tipped arrow potion type when I've got an entity instance of the arrow?

worldly ingot
#

Arrow#getBasePotionData()

last sleet
#

Does it also include potion potency?

#

I checked with arrow.getPotionEffects too, but that doesn't seem to work

jade perch
#

it has isUpgraded

last sleet
#

ah thanks

wary topaz
#

Error line 87*

#

line 88 is referring to line 64

desert loom
#

Cannot invoke "BetterServer.util.LanguageUtil.getMessage(String)" because "this.e" is null

#

you don't initialize LanguageUtil e;

wary topaz
#

What should I initalize it to?

sterile token
#

What does it do?

wary topaz
#

It gets the messages in message.properties

#

but that code is not useful

sterile token
#

You have to initialize your LanguageUtil in the on enable method

#

I would suggest adding modifiers to your fields and also to read about java conventions

wary topaz
#

alr

sterile token
#

Because how do you relationate the LanguageUtil with a letter "e" ?

#

So you can read java conventions from here

#

?conventions

wary topaz
#

public void getMessage(String e) {

desert loom
#

e is not very descriptive.

wary topaz
#

well i got a good reason for that though, yk how people use evnt instead of event?

quaint mantle
#

Ive searched up every way to make an HTTP Post and cant figure it out, im trying to do it for tebex.
Any ideas how id do this?

sterile token
sterile token
#

With that you should be done if need something else, you can either ask here or on tebex discord

quaint mantle
#

alr

tribal wraith
#

how do you set a player's PermissibleBase?

wary topaz
#

I'm trying to

    public void getMessage(String e, CommandSender p) {
        if (p != null) {
            switch (this.getConfig().getString("Language")) {
                case "en" -> {
                    InputStream langfile = this.getResource("messages.properties");
                    Properties lang = new Properties();
                    try {
                        lang.load(langfile);
                    } catch (IOException ex) {
                        throw new RuntimeException(ex);
                    }
                    p.sendMessage(lang.get(ChatColor.translateAlternateColorCodes('&', e)).toString());
                }
               

            }
        }
    }


But it's returning:
[23:56:23] [Server thread/INFO]: &4&lThis command is currently disabled, if you wish to override this command you are free to do.

#

the problom is its not translating to color

gleaming grove
#

How can I get rig of this banner stuff from Itemstack description?

wary topaz
#

clear the meta

gleaming grove
#

I need meta for Banner pattern

river oracle
#

Some item flag

#

Prob hide attributes

gleaming grove
#

What m'I doing wrong?

#

nvm, this way works

solemn frigate
#

anyone know when player head images in tablist were added to minecraft/spigot?

sterile token
#

Good evening, I am designing my auto complete system for my command framework that I am making. And I would like to achieve that you can make it as you see in the example. Where index, would be the index of the argument to which the completions would have to be applied. And completations would be the list of completions that will be suggested with the corresponding index. And was looking to hear different ways for making this designed or others

public class TestCommand extends Command {

  public TestCommand() {
    super(stuff here);
    getCompleter().register(index, completations);
    getCompleter().register(0, List.of("Alex", "Clue", "Ethan")); // Example for making user names suggestions
  }  

}
grand sphinx
#

nvm

remote swallow
misty ingot
#

whats the most efficient way to store entire inventories into a database?
I am trying to make a player vaults plugin and am having issues storing all the item data efficiently (enchantments, name, nbt tags, amount)

gray drum
onyx fjord
#

Hey, how could I make an entity passenger of another entity?

kind hatch
#

Dismount it from it's current entity and then remount it to the new one.

serene sigil
#

hi, is there a way to hide the join message only for the player that joined?

misty ingot
#

hey is there a way that say a player has vaults.5 vaults.10 and vaults.20 permission nodes, then I get the maximum one (vaults.20) and then put 20 as the value of a variable?
all I can think of is to just put if conditions for every number but even that would just catch the lowest one

kind hatch
serene sigil
#

but idk

remote swallow
#

you can just set the join message to null on the event

kind hatch
remote swallow
#

isnt that what they want

kind hatch
#

No, they want to not see their join message when they join, but they want everyone else to see it.

remote swallow
#

ah, yeah you would set the message to null and loop over online players

crisp forum
#

Which is the true way to show usage?

/give [user] [item] <amount>
/give <user> <item> [amount]
#

user and item are required and amount is optional

misty ingot
#

2nd one

jagged monolith
#

2nd one looks better.

#

I usually use <> for required and [] for optional

summer scroll
#

I usually use
<> for multiple arguments
() for required
[] for optional

glossy venture
#

convention is <> for required, [] for optional and seperate options with |

#

i think

misty ingot
#

^^

summer scroll
#

Is there any verified source on that? I'd like to change it If that's the convention.

misty ingot
#

the source is that every one uses that format

molten hearth
#

Option-arguments are shown separated from their options by <blank> characters, except when the option-argument is enclosed in the '[' and ']' notation to indicate that it is optional.

#

Arguments separated by the '|' ( <vertical-line>) bar notation are mutually-exclusive.

quiet ice
#

One of my other plugins uses <XYZ> for required, <?XYZ> for optional and <XYZ/ABC> for mutually exclusive

molten hearth
#

I think using a ? makes sense too

quiet ice
#

That being said I didn't write that part and it probably dates all the way back to 1.8 days

summer scroll
quiet ice
#

() is a rather rare form I'd say

molten hearth
#

I dont recall having seen () very often

summer scroll
#

Fair enough

quiet ice
#

Looking at the /help screen of the current game I'm running the running scheme seems to be [<XYZ>] for optional arguments, <XYZ> for required and (ABC|DEF|XYZ) for list of options

misty ingot
#

the most widely used is [] and <> but people do use the other stuff

molten hearth
#

{} ๐Ÿ˜ˆ

misty ingot
#

ok thats just evil

molten hearth
#

/kick {uuid}-^player^ /reason/

misty ingot
#

why even bother anymore

#

might aswell write the whole thing down

molten hearth
#

true

#

I should probably put a dash in there

#

there we go

misty ingot
#

/kick REQUIREDuuidREQUIRED OPTIONALplayerOPTIONAL WHYEVENCAREreasonWHYEVENCARE

molten hearth
#

LOL

misty ingot
#

at that point, just use that format

quiet ice
#

Syntax is: /claims %s set global|<group> <action> <person> allow|deny is another format I use. This time made by me

#

<> being non-literal and when it is absent it is an literal argument

#

And that format has no optional arguments, instead different syntax layouts are used for each variations of including non-optional and optional arguments

vivid skiff
#

How can i place a spruce sampling with id 1?

quiet ice
vivid skiff
#

1.12.2

molten hearth
#

?di

undone axleBOT
molten hearth
#

how bad is it to use a singleton

#

its either that or pass this dependency through like 10 classes down

quiet ice
#

My opinion?

molten hearth
#

yeah

quiet ice
#

Most of these guidelines are absolutely stupid

molten hearth
#

fair enough

#

I dont see the downside to using singletons except funni conventions but I feel like breaking a convention if it makes it more readable is better

quiet ice
#

If the people that follow them to the letter would see my code they would perish instantly. But really it is easier to have a flat hierarchy than a a very deep one

molten hearth
#

I dont want to do constructor(Required req) -> constructor(Required req) -> -> constructor(Required req) -> -> -> constructor(Required req) -> -> -> -> constructor(Required req) -> -> -> -> -> constructor(Required req) -> -> -> -> -> -> constructor(Required req) -> -> -> -> -> -> -> Ahh finally I can use req only had to add it to like 10 constructors

tardy delta
#

looks like smth copilot would do

serene sigil
#

is there an event that fires when u open another page of a book?

#

or is it client side?

quiet ice
#

most likely clientside

serene sigil
#

๐Ÿ’€

quiet ice
#

As the book's NBT contains the entire text of the book

serene sigil
#

but is it 100% client side or might there be an event?

quiet ice
#

it is 100% clientside

serene sigil
#

bruh

molten hearth
#

alright update: I love the singleton pattern I must stay focused and never use it again it quite simply just seems too glorious to me

quiet ice
serene sigil
#

ye true actually

#

i wanted to play a sound effect whenever u flipped a page

spiral light
#

Hmm i need someones opinion... i am planning to add a PrepareGrindstoneEvent ... like the PrepareAnvilEvent .... but wouldn't it be better to have a super Event like PrepareItemResultEvent or smth like that ?

smoky oak
#

u probs should do both and have the prepareitemresultevent as a interface, but im not sure if that would plaz nice with the prepareanvilevent

#

*play

#

damn german keyboards

spiral light
spiral light
#

probably better name would be PrepareInventoryResultEvent or just PrepareResultEvent

smoky oak
#

last one sounds too ambiguous imo

remote swallow
#

PrepareWorkStationItemEvent

smoky oak
#

but otherwise it sounds fine. I just couldnt be bothered to check the dependency chain on anvilevent

#

ah or that

spiral light
#

is an anvil also a workstation ?

remote swallow
#

yes and no

#

depends who you ask

spiral light
#

villagers would say no xD

remote swallow
#

yeah

#

PrepareFunction(al)BlockItemEvent?

spiral light
#

hmmm seems a bit long ... but i think "PrepareInventoryResultEvent" is good too ?

remote swallow
#

yeah that probably works

tardy delta
#

this is worse than java

remote swallow
#

stair cases are great

#

i love them

spiral light
#

they help you to go up and down ^^

remote swallow
#

yeah

tardy delta
#

the reason i hate webdev

#

too much divs and nested elements

molten hearth
#

thats the reason its amazing

tardy delta
#

\๐Ÿ’€

molten hearth
#

I enjoy being able to write huge files without having to split it up and write broken html with it still workign

smoky oak
#

uuuuh

#

yall aware that we write javadoc in html right?

tardy delta
#

\๐Ÿ˜ณ

smoky oak
#

also JPanel can be used like a webbrowser - that is to display html as a 'webpage'

molten hearth
#

this seems very legit

#

is there any property a block can have for it to be pass-through

sonic goblet
#

cya

onyx fjord
#

how can i tell entity where to go? (just like pigs with carrot on stick)

tardy delta
#

pathfind goals?

serene sigil
#

how do you make clickable text (that runs a command) in a written book?

misty ingot
#

hey is there a way that say a player has vaults.5 vaults.10 and vaults.20 permission nodes, then I get the maximum one (vaults.20) and then put 20 as the value of a variable?
all I can think of is to just put if conditions for every number but even that would just catch the lowest one

misty ingot
misty ingot
neat jetty
#

which one is better for class name - TeleportRunnable or TeleportationRunnable?

tardy delta
#

TeleportTask

ivory sleet
#

what is the intention of the class?

worn tundra
molten hearth
#

so im trying with an armor stand but it seems if I set the meta to visible and the armor stand to invisible its still fully invisible

golden turret
smoky tinsel
#

how can i detect bow pulling maximum

eternal oxide
#

you can get teh players effective permissions and search for all that startwith vault.

jade perch
#

You need to make sure your plugin loads after placeholderapi

hushed pawn
#

i have PacketType.Play.Server.ENTITY_VELOCITY packet,
i can do .getPacket()
how can i get velocity values from it?

jade perch
#

max value is 1 which would mean they pulled it all the way back

neat jetty
jade perch
hushed pawn
#

this is PacketContainer

jade perch
quaint mantle
#

Any way to fix this?

maven-shade-plugin has detected that some class files are
present in two or more JARs.
#

All I did was add this to my pom.

<dependency>
  <groupId>net.dv8tion</groupId>
  <artifactId>JDA</artifactId>
  <version>5.0.0-beta.2</version>
</dependency>
#

Here is what im running to cause this:

package shade:shade
remote swallow
#

run mvn clean package instead

hazy parrot
#

Also that should be just warning, but you can always exclude conflicting dependencies

quaint mantle
# remote swallow run `mvn clean package` instead
  - META-INF/MANIFEST.MF
jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar, kotlin-stdlib-1.4.10.jar define 1 overlapping classes: 
  - META-INF.versions.9.module-info
jackson-annotations-2.14.1.jar, jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource: 
  - META-INF/LICENSE
jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource: 
  - META-INF/NOTICE
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
#

it fixes most of it EXCEPT manifests

faint sedge
#

Hey, i'm using vscode and i was wondering if there was any way to make my extracted .jar land directly in the plugins folder ?

delicate lynx
#

how are you packaging the jar

jade perch
#

Any way you would implement that would be more complex than simply moving the jar file

smoky tinsel
#

how can i detect that entity have metadata

quaint mantle
#

but epic suggested clean package instead

jade perch
smoky tinsel
#

um

#

if (e.getDamager().getMetadata("arme") != null)

#

like this

hazy parrot
hazy parrot
smoky tinsel
#

i want to summon lightning when damaget's metadata is arme

jade perch
#

Do you mean their name?

ornate mantle
#

whats that website where you can find different names for mojang/spigot mappings

delicate lynx
ornate mantle
#

i love you

smoky tinsel
jade perch
smoky tinsel
#

so i set metadata of arrow to arme when player shot bow with maxed pull

quaint mantle
#

so noone has a solution to this i assume then

smoky tinsel
#

and want to summon lightning when player got hit by arrow that has arme metadata

jade perch
#

What did you store the metadata as?

worldly ingot
#

You can ignore that message, Herobrine

#

It shows up rather frequently when you're working with Shade but it's mostly harmless in a plugin

quaint mantle
#
<dependency>
      <groupId>net.dv8tion</groupId>
      <artifactId>JDA</artifactId>
     <version>5.0.0-beta.2</version>
</dependency>
#

Doesnt seem I can access this whatsoever

jade perch
#

That's cool

worldly ingot
#

If you could, please. I pasted that dependency into one of my projects and was able to access everything fine

quaint mantle
#

File doesnt appear either.

#

This is what I was running to generate my jar file, do I need to run something else?

package shade:shade clean
worldly ingot
#

just clean package should suffice. The shade stage already runs by default when you package

remote swallow
#

^^

#

is placeholder api in ur depends in plugin.yml

quaint mantle
#

Nope.

#

Doesnt create it either.

#

Ill send my pom

worldly ingot
quaint mantle
worldly ingot
#

I really should make it an alias or something

jade perch
worldly ingot
#

ew no

remote swallow
#

is jda on maven central?

#

i thought they have their on repo

worldly ingot
#

It's on central, yeah

remote swallow
#

you learn something new every day

#

ive got 1 question, why is your source + target 11 in compiler plugin but 8 in properties

jade perch
#

idk

quaint mantle
#

nope

remote swallow
#

what error(s) do you get

quaint mantle
#
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] JDA-5.0.0-beta.2.jar, ServerPlugin-1.0-SNAPSHOT.jar, annotations-13.0.jar, commons-collections4-4.4.jar, jackson-annotations-2.14.1.jar, jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar, jna-4.4.0.jar, kotlin-stdlib-1.4.10.jar, kotlin-stdlib-common-1.4.0.jar, nv-websocket-client-2.14.jar, okhttp-4.9.3.jar, okio-2.8.0.jar, opus-java-1.1.1.jar, opus-java-api-1.1.1.jar, opus-java-natives-1.1.1.jar, slf4j-api-1.7.36.jar, trove4j-3.0.3.jar define 1 overlapping resource: 
[WARNING]   - META-INF/MANIFEST.MF
[WARNING] jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar, kotlin-stdlib-1.4.10.jar define 1 overlapping classes: 
[WARNING]   - META-INF.versions.9.module-info
[WARNING] jackson-annotations-2.14.1.jar, jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource: 
[WARNING]   - META-INF/LICENSE
[WARNING] jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource: 
[WARNING]   - META-INF/NOTICE
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
#

Only warning

remote swallow
#

add it to ur plugin.yml

jade perch
#

using depends in your plugin.yml they literally just said it lmao

quaint mantle
remote swallow
#

you can ignore it then

small current
#

how can i show image on a map

#

in 1.8.8

quaint mantle
#

wait no

#

it didnt add it

small current
#

i have the BufferedImage

remote swallow
quaint mantle
remote swallow
quaint mantle
remote swallow
#

do you see an M near the top right

#

on a popup

quaint mantle
#

yep

#

clicked it

#

opened a menu

remote swallow
#

not on the sidebar

#

actually on your code

quaint mantle
#

wait no i found a button called reload all maven projects

remote swallow
#

go onto the maven tab on the right, press the reload icon then

quaint mantle
#

it worked

#

ty

gaunt haven
#

How can I display skript variables on holograms(Holographic Displays)?

remote swallow
#

ask skript

gaunt haven
#

๐Ÿ‘

remote swallow
small current
#

how can i show image on a map
in 1.8.8

remote swallow
#

i doubt many people here would know

small current
#

there is no setMapView in 1.8

frank kettle
#

Hey, I'm trying to reward a player upon destroying crops but the event "BlockDropItemEvent" is not being helpful on that.

Example: destroys crop and drops 4 potatoes, but the event for some reason is only showing 1 potato on the ItemStack.
(Image attached below)

Code:

if (block.getType() == Material.POTATOES) {
    player.sendMessage("" + e.getItems());
    for (Item i : e.getItems()) {
        ItemStack ii = i.getItemStack();
        player.sendMessage("" + ii);
        if (i.getItemStack().getType() == Material.POTATO) {
            harvestingXp = i.getItemStack().getAmount() * 12;
            break;
        }
    }
}```
#

how to fix this to return the actual amount dropped by the crop?

#

ok nvm

#

for some reason it drops 2 itemstacks, 1st with the actual 1x drop, the 2nd with the rest(rng involved)

jade perch
# small current there is no setMapView in 1.8
MapView map = Bukkit.createMap(/* world */ null);
        map.addRenderer(new MapRenderer() {
            @Override
            public void render(MapView map, MapCanvas canvas, Player player) {
                canvas.drawImage(MapPalette.imageToBytes(/*bufferedImage*/));
            }
        });

        player.getInventory().addItem(new ItemStack(Material.MAP, 1, map.getId()));
#

I didn't test it at all

small current
#

thx

#

so will this work

jade perch
#

Try it and see

small current
jade perch
#

Beautiful

small current
#

yes indeed

#

will this only work in 1.8?

#

the code you sent

jade perch
#

Idk I didn't test it

small current
#

cause im testing it in 1.17

#

i want it to support 1.8

remote swallow
#

why would you want to support them

small current
#

you are not gonna talk me out of supporting it for 1.8

remote swallow
#

its old

#

boom

#

amazing reason

jade perch
#

Gonna have to use like XMaterial or something

small current
#

oooh

#

i got it nvm

jade perch
remote swallow
#

what server version do you use for testing most stuff

jade perch
#

I have a 1.8 server and a 1.19 server

small current
#

ok stop

remote swallow
#

ive got a 1.17.1, 1.18.2, 1.19 and 1.19.2 but i test most of my stuff on 1.19 for some reason

#

that reminds me

#

i need to get a 1.19.3 server

ionic dagger
#
    @EventHandler
    public void onDamage(EntityDamageByEntityEvent e) {
        if (e.getEntity() instanceof Player) {
            Player player = (Player) e.getEntity();
            if (e.getDamage() >= player.getHealth()) {
                if (e.getCause().equals(EntityDamageEvent.DamageCause.ENTITY_ATTACK)) {
                    if (e.getDamager() instanceof Skeleton) {
                        Bukkit.broadcastMessage(player.getName() + " was goinked by a skeletons arrow!");
                    } else {
                        Bukkit.broadcastMessage("Cause: " + e.getCause() + " | Damager: " + e.getDamager().getType());
                    }
                }
            }
        }
    }
#

could someone help me out and explain why getting killed by a skeletons arrow produces neither of these results?

remote swallow
#

iirc if the arrow damages you, it registers an arrow or projective one of them as the damager not skele

jade perch
#

Yeah the damage cause would be projectile

ionic dagger
#

so

#
    @EventHandler
    public void onDamage(EntityDamageByEntityEvent e) {
        if (e.getEntity() instanceof Player) {
            Player player = (Player) e.getEntity();
            if (e.getDamage() >= player.getHealth()) {
                if (e.getCause().equals(EntityDamageEvent.DamageCause.PROJECTILE)) {
                    if (e.getDamager() instanceof Skeleton) {
                        Bukkit.broadcastMessage(player.getName() + " was goinked by a skeletons arrow!");
                    } else {
                        Bukkit.broadcastMessage("Cause: " + e.getCause() + " | Damager: " + e.getDamager().getType());
                    }
                }
            }
        }
    }
#

would work

jade perch
#

The damager would be an arrow

#

you need to get the shooter of the arrow

ionic dagger
#

how would i do that

#

i dont see a get shooter

jade perch
#
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
    if (e.getEntity() instanceof Player) {
        Player player = (Player) e.getEntity();
        if (e.getDamage() >= player.getHealth()) {
            if (e.getCause().equals(EntityDamageEvent.DamageCause.PROJECTILE)) {
                // Get the Arrow entity that dealt the damage
                Arrow arrow = (Arrow) e.getDamager();
                // Get the LivingEntity that shot the arrow
                LivingEntity shooter = arrow.getShooter();
                if (shooter instanceof Skeleton) {
                    Bukkit.broadcastMessage(player.getName() + " was goinked by a skeletons arrow!");
                } else {
                    Bukkit.broadcastMessage("Cause: " + e.getCause() + " | Damager: " + shooter.getType());
                }
            }
        }
    }
}
#

Might need to add some type checking to make sure or you'll get exceptions

#

like the projectile might not always be an arrow

jade perch
#

and getShooter might be null if it wasn't shot by a living entity

quiet ice
jade perch
# sterile token And what means `%s` ?

It's short for 'string', which is a fancy way of saying 'a bunch of letters and numbers that make up a word or phrase'. So if you see %s in some code, just think 'Hey, this is where I put a word or phrase' and you'll be good to go!"

fossil lily
#

?paste

undone axleBOT
ionic dagger
#

I see

#

Yea bc if itโ€™s from a dispenser or something

ionic dagger
#

How would I check if itโ€™s been shot by a dispenser?

#

Since the dispenser is a material right?

jade perch
#

I would imagine it would always be a dispenser if getShooter is null

#

I can't think of another not living entity that shoots an arrow

ionic dagger
#

But how would I check that

#

Is it some long process

remote swallow
#

how do you check if something is null or not null normally

jade perch
#

Make and if statement checking if (shooter == null)

#

if that's true you can assume it's a dispenser

#

Actually it looks like getShooter returns a ProjectileSource so you can probably just check if it's an instanceof Dispenser

quiet ice
#

getShooter can also return null spontaneously from my testing

quaint mantle
#

Hey there, I tried creating an addon for a plugin called Ultra Customizer and it gives me this error while building:

https://cdn.zetax.dev/XLZ8eBKuLC24

Does anyone know how to fix that? I added Spigot and the Plugin as a module, so it should work, right?

chrome beacon
quaint mantle
remote swallow
#

use maven or gradle

quaint mantle
#

How would I set that up

remote swallow
quiet ice
#

Pft, that is the looser's way

quaint mantle
#

I'll try that ๐Ÿ‘

quiet ice
#

?bundler being the cause

#

smh my head

remote swallow
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

quiet ice
#

Yeah that is it

quaint mantle
#

I'll read through it :D

torn badge
#

Anyone have an idea how I can make villagers accept items regarless of their display name and lore?

#

Or ItemMeta in general

jade perch
#

Not easily

#

Probably would have to do something hacky

torn badge
#

Thatโ€™s what I thought

#

I could remove the meta when itโ€™s placed in the slot and then re-add it when itโ€™s taken out

young shell
#

Was Tag.NON_FLAMMABLE_WOOD removed or just renamed?

jade perch
#

removed

young shell
#

Why

jade perch
#

mc removed it

quaint mantle
remote swallow
#

are you running gradlew build

quaint mantle
#

I just tried the intellij build button on the top right and the Tasks > build > build task so far

remote swallow
#

press control twice then type gradlew build

quaint mantle
#

Done

remote swallow
#

that will build it

quaint mantle
#

File didnt update and nothing new appeared afaik

remote swallow
#

where are you checking

#

it also wont rebuild it without changes from what i remember

quaint mantle
remote swallow
#

build/libs is teh right place

quaint mantle
remote swallow
#

?paste ur build.gradle

undone axleBOT
quaint mantle
#

Just restarted explorer and now it shows the right file? Not sure why but it does now, but the addon.yml is still not there

remote swallow
#

use the spigot repo and the api you are trying to hook into's repo

#

implementing files should be a very last resort method

quaint mantle
#

You mean use github repos as dependencies? Or is repo some java word I don't know

#

Sorry if it sounds dumb

remote swallow
#

repo = repository, most apis/libs have their own repository that you can add to not need to impl files

#

whats the ucus api name?

young shell
#

Repos are a collection of many artifacts that can be loaded with build tools

quaint mantle
#

I only have access to the UltraCustomizer jar, not any repo, at least as far as I know of as it's a paid plugin

remote swallow
#

they would probably have an api somewhere online

quaint mantle
#

https://ultracustomizer.com/wiki/api that's the wiki for it

Ultra Customizer

Ultra Customizer is the ultimate Styling Solution to make your Server Unique. You can easily create your own GUIโ€™s, Commands and Scripts with an incredibly simple GUI based editor. Additionally you can edit any message on your Server with just a few clicks to make your Server feel 100% unique.

remote swallow
#

that is a weird plugin if it doesnt have an api on a repo

quaint mantle
#

They told me to add the jar as dependency

quiet ice
#

The fewest plugins have their API on a repo

#

But to advertise the API and not mark the maven repo? That is rarer

remote swallow
#

but change your build.gradle to

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
    compileOnly 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT'
    implementation files('libs/ucus.jar')
}

test {
    useJUnitPlatform()
}
quaint mantle
#

๐Ÿ‘

remote swallow
river hearth
#

I'm looking for a way in the spigot api to figure out if a block is dependent on another block? For example, torches and signs require the block they are placed on, which can be to the side or below, and redstone wire requires the block below

quaint mantle
#

The build works great now! Thank you very much

river hearth
simple silo
#

How would I process a list of objects from a yaml config?

spawnLocs:
  - world: world
    x: 0.0
    y: 0.0
    z: 0.0
    yaw: 0.0
    pitch: 0.0
  - world: world
    x: 0.0
    y: 0.0
    z: 0.0
    yaw: 0.0
    pitch: 0.0

I was trying for (ConfigurationSection section : config.getList("spawnLocs")) but it doesn't work

ivory sleet
#

Use getMapList or if it was getListMap

jade perch
simple silo
#

ohh, alright, then cast every object to the correct type like string or double yeah?

jade perch
#

Ye

simple silo
#

alright, thanks for your help ๐Ÿ˜„

ivory sleet
#

Remember its gonna be boxed types

#

So you will have to convert to primitive ones manually

simple silo
#

(int)(Integer) value ?

sterile token
ivory sleet
#

Integer::intValue

#

For instance

simple silo
#

ohh

river hearth
#

Dependent blocks

jade perch
# simple silo ohh

To make it clear why you need to do that in case you were curious, it's to avoid null exceptions

simple silo
#

makes sense

languid flare
#

Hello