#development

1 messages · Page 113 of 1

dusky harness
#

¯_(ツ)_/¯

summer ingot
#

its free but the beginner course is paid for

tight junco
#

the free part is just enough for you to know

summer ingot
#

ive never touched java in my life but ill look for something i can do

rugged bane
#

Can’t agree more, I started facing many issues with it

weak crag
#

Hi guys

#

I got a problem too

#

public void onPlayerToggleSneakEvent(PlayerToggleSneakEvent e) { Player player = e.getPlayer(); if(!player.getName().equals("Hot_Shack")) player.sendMessage("Snek"); }

#

I wanna print something when someone specific sneaks but it does it when anybody sneaks

lyric gyro
#

Check your Boolean statement

weak crag
#

Yeh i tried with ! and without the !

#

it always prints

bright pier
weak crag
#

@Override public void onEnable() { // Plugin startup logic Bukkit.getPluginManager().registerEvents(new listener(),this); }

#

You mean this?

bright pier
#

Yeah

weak crag
#

Yeah i have it

bright pier
#

Remove the ! as it's checking if they don't have that name then do the code

weak crag
#

I tried it with and without ! and it always prints

#

(Also is there a way to do it with tags?

#

it's gonna be much simpler to use

bright pier
#

You'd have to ask the devs of fawe

#

Ask that's the API they get you to use

weak crag
#

Its printing again

weak crag
#

I found a fix

neat pierBOT
#
📋 Your paste: Caffeinated Spartan
https://paste.helpch.at/aqaqurigow

A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.

dense drift
#

RealScoreboard.jar//josegamerpt.realscoreboard.utils.Placeholders.time(Placeholders.java:54)
@viscid tulip

viscid tulip
#

?

dense drift
#

Don't post an error on all channels, stick to one.

broken elbow
#

yeah. we went thru this. lol. xD

robust flower
#

I know this question was probably asked 100 trillion times already, but what happened to the patched_1.18.1.jar? Is there a way to get the final jar holding all bukkit/spigot/paper classes?

lethal plaza
#

Hey Who can explain me how can i add tho this code a @eventhandler from another file ``` @SubCommand("open")
public void open (Player player){
openGui(player);
}

    public InventoryView openGui(Player player) {
        Inventory inv = Bukkit.createInventory(null, 27, "EXP Shop");
        ItemStack stick = new ItemStack(Material.STICK);
        inv.setItem(1,stick);
        return player.openInventory(inv);
} ```
stone gust
#

Hi

#

If i put
`` if (cmd.getName().equalsIgnoreCase("twitter")){
sender.sendMessage
(ChatColor.DARK_GRAY + "+---------------------------------------------------+");

    sender.sendMessage(ChatColor.GRAY + "Nuestro Twitter Es: " + ChatColor.AQUA + "www.twitter.com/somostrufas");

    sender.sendMessage
            (ChatColor.DARK_GRAY + "+---------------------------------------------------+");
    }``
#

The message will send when the player execute the command
/twittwer
The message will be like this
+---------------------------------------------------+
Nuestro Twitter Es: <the link>
+---------------------------------------------------+

#

¿?

dense drift
sharp cove
#

Why when clicking a item in the inventory isn't it canceled?

#
    @EventHandler
    public void onInventoryClick(final InventoryClickEvent e) {
        if (e.getInventory() != teamGUI) return;

        e.setCancelled(true);

        final ItemStack clickedItem = e.getCurrentItem();

        // verify current item is not null
        if (clickedItem == null || clickedItem.getType().equals(Material.AIR)) return;

        final Player p = (Player) e.getWhoClicked();

        // Using slots click is a best option for your inventory click's
        p.sendMessage("You clicked at slot " + e.getRawSlot());
    }
    ```
#

this doesn't work either

#

think i did something wrong tho

lyric gyro
#

Use .equals (or well, !.equals) to compare the inventories instead of ==/!=

sharp cove
#

This was fully copied from the SpigotMC forums (tutorial)

#

And even if y change it, it doesn't work

proud pebble
#

because e.getinventory isnt the same as teamGUI ig

sage thorn
#

hey, is there a way to decompile jar into intellij project?

proud pebble
#

its possible but not really recommended

rugged bane
half gate
little surge
#

Don't think you've declared your repository?

#

in the build.gradle

half gate
#

That's the build gradle of my lib

#

The one I'm testing if my lib is being downloaded (at least) is this one:

plugins {
    id 'java'
}

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

repositories {
    jcenter()
    mavenCentral()
    maven {
        url 'http://repo.dolphln.com/artifactory/ModelTool/'
        allowInsecureProtocol true
    }
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'

    implementation 'com.github.AleIV:ModelTool:0.1-SNAPSHOT'
}

test {
    useJUnitPlatform()
}```
hard wigeon
#

Using Fabric, how can I make a mod that only does logic server-side, but has items the client needs to render?
I tried making an ItemManager class that's run from both the server and client, and registers the items to the registry
but it doesn't seem to work
the item just doesn't exist

loud sorrel
#

hey. Im making a plugin to extend player reach to 5 blocks. would anyone know how to force a player to place a block so the original spigot code runs? if i did just setLocation() that code and other events from other plugins wouldnt run

dense drift
#

Sounds like something that has to be implemented on client side as well imo, Fred

summer ingot
#

is it possible to do what mee6 does with welcoming members to a server with an image but with java ? for a custom bot

dense drift
#

Yes ofc

#

Java even has a package for this, java.awt

summer ingot
#

hm, @sinful portal ^^ possible answer

summer ingot
hard wigeon
hard wigeon
lyric gyro
#

Must raytrace

loud sorrel
#

yeah i ended up doing that

lyric gyro
loud sorrel
#

^

hard wigeon
#

there's nothing wrong with it, yeah

#

I was just surprised

hard wigeon
#

a server a friend of mine takes commissions in

#

idk if it's public

dusky harness
#

ah

summer ingot
#

the challenges are all too hard for me

#

w8 i found learn java free course

cinder forum
#

😳

#

are jetbrains courses good?

mental cypress
#

I've heard pretty good things about them.

summer ingot
#

i would like to learn but im poor so the free-er the better

cinder forum
hard wigeon
#

most of the for-pay courses are actually pretty bad

#

well. maybe not most

#

some

proud pebble
cinder forum
#

at least in HTML tutorials it have common mistakes xd

#

or more like bad practices

surreal lynx
proud pebble
#

more of a if i forget syntax now

cinder forum
summer ingot
#

fingers crossed that they accept me

#

my student id doesnt have a date on it only my name and school name so they might not accept me right away

surreal lynx
#

It took me like a month to get accepted since I don't have a school email

dense drift
mental cypress
#

Process resources is @version@

#

version: '@version@'

dusky harness
dense drift
#

ye

dusky harness
#

this is what i use

#

🤷

#

wait dont use that

#
processResources {
    doLast {
        duplicatesStrategy = DuplicatesStrategy.INCLUDE
        from(sourceSets.main.resources.srcDirs) {
            expand 'pluginVersion': version
        }
    }
}
```hmm try this
dense drift
#

will do

dusky harness
#

wait

#

uh

dense drift
#

I think that doLast is around processResources

dusky harness
#
tasks.processResources {
    outputs.upToDateWhen { false }
    expand("pluginVersion" to project.version)
}
```this is what i do in kts, in gradle probably ```gradle
tasks.processResources {
    outputs.upToDateWhen { false }
    expand 'pluginVersion': project.version
}
dense drift
#

although I use a similar build.gradle on multiple plugins and didn't had an issue yet

dusky harness
#

hmm

dense drift
#

works now, did a clean install

mental cypress
#

Oh is it okay

#

Idk I've been drinking

lyric gyro
#

Mood

shell moon
#

Best way to detect when player digs a block (so you can do stuff while player digs)??

lyric gyro
#

PlayerInteractEvent?

#

Or whatever it's called

shell moon
#

doubt it's called on digging

#

afaik it's only fired once

orchid wyvern
# shell moon afaik it's only fired once

I’m not at my PC right now, but iirc the dig packet is send when the player starts digging and when it believes it has finished. Not sure if there is an event that correlates to this. You can cancel whatever you are doing when the finish dig packet / break block event is called (whichever comes first).

Edit: upon further research, don’t think there is an event for this so you would have to manually intercept the packet https://wiki.vg/Protocol#Player_Digging

#

On a separate note, what’s the best way to continuously perform a task if a player is not within a specific region of a block. There could potentially be many of these blocks. This also integrates with world guard regions if that makes things easier (I am currently using flag changes but I don’t want to create lots of regions)

high edge
#

Have a single timer, and just check the players

#

Have a single timer, and just check the players

cerulean birch
#

why is 0xBEE5, a 16-bit value, not compatible with a short, a 16-bit value bruh

lyric gyro
#

Do you know how big that value is in decimal?

lyric gyro
cerulean birch
#

bruh

#

if only java had signed/unsigned types

lyric gyro
#

Just use int

cerulean birch
#

yeah i guess

#

but it feels like it messes with writing and reading it to a stream, doing testing rn

lyric gyro
#

Erm in what way

cerulean birch
#

it looked like the value being written wasn't the correct bit-size (using objectoutputstream to write to a file), but i might've just messed up smthing idk

lyric gyro
#

Yea probably something simple

cerulean birch
#

nvm it works, am dumbo

river solstice
#

Is there a simple way to replace the 'Internal error ...' message?

sterile hinge
#

yes, you can fix your code

dusty frost
#

Catch the exception?

river solstice
#

I just don't want for players to see some random ass error message when some other plugin doesn't work properly

sterile hinge
#

then don't use broken plugins

river solstice
#

smart one aren't you

dusty frost
#

An internal error means something has gone really wrong, enough to throw an exception. What would you replace it with? Just another generic "Something has gone wrong" message? Other than that, you'd have to actually figure out the exception in the plugin and catch/correct it

sterile hinge
#

the message is hardcoded

dusty frost
#

Yeah, ya could always patch Paper lmao

severe heath
#

how do i detect right clicking action from a player

#

???

#

does anybody know how to do this? or could anybody teach me how plz.

high edge
#

You listen to the correct event, and then you execute the logic

severe heath
severe heath
severe heath
# high edge You listen to the correct event, and then you execute the logic

i've got this so far:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
Player p = e.getPlayer();
if (p.getInventory().getItemInMainHand().getType() == Material.STICK) {
if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
Bukkit.broadcastMessage("Event Triggered");
}
}
}

#

is there anything obviously wrong with that or anything?

fiery pollen
severe heath
severe heath
fiery pollen
#

Can you not tag me everytime you send a message please

severe heath
fiery pollen
#

getServer().getPluginManager().registerEvents(new Listener(), this);

severe heath
fiery pollen
#

okay

severe heath
fiery pollen
#

"this" is the class you are providing

#

the main class

#

so no

severe heath
fiery pollen
#

All good

severe heath
# fiery pollen All good

i tried to build it and i got "java: org.bukkit.event.Listener is abstract; cannot be instantiated"? what does that mean.

#

???

fiery pollen
#

new Listener(), You have to replace the Listener with your listener class/event class

fiery pollen
#

So if your listener class is called like InteractionListener, you do new InteractionListener()

severe heath
severe heath
# fiery pollen Yeah, this class

ah ok cool ty. so because i've got "public class ClickEvent extends JavaPlugin implements Listener {" my listener class would be called "clickevent"?

fiery pollen
#

Ah so you put that event in your main class

#

That should be ClickEvent Yeah

severe heath
severe heath
night ice
fiery pollen
#

in a pastebin if possible

severe heath
night ice
severe heath
severe heath
night ice
#

paste the code there and click on save on the top right and share us the link

severe heath
#

i think that should work... but idk why the codes not working. im new and inexperienced so it's probably something really obvious.

night ice
#

getServer().getPluginManager().registerEvents(new ClickEvent(), this);

#

you can't do this IG

#

you can't create another object of the JavaPlugin or is it possilble?

#

getServer().getPluginManager().registerEvents(this, this);

try this

severe heath
severe heath
night ice
#

this is not a placeholder...its pointer to the same class

severe heath
sterile hinge
#

(to the same instance)

night ice
#

yeah..sorry..same instance

severe heath
#

im trying to get it to execute the code when a player right clicks using the "stick" item.

night ice
#

hey, one more thing..do @carmine jacinth annotation on onEnable()

#

its extended from base class

#

wait... was he a member?

severe heath
night ice
#

nah, i pinged a user accidentaly

severe heath
lusty smelt
#

Somebody knows how to addd potions in Shopgui+

severe heath
night ice
#

is there any error?

severe heath
night ice
severe heath
severe heath
night ice
#
    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event){
        final Player player = event.getPlayer();
        if(event.getItem().getType() == Material.STICK){
            if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
                Bukkit.broadcastMessage("Event Triggered");
        }
    }
#

try this

severe heath
night ice
#

just replace your onPlayerInteract with this...

#

what i did was to get the event.getItem() instead of Player#Inventory.getItemInMainHand()

severe heath
#

fingers crossed

severe heath
night ice
#

lets just simply print both to know whats the difference

severe heath
#

do you have any idea what might be going wrong?

severe heath
severe heath
night ice
night ice
severe heath
#

do you have anything before the section of code you sent back to me that might make a difference???

severe heath
night ice
severe heath
severe heath
night ice
#

yep

severe heath
#

are there any things on the pastebin code thingy that are placeholders for other things?

severe heath
# night ice yep

i haven't inputted the startup and on disable code into it. might that cause it not to function properly?

night ice
#

nope

severe heath
# night ice nope

i changed the "itemcheck" name to the name of my class. was that the correct thing to do?

night ice
#

you sure your code isn't working

#

the same code runs fine for me

severe heath
#

could it be a message sending thing?

night ice
#

is your plugin enabled?

#

check that

severe heath
night ice
#

do /plugins

severe heath
severe heath
proud pebble
severe heath
lyric gyro
#

Hey, ive got this code wich turns 9 Coal into a CoalBlock it also works fine, but only if there are 10 coal in the barrel but it doesnt work with 9 coal. WHY?!

  @EventHandler
    public void onInventoryChange(InventoryMoveItemEvent event) {
        try {
            Container cont = (Container) event.getDestination().getHolder();
            if (cont.getInventory().getType() == InventoryType.BARREL && cont.getCustomName().equalsIgnoreCase("autocraft")) {
                for (int i = 0; i <= event.getDestination().getSize(); i++) {
                    if (cont.getInventory().getItem(i) != null)
                    {
                        ItemStack item = cont.getInventory().getItem(i);
                        if (item.getType() == Material.COAL && item.getAmount() >= 9) {
                            cont.getInventory().removeItem(new ItemStack(item.getType(), 9));
                            cont.getInventory().addItem(new ItemStack(Material.COAL_BLOCK));
``` (this is a small snippet of code)
lyric gyro
#

i dont get it

#

it should work

sage thorn
#
        at me.clip.placeholderapi.expansion.PlaceholderExpansion.register(PlaceholderExpansion.java:138) ~[?:?]```
#

whats this?

#

i am trying to register my expansion

#

and this error keeps popping up

hard wave
#

using the spigot 1.18 jar as library wont let me do basic things as extending JavaPlugin
import org.bukkit.plugin.java.JavaPlugin also doesnt work how do I import any of the classes or am I supposed to use a different jar

#

do I really have to use gradle :|

night ice
#

you should either go for maven or gradle for building and stuffs

hard wave
#

ill just use 1.16 then lmao

high edge
#

Man tagged me 3 fucking times for the same thing

cinder nimbus
sage thorn
#

I have 1.17.1 i think

lyric gyro
dense drift
#

Make sure you dont shade papi in your jar

#

compileOnly for gradle or provided scope for maven

lyric gyro
#

is there any other event except InventoryItemMoveEvent that allows to check for items update in the inventory without any player interactions

cinder nimbus
dense drift
#

Nice

lyric gyro
#

what da hell is a fake enchantment

graceful hedge
#

its a not real enchantment fs

lyric gyro
#

but how does it act

#

does it work like an enchantment but doesnt show or does it show like enchamnent but doesnt work

cinder nimbus
dense drift
#

Np

light elm
#

Tryin to create a custom uploader with ShareX

#

but this happens when i take a screenshot

dense drift
#

open the url

gentle mauve
#

Can someone reach out the creator and inform about this, im still waiting

queen plank
#

I want to prevent players from moving items in their inventory. But when I cancel the event I still get the item on the cursor (aka the item is duped). How do I fix it? Here is my code: https://paste.helpch.at/utuwilinor.cs

hidden lintel
#

You can do this item stacks have an nbt

#

And if player have and item satck with this nbt

#

Replace with air

queen plank
#

What do you mean? I don't understand.

hidden lintel
#

Humm you know Nbt api?

queen plank
#

No

hidden lintel
#

Oh i can help you but i this moment i in mobile phone

#

And i cant check my files

queen plank
#

The problem is not registering if the item should be moved or not though, if that is what you mean. Also, my items all have unique NBT-IDs so getting the correct item is not a problem. I use Tasks.getArtifact(SomeItemStack); and I will get the custom item corresponding to the itemstack or null if the item isn't a custom item.

hidden lintel
#

But you are saying when you interact with the items

#

They are dupped

#

You can do this

queen plank
#

The event is not cancelled properly is the problem.

rigid mountain
#

Question, so in 1.18 has NBT Changed? When im trying to do it as i did previously ItemStack is importing as import net.minecraft.world.item.Items;

hidden lintel
#

What is the event you use?

queen plank
#

I sent my code if you want to look at it, but I use InventoryClickEvent.

hidden lintel
rigid mountain
#

Ok

queen plank
hidden lintel
#

The player humm i dont remeber but existe a function

queen plank
#

Should I use a InventoryMoveItemEvent along with a InventoryClickEvent?

#

And cancel the event with the move event and get the player with the click event?

hidden lintel
#

e.getSource().getHolder()

#

This is a entity

#

Player p = (Player) e.getSource().getHolder()

#

e is event

#

No better use

#

e.getViewers()

#

This return an Human Entity

List*

queen plank
hidden lintel
#

You can use if e.getSource().getHolder().InstanceOf(Player)

#

I dont remember

queen plank
hidden lintel
#

I dont know

queen plank
#

Because it works fine in my GUIs but not in a player inventory, and I don't get why :/

hidden lintel
#

Try the inventorymove eveny and guse witj inventory click event

#

And if you move a item is artifact

winged pebble
#

InventoryMoveEvent doesn't apply to players

hidden lintel
#

Replace with air

hidden lintel
#

I have and item updater

queen plank
#

I don't want to check if the artifact changes inventory though. Only if a player moves it in THEIR inventory

hidden lintel
#

To replace placeholder in displayname and lore of item

#

And work on inventory

winged pebble
#

I thought that event was more for things like hoppers and droppers, etc

queen plank
#

It is

#

From the wiki Called when some entity or block (e.g. hopper) tries to move items directly from one inventory to another..

winged pebble
#

Players trigger it too?

hidden lintel
#

Yes work

#

I said it

#

And test

queen plank
#

Still though, I don't want to check if the item swaps inventory, only if it changes slot

winged pebble
#

So how are they getting the item into their cursor in the first place?

queen plank
winged pebble
#

You're not cancelling the initial click?

queen plank
#

At the bottom?

winged pebble
#

Why do they have an item in their cursor then?

hidden lintel
#

One use e.getItem() but the other i dont remember

queen plank
#

That is what I don't understand. I cancel the event, but I still get the item on my cursor

hidden lintel
#

Its normal because the events is cancelled but you equals tough the item

queen plank
#

But this exact method works as it should in my GUIs?

hidden lintel
#

I dont remember i have all mi code in my laptop

shell moon
#

Is it possible 1.8 FurnanceRecipe with custom cooking time?

proud pebble
#
private void registerCustomEnchantments() {
        new Telekinesis();
        new SmeltingTouch();
        new Rainbow();
        new Experience();
        new SilkTouch();
    }

is there a better way of doing this?

#

without having to type out new classname() for every single class

rugged bane
#

Honestly for the sake of readability I’d leave it like that

proud pebble
#

the classes are all in the same package and only gets called once

rugged bane
#

It’s better off having it like that than adding some fancy loop with array of classes, it’s more readable like that and prevents complication

#

I used to try make it as fancy as possible, but then by doing so you make it harder for future

proud pebble
#

im not trying to make it fancy, just register every class in a package so i dont have to type it out for every one i add

round sail
cinder forum
dense drift
#

this what @cinder forum

cinder forum
shell moon
#

Someone knows if it's possible to update Google Drawings (image) using an API?

spice ore
#

How does DeluxeMenus register commands?

shell moon
#

afaik, they don't

spice ore
#

They do no?
Other wise what is this used for? register_command: true

dense drift
#

it does register them, you gotta restart the server

spice ore
#

doesn't belong there, its a development question as im wondering how they do that. And registering any command would require a restart I know it doesnt register then on reload

dense drift
#
final Server server = Bukkit.getServer();
final Method getCommandMap = server.getClass().getDeclaredMethod("getCommandMap");
getCommandMap.setAccessible(true);
final CommandMap commandMap = (CommandMap) getCommandMap.invoke(server);```
<https://hub.spigotmc.org/javadocs/spigot/org/bukkit/command/CommandMap.html#register(java.lang.String,java.lang.String,org.bukkit.command.Command)>
robust flower
#

how can I filter messages printed on the console? what is the best way of filtering them?

pulsar ferry
#

I think Frosty did that once

dense drift
robust flower
#

That'll do it I think, thank you!

rigid mountain
#
  bad class file: /C:/Users/mason/.m2/repository/org/spigotmc/spigot/1.18.1-R0.1-SNAPSHOT/spigot-1.18.1-R0.1-SNAPSHOT.jar!/net/minecraft/nbt/NBTTagCompound.class
    class file has wrong version 61.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.``` What would be causing this? I used `java -jar BuildTools.jar --rev 1.18.1` to build my build tools and removed `-api` as i usually would but im getting this
dense drift
#

Try to run it using java 17

rigid mountain
#

Ok

steady ingot
#

Info: Not a Minecraft plugin

When I press the "up" key on my keyboard when using a terminal, I will be given the option to repeat my last command. However, when I try doing this in a java program, I get "^[OA" instead. Anyone know how to fix this?

proud pebble
#

starting at Line 48 ending 127 is there a better way to change the itemstacks at each slot more cleanly then im currently doing?

somber seal
somber seal
dusky harness
dusky harness
#

since you seem to be doing it a lot

proud pebble
#

why would i need an inventory framework ?

#

im only making 2 inventories rn

somber seal
delicate jasper
#

How do I create a multi bungee network?

slim vortex
#

create two networks and use a cache + pubsub like redis to synchronize player state and manage cross-network messaging

delicate jasper
#

No.. like I mean connecting one bungee cord proxy into another

slim vortex
#

Yes

#

That’s what that is

#

Two bungee cord proxies that intertwine player state and stuff

delicate jasper
#

That’s not what I want… something like

The main proxy -> a lobby proxy -> a game proxy

Kinda like how hypixel does it.

slim vortex
#

Hypixel doesn’t have “lobby proxies” and “game proxies”

#

They use a system of standalone networking applications that spin up and down lobbies and games and the master contextual proxy sends players to servers

delicate jasper
#

Well they have multiple bungee instances linked into one. Which is what I want for my server.

slim vortex
#

Having “sub proxies” isn’t a good idea anyway

#

What I described before is exactly what you seem to be asking for

#

Multiple proxies that are synchronized

#

You need something like redis to synchronize the data between proxies

delicate jasper
delicate jasper
#

I want to setup sub-proxies

slim vortex
#

why would you want separate proxies

#

You don’t want sub proxies

#

that creates unneeded complexity

delicate jasper
slim vortex
#

If you really want sub proxies, you’re on your own. It’s not how bungee operates, so you can write your own custom proxy from scratch

slim vortex
#

Or you can do it the normal way, and have processes that manage mini games and just tell the proxy to send the connected player to it

slim vortex
#

i’ll draw it

delicate jasper
#

Ok

frosty spindle
#

Hii discord team

high edge
#

No tho

sudden sand
#

Guys after a few sql statement with hikaricp my server passes away

#

here are the logs

#

I'm using default hikaricp settings

#

This is my class that manage the SQL Statements

warm steppe
#

idk but i do my hikari like this

HikariConfig config = new HikariConfig();

config.setMinimumIdle(1);
config.setMaximumPoolSize(20);
config.setDriverClassName(settingsManager.get(Config.DATABASE_DRIVERNAME));
config.setJdbcUrl("jdbc:mariadb://" + settingsManager.get(Config.DATABASE_DETAILS_IP) + ":" + settingsManager.get(Config.DATABASE_DETAILS_PORT) + "/" + settingsManager.get(Config.DATABASE_DETAILS_DATABASE));
config.addDataSourceProperty("user", settingsManager.get(Config.DATABASE_DETAILS_USERNAME));
config.addDataSourceProperty("password", settingsManager.get(Config.DATABASE_DETAILS_PASSWORD));
config.setAutoCommit(true);

dataSource = new HikariDataSource(config);
sudden sand
#

let me try

warm steppe
sudden sand
#

Nope

#

Also if it helps

#

here are the method executed

#

SQL Statement

sage thorn
#

Is there a tutorial on spigot and bungee support at the same time?

sudden sand
sudden sand
lyric gyro
sage thorn
#

Will try thanks

lone gust
#

Hi guys, maybe you can help me with it. I am trying to send my own pluginMessage to change the platform name in the debug screen (F3) at the top left, but my method for some reason doesn't work, despite the fact that the pluginMessage is successfully sent. Thanks in advance.

In my main class

@Override
public void onEnable() {
    ...
    getServer().getMessenger().registerIncomingPluginChannel(this, "minecraft:brand", new BrandListener());
    getServer().getPluginManager().registerEvents(new Listeners(), this);
    ...
}
public class Listeners implements Listener {
    @EventHandler(priority = EventPriority.HIGHEST)
    public void onJoin(PlayerJoinEvent e) {
        String fakeBrand = "FakeBrand";
        System.out.println("Sent to " + e.getPlayer().getName());
        e.getPlayer().sendPluginMessage(PluginChannels.plugin, "minecraft:brand", fakeBrand.getBytes(StandardCharsets.UTF_8));
        System.out.println(fakeBrand);
        System.out.println(Arrays.toString(fakeBrand.getBytes(StandardCharsets.UTF_8)));
    }
}
lyric gyro
#

its MC|BRAND

dense drift
#

It was changed to minecraft:brand on 1.13 from what I've seen

lyric gyro
#

ah

#

well i still use 1.8

#

¯_(ツ)_/¯

rugged bane
#

Haha

dense drift
#

Weak, no embed

ebon whale
#

I blame hc

neat pierBOT
#
Generating Profile!

We're generating a profile for this user, try again in a minute.

dense drift
#

Lol

ebon whale
#

The hell are you doing

lone gust
#

Perhaps there is some kind of specific handling of bytes used... idk really :/

lyric gyro
#
player.getClass().getMethod("addChannel", String.class).invoke(player, "minecraft:brand");
lone gust
#

Can you explain, please?

lyric gyro
#

you gotta make the client see the channel

lone gust
#

hm, i'll try, ty

gentle mauve
#

I see youre finnaly online, please can you do this, to fix so command cooldowns works? @robust crow

robust crow
#

DeluxeCommands isn't my plugin

gentle mauve
#

Oh wait

#

umm okay i misread

#

Can you please contact the creator?

#

I cant find any contact info

ebon whale
#

O.o

gentle mauve
#

Hello? @robust crow , i hate to ping but this needs to be done

queen plank
dense drift
#

if you don't want to be edited by an user, base64

#

@gentle mauve I would suggest to use another plugin, like MyCommand.

queen plank
high edge
#

Here it serializes an entire "inventory", but you can just extract the per item logic for your usecase

queen plank
high edge
#

Well not really stealing code, just showing you which methods you can use, and then you can write the use case specific functions for yourself

queen plank
#

Yeah, ok. Might take some inspiration if I get stuck :)). But I don't wanna copy paste.

high edge
#

yeye, that's totally understandable

#

If you need any guidance, just ask

queen plank
#

Thanks! 👍

queen plank
#

Ok, so I managed to come up with an output function with some google help. And I didn't realise there would be so much text. I am worried that reading and writing this much text often might cause lag. I do not know how this way of reading and writing itemstacks compare to the other one in terms of efficiency, but is there no way of like getting an itemstack from the class itself. From something like ItemStack[@83h4823h] (or however they look) I mean?

dense drift
#

no

queen plank
#

Frick, ok. What is more efficient then? Base64 or "regular item stacks"?

dense drift
#

that's just the location in memory of that object

high edge
#

What's the use case for what you're even doing

worn jasper
#

Uhm sooo, anyone has some examples of when I should have 2 different plugins and when it can be in one single plugin?

high edge
#

functionality

queen plank
# high edge What's the use case for what you're even doing

I have some custom items for my plugin. And for each item you have the option to allow the item to be "soulbound" ish. Meaning if you die, the item will stay, even if keepinventory is off. So I need to save the itemstacks somewhere, and I do this in a .yml file since I want to save the data even if the server is shut down. So every time a player dies with an item that is "soulbound" the itemstack has to be saved to the config file, and once they respawn the file is read from and the data deleted.

worn jasper
#

In what sense

high edge
#

Why not store it in a map, and if the server is shut down while the item is stored, write it to a file, and once it's enabled store it in a map again

queen plank
high edge
# worn jasper In what sense

plugin 1: manages claims,
plugin 2: creates rainbows,

two completelly different things, might get unorganized if you bunch them together

worn jasper
#

What about an essentials like plugin and builders tools?

high edge
#

but I mean if done right, you can split them into modules and still have a single plugin

worn jasper
#

Like banner maker, shortcuts for we, etc

#

Would that be considered as core systems?

queen plank
high edge
#

to be fair even writting and reading a file isn't going to pose many performance issues

queen plank
#

Probably not, my brain just sees a lot of text and is like server gon be ded.

high edge
#

not really lol

#

but I mean you can use a lot of things to achieve what you want, using a db could also be cool

queen plank
#

Ig I'll go with sql, and the map thing if no db is accessible.

#

Thank you!

dense drift
#

maps aren't persistent, what frosty meant, is to have one with all your items and save it (to whatever format you want) on interval / when the server shuts down.

queen plank
#

Yeah, I understood that. Maybe I was unclear when I said "map thing".

#

:))

lone gust
# lyric gyro ```java player.getClass().getMethod("addChannel", String.class).invoke(player, "...

It's me again 🙂
Now my code looks like this:

@EventHandler(priority = EventPriority.HIGHEST)
    public void onJoin(PlayerJoinEvent e) {

        Player player = e.getPlayer();
        try {
            player.getClass().getMethod("addChannel", String.class).invoke(player, "minecraft:brand");
            player.getListeningPluginChannels().forEach(s -> plugin.getLogger().info(s));
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | NoSuchFieldException ex) {
            ex.printStackTrace();
        }

        e.getPlayer().sendPluginMessage(plugin, "minecraft:brand", "FakeBrand".getBytes(StandardCharsets.UTF_8));
        plugin.getLogger().info("Sent to " + player.getName());
    }

Console output:

[15:56:43 INFO]: [PluginChannels] minecraft:brand
[15:56:43 INFO]: [PluginChannels] Sent to Feniksovich

I tried what you suggested and it seems channel was added, but it still didn't work. What am I doing wrong?

dense drift
#

pretty sure you have to make the addChannel method accessible

lone gust
#

Edited

dense drift
#

get the method, make it accessible and then invoke

#

and that console message will always be there because it is located outside the try/catch block

lone gust
dense drift
#

yes

lone gust
#

same ¯_(ツ)_/¯

#

This part of the code definitely works correctly.

dense drift
#

what mc version?

lone gust
#

1.18.1

#

Unbelievable

#

I looked into open source projects on GitHub and tried to impudently copy-paste the code to my project:

@EventHandler(priority = EventPriority.HIGHEST)
    public void onJoin(PlayerJoinEvent e) {

        Player player = e.getPlayer();
        try {
            Method method = player.getClass().getMethod("addChannel", String.class);
            method.setAccessible(true);
            method.invoke(player, "minecraft:brand");
            player.getListeningPluginChannels().forEach(s -> plugin.getLogger().info(s));
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
            ex.printStackTrace();
        }

        // COPIED FRAGMENT
        final ByteBuf buf = Unpooled.buffer();
        final byte[] utf8Bytes = "FakeBrand".getBytes(StandardCharsets.UTF_8);
        buf.writeByte(utf8Bytes.length & 0x7F);
        buf.writeBytes(utf8Bytes);
        final byte[] result = buf.array();
        buf.release();
        // COPIED FRAGMENT

        e.getPlayer().sendPluginMessage(plugin, "minecraft:brand", result);
        plugin.getLogger().info("Sent to " + player.getName());
    }
#

This works fine, however it requires netty as a dependency

#

Earlier I used just "FakeBrand".getBytes(StandardCharsets.UTF_8)

winged pebble
#

Isn't netty included inside of spigot?

lone gust
#

Without a separate netty dependency the IDE doesn't suggest to any import. ¯_(ツ)_/¯

dense drift
#

is probably not exposed, Deerjump

lone gust
#

So, my final cringy implementation without netty:

final byte[] bytes = "FakeBrand".getBytes(StandardCharsets.UTF_8);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
outStream.write(bytes.length);
outStream.writeBytes(bytes);

Output (the same as using netty methods):

[9, 70, 97, 107, 101, 66, 114, 97, 110]

9 = byte array length
70, 97, ..., 100 = encoded string

It just works

queen plank
#

Is there any way to prevent Bukkit#dispatchCommand from appearing in the console? Regular commands I can use a LogRecord to hide, but it does not seem to work on "sudos".

hoary scarab
#

So I'm using
Inventory inventory = chest.getInventory() instanceof DoubleChestInventory ? ((DoubleChest) chest.getInventory().getHolder()).getInventory() : chest.getInventory(); To get the inventory of a chest or a double chest but no matter what It only gets a single half of the chest. Any ideas why?

queen plank
#

Have you tried using chest.getBlockInventory() instead? That is what I've been using

queen plank
#

Wat, I've never used doubles. Thought that worked lol

lone gust
#

Maybe DoubleChest#getLeftSide() and DoubleChest#getRightSide() can help?

queen plank
#

I'm sorry if this is obvious, but I'm trying. Are you using the material import or the org.bukkit.block.Chest?

hoary scarab
queen plank
#

You can get block inventory, and the inventory of the chest next to it, then iterate over to add them together?

lone gust
hoary scarab
hoary scarab
queen plank
#

I know, but if it does not work I mean lmao

hoary scarab
#

I don't click links lol. Can you embed? or post to imgur.

queen plank
#

Idk how to embed lol

hoary scarab
#

I don't think tier 1 can so you can just use imgur then I can embed it.

queen plank
#

And I don't have an imgur account

#

lol

hoary scarab
queen plank
#

You don't?

hoary scarab
#

no lol

queen plank
#

Wow, I didn't read the popup. Ad blocker lmao, I just saw "log in"

hoary scarab
#

I think I figured out why my method isn't working.
I save the instance of Chest and use that to check the chest every time so when you add a chest to create a double chest its still the instance of a single chest.

queen plank
#

Hmmm...

#

That is probably why yes

hoary scarab
#

Yeah that was the case

#

Just added Chest = (Chest) Chest.getBlock().getState() to my getChest method.

worn jasper
#

Hi.. sooo. we used to be able to use this e.getClickedBlock().setData((byte)(data + 8)); aka setData with bytes, but rn, we have to use MaterialData which doesn't work the same way bytes work, and I wanted to ask how I can replicate the same thing but with MaterialData...

#

(add 8 bytes to data part)

#

And also, how can we compare them? since we used to also be able to just do if (e.getClickedBlock().getData() <= 7)

dense drift
#

Yapper use Container if you can and only need the items

sage thorn
#

when having plugin with spigot and bungee support, how commands work on bungeecord? do i need to register them or what?

mental cypress
#

Using raw command stuff? Yeah I'm fairly sure you have to register them under the proxy class too.

lyric gyro
#

Is there a way to use the time someone has been in a team or has been tagged for as a selector. For example, when someone dies they get put into a team and after 15 seconds they respawn so is there a way you can detect if a player has spent 15 seconds in that team so you can pick them to respawn?

#

Not sure if that made sense lol, ping me if you answer or want me to re explain it

dense drift
#

You can schedule a runnable for 15 seconds once they die

lyric gyro
#

That will only run something for everyone with that tag or in that team though…

lethal plaza
#

Ideas for new plugin developer what to make for my first plugin?

queen plank
#

Is there a good way of simulating a block being broken by an item? I have an item with a veinminer ability and want to simulate fortune with it. Should I just get a random number in these: https://minecraft.fandom.com/wiki/Fortune ranges depending on level or is there a better way?

high edge
#

You can use the World#breakBlock(Location, ItemStack) method (iirc it's called something like that), and it'll apply the enchantments accordingly iirc

queen plank
#

Ok, found it, I think. It was Block#breakbNaturally(ItemStack). Though it is a boolean, so I can't get the drops easily. Guess I will have to live with that. Thanks!

void orchid
queen plank
# void orchid I'd suggest you to make a chat plugin (which lets you enable/disable coloring, c...

If you mean using a config file that might be too much. I did almost exactly that as my first plugin, and I struggled hard. Maybe I was just stupid, but I found it very hard to use the chat in my first plugin, partly because it can be hard to get feedback. I would instead suggest doing something like, simple commands. Like hello world or spawn a mob, stuff like that. To understand what you are doing and get a grip of Java. If you understand Java, maybe try to change the block a player clicks on? Then, once you understand the basics, try making a staff chat like Tofpu said. It is hard to say what you should start with, if you know Java do what Tofpu said. Otherwise, consider my suggestion. Also, some youtube tutorials are good imo. @lethal plaza

pure crater
#

struggling is part of the learning process

hard wigeon
#

So I have a plugin that has both a fabric and a spigot portion. How do I shade them together into one jar in gradle?

#

is there a non-hacky way to do it that doesn't involve specifying full paths

pure crater
#

just saying, i really dont recommend this

#

you should really keep them separate

hard wigeon
#

what's the issue with combining them?

pure crater
#

is that not clear? Like what if you accidently loaded a class that isn't supported by the current platform

#

and its a fuckmess to handle and everything

#

just make them separate

#

will make your life easier

hard wigeon
#

I have my platform's code seperate

#

package.platform

pure crater
#

Then make the jars separate too

#

surely you have a common module too right?

hard wigeon
#

mhm

#

I do

#

I'm not using it yet 🥲
I need to refactor things to use the same codebase

#

there's just too much differance atm

#

mf-gui will fix that hopefully 😄

#

anyway, got it

#

it seems like it'd just be more convenient not to have different jars

pure crater
#

it's really not in the long run

#

you can take my word for it

hard wigeon
#

._. okay

azure aurora
#

Hello Guys

#

Any Support Can DM Me?

proud pebble
azure aurora
#

i have a problem, On my Discord First Creator (OWNER) Account Has been Deleted, And i want to transfer on my account, i have a administrator Permission, i have to send messages 2-3 Times But i didn't get any help, anyone can help me?

proud pebble
#

this server is for minecraft related stuff

azure aurora
#

Where i can make live chat?

proud pebble
#

This server isnt related or owned by anyone that works at discord

#

if you want discord support you will have to email discord

azure aurora
#

About 2 weeks

proud pebble
#

then your SOL

#

nothing anyone in this server can do anything about it

azure aurora
#

Okay Thank u for attention <#

#

M3

#

❤️

rugged bane
dense drift
#

^

#

Is not the same thing as multiple versions support

hard wigeon
#

Man I'm really liking fabric...
if I ever make a public server again, I might make it with fabric (server-side only though, no client mods)

#

it lets you make server-side items

#

that the server thinks of as modded

#

with a vanilla client

somber seal
#

ooo that’s really cool

pulsar ferry
#

I think there is another one that gives better lighting performance too

lyric gyro
#

Krypton!!!

hard wigeon
#

I think running a non-bukkit server would be kind of a relief

#

I'd have all sorts of problems, sure

#

and probably nowhere to go

#

but it'd be a relief from the bukkit ecosystem

#

and I could use papi soon™️

hard wigeon
#

but it will make me not rely on outdated things updated by noone

lyric gyro
#

Is there a way to join a vanilla server with a modpack instance?

I have a bungee server with a vanilla hub on it. (Running spongeforge egg). But i keep getting disconnected when i try to join with the error: 20:18:20 [INFO] [Extech] disconnected with: IllegalStateException : Too many registered channels @ com.google.common.base.Preconditions:502

edgy lintel
#

where is the net.md_5 bungee api in 1.18 jar?

dense drift
#

https://paste.helpch.at/onowerakus
So, I have this vouchers plugin and someone came with an idea to add different redeem types (for example, EAT would require to eat the voucher and for this I would need a PlayerItemConsumeEvent listener). I thought about making a small system where I could register a listener by calling a method, give it the functions required to access the data it needs (player, the item involved in the event) and then call a method that will do the rest. Do you guys think this is a good idea? 🤔

rugged bane
#

Personally I’d have all the listeners registered for each thing, and then on event I’d check if what they’re using / interacting with is a voucher, if so, do the checks accordingly

muted trench
#

Any ideas on the Protocol Lib angle object?

#

I didn't find any objects named like that although the documentation defines it as Angle.

#

Is it supposed to be Directions?

queen plank
#

I want to use a console filter for my plugin as it can get very spammy when you do certain edits. But my filter does not seem to register commands, any idea why this might be?

molten wagon
#

When you use #add() is it a way to update redstone like comparator? or do I have to get blocks around location and update that block somehow?

dense drift
#

What #add()?

molten wagon
#

I not "update" as normally do in minecraft. I don´t know exactly if it exist in spigot api or need dig into nms.

dense drift
#

ah

molten wagon
#

Is not biggest issue, but nice if it was a solution for it.

proud pebble
#

is there a method to get the materials that an enchant is compatible with?

lyric gyro
#

Enchantment#getItemTarget() (EnchantmentTarget) is prolly the closest you'll get to it

#

that sounds like a little xy, I suggest you start looking there to see what fits your needs

somber seal
#

that reminds me, is there a method to get the materials that an item meta type is compatible with?

regal musk
#

Any ideas what method to make animations ?
Should I go ahead and use scheduler built in, not really sure how performant it is..

lyric gyro
#

can't remember the name

somber seal
#

not check whether a material is applicable to an item meta, but a list of materials applicable to a specific item meta type

#

xy: I want to print out a list of compatible materials if a user tries to edit itemmeta-specific values with an incompatible item

#

I’d be fine with (and currently have) a custom method for this, but was just wondering if there’s a better way

lyric gyro
#

do you already have the itemmeta?

somber seal
#

yeah, it’s provided upon user command (the only time we’d even need the compatible materials)

#

tbh I’d be fine with keeping what I’ve currently got. was just curious if anyone had any better ideas

#

thx for your help tho meow_pizza

orchid otter
#

Is there something like an interpreter already for color codes so i can easily translate stuff like &2Text to CHATCOLOR.DARK_GREEN+"Text"

high edge
#

:what:

pulsar ferry
#

d;spigot chatcolor#translatealternatecolorcodes

uneven lanternBOT
#
@NotNull
public static String translateAlternateColorCodes(char altColorChar, @NotNull String textToTranslate)```
Description:

Translates a string using an alternate color code character into a string that uses the internal ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r.

Parameters:

altColorChar - The alternate color code character to replace. Ex: &
textToTranslate - Text containing the alternate color code character.

Returns:

Text containing the ChatColor.COLOR_CODE color code character.

high edge
#

Legit forgot what the method was called, went to go check GH to find it lmao

orchid otter
#

Big thanks

lyric gyro
#

Hey i have a small problem with my indexes + maven, basically i have a multiversion plugin i made but i cannot compile it, i added 2 different spigot dependencies to maven but the material class is still from 1.13+ and i want to use 1.12.2 and 1.13+ material class, how do i do it?

worn jasper
#

Hi. How can I fix this issue? Kinda forgot lol, isn't it with utf or so?

dense drift
#

-Dfile.encoding=UTF-8

worn jasper
#

ty

warm steppe
worn jasper
#

god why is Mushroom stems, etc so difficult to get in 1.12.2

lyric gyro
#

wat

worn jasper
#

like, we don't have the id and data systems anymore

worn jasper
#

soup?

lyric gyro
#

🤷

worn jasper
#

I am speaking about the "secret" blocks

#

aka blocks you could only get via command

lyric gyro
#

OH

worn jasper
#

like, barriers, mushroom stem, oak wood bark

#

mob spawners

#

end gateway

#

etc

#

you could get those using id and data

lyric gyro
#

yeah you just play around with them numbers lol

worn jasper
#

but in 1.12.2 that changed

lyric gyro
#

you mean 1.13?

worn jasper
#

no, 1.12.2

lyric gyro
#

1.12 still used the byte "id" data system

worn jasper
#

uh? how do I get a material by id and data then?

#

couldn't find anything about that

#

maybe I am just blind

#

getMaterial(id) doesn't support data (byte)

lyric gyro
#

the material is just these

#

then you modify the MaterialData

worn jasper
#

but I need a Material, not MaterialData

#

okay wait...

#

I am totally confused rn

#

xd

lyric gyro
#

it's a single Material

#

the "block type" so to speak

#

the MaterialData defines its properties

worn jasper
#

Material.BROWN_MUSHROOM

lyric gyro
#

such as texture

worn jasper
#

this is a material yes

lyric gyro
#

err that's 1.13+

#

wait

high edge
#

Just switch to 1.18

#

Screw anything else

lyric gyro
#

sanest solution

worn jasper
#

I wish I could switch

lyric gyro
#

which one is which uh yeah mmLol

worn jasper
#

okay but what then

#

they also don't work

lyric gyro
#

and what about them "don't work"?

worn jasper
#

oh that

#

still confused how it works

#

let me try smt

#

ye okay not this

lyric gyro
#

Mushroom is the MaterialData

worn jasper
#

or wait is the end the byte?

lyric gyro
#

no

worn jasper
#

uh but it worked?

#

(material being Mushroom)

#

the second argument is the data value

lyric gyro
#

my god are you purposely ignoring what i'm typing out?

worn jasper
#

no

#

I am just not understanding

#

where you want me to go

#

or what you want me to realize

lyric gyro
#

Mushroom is the MaterialData

#

create a Mushroom instance

#

Mushroom extends MaterialData

worn jasper
#

okay

#

but the thing is, that's not a material apparently

lyric gyro
#

yeah okay

#

i tried

#

i'm out

worn jasper
#

understandable

#

sorry for being stupid

warm steppe
#

@worn jasper do you by any chance make scripts in Skript

worn jasper
#

it's mentioning SK Gaming

#

and I already figured another way of doing it and even better

warm steppe
#

cool

marble scarab
#

Is there any difference between getConfig().getList("key") and getConfig().get("key") if key points to a list?

dusky harness
#

d;spigot configurationsection#getstringlist

uneven lanternBOT
#
@NotNull
List<String> getStringList(@NotNull String path)```
Description:

Gets the requested List of String by path.

If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.

This method will attempt to cast any values into a String if possible, but may miss any values out if they are not compatible.

Parameters:

path - Path of the List to get.

Returns:

Requested List of String.

dusky harness
#

and u should use this instead

#

or for ex #getIntegerList

#

getList and get is there in case you serialize your own stuff

marble scarab
#

but is the object that it returns just a List?

dusky harness
#

if you did ```java
List<String> list = config.get("path");

#

it would error

marble scarab
#

yes but List<String> list = (List<String>) config.get("path"); would work?

dusky harness
trail burrow
dense drift
#

Caused by: java.lang.NullPointerException: Cannot invoke "com.leonardobishop.quests.common.quest.Quest.getId()" because "quest" is null

#

Find where "quest" is defined in your code, it is null

trail burrow
#

I don't recall using quest as a variable

dense drift
#

Stacktrances are pretty easy to read, especially if you run your server through IDEA, you can jump to parts of your code from these references (ClassName.java:line)

#

QuestsAlternative:67?

trail burrow
#

67 line number? that's a // out line

dense drift
#

Cant tell much without seeing more than 2 lines of code. Follow the stacktrance and see where a value could be null

trail burrow
pure crater
#

that isnt telling us much either tbh

trail burrow
#

since the lines I gave you is basically the whole thing, it hooks into quest plugin and gets info, no clue what thier code is

chilly oyster
chilly oyster
#

no but i dont know if thats an issue with my code or TAB

chilly oyster
#

ok so doing /papi parserel AkiraDev AkiraDev %player_protocol_version% just returns the %player_protocol_version% back to me

flat anchor
#

U should just try % AetherPlaceholders_player_protocol_version%

chilly oyster
#

nope

chilly oyster
#

i dont understand how these work

tight junco
#

it should be the placeholder that max provided (%aetherplaceholders_player_protocol_version%)

#

check that your plugin actually shows in /papi list and that you're registering the placeholders

chilly oyster
#

how do i checkif ive registerd the placeholders, my expansion shows up in papi list

tight junco
#

do /papi list

#

does your plugin show up

chilly oyster
#

yes

#

i dont know what i did but it works now?

inland bear
#

am beginner dont judge

#

nvm_shit

wooden loom
#

hey

#

how to send a message to a player and show it in his actionbar? in 1.16.4

lone gust
wooden loom
#

yes but that don't work with my plugin

#
public void playerJoinListener(PlayerJoinEvent event) {
  event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("welcome to the server"));
}
#

this is the code that I have but it is not working and yes I registered the event and I did implements Listener

lone gust
#

@EventHandler?

wooden loom
#

yes , sorry I already found the problem I did register the event in the wrong place.

stuck rain
#

||System.out.println fixing the error||

lone gust
#

btw 😄

clever relic
#

how do you protect your API keys if they're sent as part of the request URL

dense drift
#

😬

#

What do you want to do?

clever relic
clever relic
lone gust
dense drift
#

👍

rugged bane
#

long time no speak also

clever relic
rugged bane
clever relic
#

Yeah mate, me and my gf had a kid 🙂

cinder forum
#

Hello, I would like to make Minecraft server from scratch as learning project, I know this is too general question but, how to start? 😄

lyric gyro
#

by regretting your decision

cinder forum
lyric gyro
#

don't worry, you'll regret it later, like it or not

hushed badge
#

oh no

cinder forum
lyric gyro
#

xddrypton

cinder forum
#

ye

#

Minecraft server as Rust learning project XD XDSAD

hushed badge
#

good luck

#

i wish u all the best.

lyric gyro
#

yeah you'll need luck

#

a lot of it

#

and a few miracles too

cinder forum
lyric gyro
#

🙂

cinder forum
cinder forum
#

ooo there is rust server already fluchet

cinder forum
pulsar ferry
#

Because every single from scratch mc server that ever started has never gotten anywhere

cinder forum
#

i think

dusky harness
#

make a json parser

#

even krypton is in its verrrry early stages

#

so if you're writing one in a new language

#

i'd recommend something easier

cinder forum
#

maybe I can do it for 1.7/1.8
that could be easier right

#

is it documented tho

lyric gyro
pulsar ferry
lyric gyro
cinder forum
lyric gyro
#

Are you using netty?

#

rust moment

#

With rust woah

#

Gl gonna take 2 years

cinder forum
lyric gyro
#

Custom servers take a while

cinder forum
#

my current goal is

lyric gyro
#

Been working on one for a little over a year now. Somewhat close but really not

cinder forum
#

just move in flat world without other entities

pulsar ferry
#

Custom servers take an infinite amount of time, they never seem to finish

lyric gyro
#

Your goal should be to login

lyric gyro
cinder forum
pulsar ferry
#

Because they never get finished

dense drift
#

Mohist

lyric gyro
#

vomiting

#

and that's not from scratch smh

cinder forum
#

🤔 how is Bukkit made? its just edited Vanilla?

lyric gyro
#

yes

#

You can totally make a custom server with spigot api lmao

#

well now that you edited it the answer is no

broken elbow
#

not my shit fork

worn jasper
#

yaml is good for a home plugin right?

lyric gyro
#

As long as you load it all into a map onenable

worn jasper
#

in terms of if the server crashed

dire marlin
#

How is different GUI for different chest menu's made?

lyric gyro
#

Yessir you could also just load in there are with the playrtb

#

In there home with the player

#

Use any database

#

Or redis

#

I’d you could write to your file every so often in case of data loss. Too many options

tender thicket
#

Would anyone be able to take the time to teach me how to use the fabric OR forge api?

worn jasper
#

in terms of performance, is it the best?

graceful hedge
#

and trial + error

#

and their discord server is quite active iirc

#

thats all

#

😛

lyric gyro
#

the fabric wiki has A LOT of documentation for many individual bits on how to do various different things

#

like, A LOT

graceful hedge
#

yeah its very much nice

lyric gyro
#

the community is, eeh it depends on who chooses to help you in my experience, but most of the time quite positive

pulsar ferry
#

Forge in other hand is a fucking cesspit

hard wigeon
#

Using mojmapped NMS,
what's the issue with this:

((CraftWorld) world).getHandle().setBlock(new BlockPos(x * multiplier + mx + chunkCoordinate.getX() * 16, y * multiplier + my, z * multiplier + mz + chunkCoordinate.getZ() * 16), ((CraftBlock) cloneBlock.clone()).getNMS(), 2, 0);

it just freezes in it's tracks

a simplified version is

((CraftWorld) world).getHandle().setBlock(new BlockPos(0, 0, 0), ((CraftBlock) cloneBlock.clone()).getNMS(), 2, 0);
lyric gyro
#

the numbers mason!!

#

what do they mean

hard wigeon
#

I'm an idiot

dusky harness
#

at least for me it didn't 🤷

#

emily

#

i had to wrap it around a try/catch

hard wigeon
dusky harness
#

yea, i had that problem before 😩

#

spent half an hour on it

#

lol

hard wigeon
#

I spent more than that on this

lyric gyro
hard wigeon
#

lmao

lyric gyro
#

99.999% sure

dusky harness
hard wigeon
#

okay, lets see

#

🤞 it works

dusky harness
#

(and plus, u shouldn't modify the world async)

hard wigeon
#

yeah I didn't think I was doing that

#

forgot it was async

dusky harness
#

🥲

hard wigeon
#

is it possible to take chunk snapshots async?

lyric gyro
#

they are for being used async

#

not taken async

hard wigeon
#

that was my assumption

#

cool

#

Idk though, some java is still like black magic to me

#

so I wasn't sure how that works

dusky harness
# lyric gyro 'cause you were using it wrong
fun main() {
    val executor: ExecutorService = Executors.newSingleThreadExecutor()
    executor.submit {
        println("a")
        throw IllegalStateException("test 1")
    }

    executor.submit {
        println("b")
        runCatching {
            throw IllegalStateException("test 2")
        }.exceptionOrNull()?.printStackTrace()
    }
    println("start")
    Thread.sleep(2000L)
    println("end")
}
#
start
a
b
java.lang.IllegalStateException: test 2
    at me.dkim19375.project.TestKt.main$lambda-2(Test.kt:15)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
end
#

¯_(ツ)_/¯

lyric gyro
#

yep

#

wrong

dusky harness
#

oh

#

how do i do it?

lyric gyro
#

execute instead of submit

dusky harness
#

o

lyric gyro
#

submit returns a Future, that's what you use to either a) get the result or b) handle the "queued" exception

dusky harness
#

ty

#

google says submit 😩

#

so ive been using it all this time without knowing i have to use the future

dusky harness
lyric gyro
#

you use submit if you need a Future

#

you'd use a Future if you need to queue some sort of callback or get a result back from it

#

or handle an exception thrown by the task outside of the task itself

radiant brook
#

watch out: Bad code incoming

lyric gyro
#

mutes channel

radiant brook
#

basically I have this static function that generates an UI Inventory and has the player open it. It just doesnt work. Does anyone know whats the problem? There are no erros in console.

https://paste.helpch.at/urazotuzoz.cs
Static generating Method (pls dont bully, its 1:57 am and im just developing whatever crosses my mind)

if(event.getItem().getType().equals(Material.NETHER_STAR)) {Utils.getChooseClassInterface(event.getPlayer());}```
round sail
#

Did you log before you call Utils.getChooseClassInteract(event.getPlayer()); to see if it's even making it there.

#

Maybe the event isn't behaving how you would expect.

radiant brook
#

yes. the "player.sendMessage("opening inv");" is my debug and it is being called

round sail
#

That would have been good to add 😛 "It just doesnt work" made me think its not getting there.

#

Why do you do 3*9 lol

radiant brook
#

I just like doing it in rows and shit

#

idk im stupid

round sail
#

Is this for like 1.8 or something?

radiant brook
#

like if I want more rows I just gotta increase that 3

#

its 1.12

#

I basically copied over another function I used in the same plugin so the generation should work in theory

#

I can send the working function, only difference is that it gives back a inventory and the listener opens it, but even when I had it with this function it didnt work

#

if(event.getItem().getType().equals(Material.EYE_OF_ENDER)) {event.getPlayer().openInventory(getNewCompassInterface(event.getPlayer()));}

#

only difference is that its being called like this

trail burrow
#

if I wanted to use placeholders from other plugins I would need to hook into papi right?

wooden loom
#

Hey

#

Is it posible to make a clickable scoreboard?

#

Like that you see lobby 1 and when you click on that text you see an overview in a gui of all available lobby’s or your player just executes the command /lobby when you click on that text in the scoreboard

radiant brook
#

no. There is no events associated to the scoreboard

wooden loom
#

Oh so there is no sollution how I could achieve this?