#help-development

1 messages · Page 2096 of 1

atomic zodiac
#

Zacken wants all the smoke

sharp flare
#

is this in accordance with my post

#

or from others chat

earnest forum
#

so much aggression for logging errors 😂

noble lantern
#

i dont really reccomend storing bools as strings

atomic zodiac
sharp flare
#

then I should use Boolean#valueOf

earnest forum
#

yeah or create a method that converts the byte to a bool if that doesn't work

noble lantern
#

(Boolean) "true";

#

jk dont do that

#

javascript can do that i bet

earnest forum
#

(Boolean) false;

#

very helpful !

noble lantern
#

rn

#

i wonder what ever happened to him

earnest forum
#

no!!! I don't wanna uninstall notepad++!

sharp flare
#

I could just retrieve the string and check the returned string, use 0 and 1 in a ternary operator

earnest forum
#

it's such a waste though

#

you don't need that at all

noble lantern
#

or here me out

#

make your own PersistantDataType

earnest forum
#

can you actually do that

sharp flare
#

I'm not familiar with making pdc types

noble lantern
#

were gonna pretend i didnt fuck my grammar up that bad

noble lantern
earnest forum
#

that's poggers

#

ok I'm un ijnstalling now

noble lantern
#

unlijalling

earnest forum
#

yea

noble lantern
sharp flare
#

may I ask the link for the guide

earnest forum
#

"spigot custom pdc types"

eternal night
#

The pdc type javadocs also have an example for uuids

wet breach
#

or just save what I like to call mini-chunks

serene rampart
#

can i use discord webhook in spigot?

#

if yes can someone send me the code

noble lantern
faint cypress
#

Hey guys, sry for repost but I didn't get an answer for this before...
I have a class that extends BukkitRunnable that is intended to be run asynchronously. In the run() method I callback via a lambda.

@Override
public void run() {
    final List<String> list = new ArrayList<>();
    // Populate list with list.add()
    Bukkit.getScheduler().runTask(plugin, () -> { callbackMethod(list); });
}

...
// In JavaPlugin class:
public void callbackMethod(List<String> list) {
    this.list = list;
}

Is List / Arraylist okay to use here for passing a list of strings back to the main thread?
I intend to add, remove and read from this List on the main thread.

eternal night
#

Well depends on whether or not you plan to mutate the list after you passed it back to the main thread through the callback

#

if you only write to the list on thread A, then "send" it to thread B and thread B is then the only one that mutates/reads the list you are good

hard lion
#

Does anybody have an idea on why this isn't working properly?

 for(Entity snowballs : snowballs) {

                             Particle.DustOptions dustOptions = new Particle.DustOptions(Color.fromRGB(52, 164, 235), 2.0F);
                             world.spawnParticle(Particle.REDSTONE, snowballs.getLocation(), 4, dustOptions);

This is inside of a BukkitRunnable task timer, delay: 0, period: 1.
The particles are supposed to spawn constantly behind the snowball, like a trail, but in the game it spawns it only once and stops spawning the particles.

chrome beacon
#

Show entire method

#

?paste

undone axleBOT
chrome beacon
#

Also why is the name of the list and snowball the same

hard lion
hard lion
eternal night
#

that is some cursed formatting

hard lion
eternal night
#

And well, no idea what snowballs is or how it is filled, but you cancel the runnable if a single one of your snowballs dies

hard lion
#

IQ 💀

crude loom
#

Is it possible to set 2 permission to one command and if the player has one of them it will work?

chrome beacon
#

Yes use an if check

crude loom
#

Oh right that works

#

I forgot that permissions outside of plugin.yml are a thing😅

chrome beacon
#

Make sure to still define them in the plugin.yml

#

But under the permissions section rather than under the command

torn shuttle
#

is there an easy way to make it so a banner doesn't get removed when the block under it gets removed?

chrome beacon
crude loom
#

Oh, so I can set child permissions here and set the description of the permissions?

torn shuttle
chrome beacon
#

Hm not sure then

torn shuttle
#

it's just for a couple of blocks and only during a specific timeframe so I'd rather dump a repeating task on the block than listen to a physics event

chrome beacon
#

I see

torn shuttle
#

well this sorta sucks

#

wish there was a block nophysics tag or something

chrome beacon
#

It's a build tool

#

Never seen anyone call it a framework

mild kelp
#

Ok... Minestom.... I NEED someone to make it for me

chrome beacon
#

Minestom has a great api

subtle folio
#

What is a minestom

chrome beacon
#

A server implementation

subtle folio
#

oh neat

#

i’ll have to check that out

chrome beacon
supple elk
#

Why can I not do this?

chrome beacon
#

It says. You can't use generics there

supple elk
#

yeah ik, I'm asking why generics can't be used

chrome beacon
atomic zodiac
#

What is a generic

atomic zodiac
smoky anchor
#

Hello good people of this server.
I am once again coming here to seek help.
The method World.spawnFallingBlock(Location, BlockData) spams the logs every time I spawn a falling block.
Any way to prevent the spam ?
https://prnt.sc/Xi5FMaOl0Yy2

smoky oak
#

seems like you're spawning the same falling block multiple times

frigid rock
#

does anybody know why even if the balance is higher than the "money to give" it is sending me the "your balance is too low etc.."?

smoky oak
#

okay 1st off, ```java exists

#

?paste

undone axleBOT
frigid rock
#

hang on

#
if(balance >= moneyToGive){
bm.removeBalance(p.getUniqueId(), moneyToGive);
bm.addMoney(target.getUniqueId(), moneyToGive);
p.sendMessage(ChatColor.GREEN + String.valueOf(moneyToGive) + "$ has been given to " + target.getName());
target.sendMessage(ChatColor.GREEN + String.valueOf(moneyToGive) + "$ has been given to you by " + p.getName());
}else{
p.sendMessage(ChatColor.RED + "Your balance is too low to give to " + target.getName() + " " + String.valueOf(moneyToGive) + "$");
}```
smoky anchor
smoky oak
frigid rock
#

nope i didnt

desert tinsel
#

a tutorial for: how to get a custom head?

smoky oak
smoky oak
echo basalt
#

I can assure you that creating block data has nothing to do with the entity's uuid

smoky oak
#

im guessing on that one

smoky anchor
#

Went through the spawn code and found that if the the CraftEventFactory.callEntityChangeBlockEvent is not cancelled it spawns a new entity.
Then it spawns a new entity again.
If I understood this correctly it would be a problem in Bukkit (?).
Can somebody confirm ?
https://prnt.sc/PN7OeZU77H75

faint cypress
#

I created a BukkitRunnable and then store it as BukkitRunnable myRunnable;. I then do myRunnable.runTaskAsynchronously(plugin) to start it.

If I try to cancel it from the outside via myRunnable.cancel(); it doesn't stop. How can I force an async runnable to stop from the outside or is this not possible?

eternal oxide
#

inside teh async while (!isCancelled())

#

your code has to have an opportunity to exit too

carmine token
#

i have a question regarding the chunk format: https://wiki.vg/Chunk_Format
I dont understand how i can interpret the single valued pallet, because it only has 1 value and in the description it says, that "Data Array sent/received is empty"
so where is the chunk data?

desert tinsel
#

I have that code for BlockPersistentDataStorage: ```java
Player p = (Player) sender;

        if (p.getTargetBlockExact(5) != null){
            Block block = p.getTargetBlockExact(5);
            BlockState state = block.getState();
            if (state instanceof TileState) {
                TileState tileState = (TileState) state;
                PersistentDataContainer data = tileState.getPersistentDataContainer();
                if (data.has(new NamespacedKey(plugin, "easter"), PersistentDataType.INTEGER)){
                    if (data.get(new NamespacedKey(plugin, "easter"), PersistentDataType.INTEGER) == 2){
                        data.set(new NamespacedKey(plugin, "easter"), PersistentDataType.INTEGER, 1);
                        p.sendMessage("Acum nu mai e item special");
                    }else{
                        data.set(new NamespacedKey(plugin, "easter"), PersistentDataType.INTEGER, 2);
                        p.sendMessage("Acum e un item special");
                    }
                }else{
                    data.set(new NamespacedKey(plugin, "easter"), PersistentDataType.INTEGER, 2);
                    p.sendMessage("Acum e un item special");
                }
            }else{
                p.sendMessage("32");
            }
        }else{
            p.sendMessage("1");
        }```I put ``p.sendMessage("32"); to detect where is the problem, and when I execute the command it says me 32, why??
#

why block.getState() doesn't instanceof TileState?

chrome beacon
#

Well are you looking at a block with a tile state

desert tinsel
#

what blocks are?

desert tinsel
#

but is possible to give a persistent data to a default block?

eternal oxide
smoky anchor
eternal oxide
#

Its not a Bukkit bug. No one else is having duplicate Entities spawning

exotic jetty
#

hi im trying to make an npc with mojang maping but al the tutorials i find are bad. does annyone know a good one for 1.18?

eternal oxide
#

Are you using a spigot fork?

smoky anchor
#

I am using Spigot I built using Build Tools downloaded from the spigot website

eternal oxide
#

Then no idea. What you are describing should be impossible

smoky anchor
#

You can try it yourself.

eternal oxide
#

Many here have use FallingBlock spawning for many years with no issues

smoky anchor
#

I know

eternal oxide
#

Which means it has to be something to do with how you are doing it. Your code

smoky anchor
#

I literally removed every single plugin and kept only the bare minimum to spawn it with a command.
Could you please try it yourself to confirm that it is my mistake ?

eternal oxide
#

Try what? I have code that spawns a falling block. It works fine

smoky anchor
#

Then I am utterly confused.

eternal oxide
#

?paste

undone axleBOT
eternal oxide
smoky anchor
#

I will create a brand new server and use the code you sent to see if it still does that.
wait a sec

eternal oxide
#

are you using teh full spigot and not just CraftBukkit?

grim ice
#

anyone knows JDA?

smoky anchor
eternal oxide
#

those UUID errors in your SS are displayed before your server even starts?

smoky anchor
#

No
I logged in
Broke dirt block and started left clicking
The error showed: 1 error for 1 block thrown

eternal oxide
#

um, seems you are correct. in 1.18.2

smoky anchor
#

So where should I report the bug

#

Also thank you for confirming

eternal oxide
#

?stash I think

undone axleBOT
eternal oxide
#

nope

#

there is a forum

desert tinsel
#

I have that code: java @EventHandler public void Click(PlayerInteractEvent e){ if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){ Player p = e.getPlayer(); Block block = e.getClickedBlock(); if (BlockMethod.isSet(block)){ if (BlockMethod.getBlock(block).isEastered()){ p.sendMessage("Haolo, ce bine e"); } } } }
But I get 2 message like "Haolo, ce bine e". Why?

eternal oxide
#

looks right

desert tinsel
#

but if I build with another block, it says only 1 message

jagged thicket
#

np!

desert tinsel
#

wdym?

eternal oxide
#

I see, you are testing for right click

proper notch
desert tinsel
#

with what i need to replace it?

delicate lynx
#

make your command class extend TabExecutor, add the tab method

#

in that method you can set your own subcommands to be shown on tabbing

#

not extends, implements, oops

grim ice
#

it would be cool if we can dm

proper notch
#

Erm why? why can't you just ask here?

grim ice
#

less embarassing

#

just do it LOL

delicate lynx
#

because this is the spigot discord, which is for spigot. asking in the main discord would yield more help more likely

delicate lynx
#

ah, I misread sorry

proper notch
#

I'd prefer not to DM so u can just ask me in general or smthing, or in jda since im in there as well

grim ice
#

how to get a guild that the bot is in

exotic jetty
#

?npc

proper notch
#

JDA#getGuildById

grim ice
#

doesnt wokr

#

its null

#

AccountType.CLIENT doe

proper notch
#

So you're using a selfbot?

grim ice
#

ig? dunno whats that

proper notch
#

Update your JDA to latest and use a bot account

grim ice
#

well i cant get the bot to be in the server i wanna get

delicate lynx
#

that can easily get you banned

exotic jetty
#

annyone know a good tutorial for making an npc with mojang maping in 1.18?

grim ice
proper notch
#

I'm not going to, nor is 99.9% of people, help you self bot.

#

Selfbots are not supported behaviour and can work differently to bot accounts. Additionally they are explicitly disallowed by discord.

clear pike
grim ice
#

Alright, thank you for telling me

delicate lynx
clear pike
#

hmm

delicate lynx
#

free work is not going to get you anywhere

quaint mantle
#

and make sure you obtain permission from the original author(s) if you can port their plugin

quaint mantle
#

ah ok

clear pike
#

he said he's busy and developing a plugins call split or steal, so he tell me to do that by myself

echo basalt
#

best part is that the src is not written in english

#

I also don't see anything version-specific so it could work on 1.18

chrome beacon
#

Oh no

echo basalt
#

it's just not tested

chrome beacon
#

Let me guess it's german

echo basalt
#

nah

#

slavic language

chrome beacon
#

Odd it's usually german

echo basalt
#

lithuania or sometihng idk

#

🤡

fossil lily
#

Whats happening here?

clear pike
#

hmmm rip...

zealous osprey
#

need to make it atomic I think ?

zealous osprey
chrome beacon
clear pike
#

to update an outdated plugins to newest version, what should we do?

#

edit api code?

chrome beacon
#

First test it and see if it still works

clear pike
#

not working after 1st rankup

chrome beacon
#

If not find what isn't working and start there

clear pike
#

since it's 1.15

#

my server 1.18.2

chrome beacon
#

I doubt this is a version error

fossil lily
#

How can I cancel a task?

chrome beacon
#

Just like you did above

#

?scheduling I recommend using the BukkitRunnable. Learn more about it here

undone axleBOT
clear pike
#

who know any good rankup gui plugins like that I shown..?

zealous osprey
#

make i to AtomicInteger and the array to AtomicReferenceArray<String> ?
Not sure about the array part though

#

ah yeah, whoops

chrome beacon
#

But why though

earnest forum
chrome beacon
#

Not that

#

Just use the BukkitRunnable api

faint aspen
#

Could not find spigot-api-1.18.2-R0.1-SNAPSHOT.jar (org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT:20220324.024706-24).
Any idea? The build.gradle: https://pastebin.com/ZZ6vFKKy

fossil lily
#
                BukkitScheduler scheduler = Bukkit.getScheduler();
                scheduler.runTaskTimer(instance, task -> {
                    if (i.equals(7)) {
                        task.cancel();
                        return;
                    }
                    p.sendMessage(arrayList.get(i[0]));
                    i[0]++;
                }, 0L, 20L * 60L);

What do these 3 values mean at the end?

earnest forum
#

2nd one is delay

#

and the 3rd one is how frequently in ticks the task should be ran

#

that's not 2 values that's a multiplication

fossil lily
#

yea i mean that

#

okay thanks

earnest forum
#

usually just keep the delay to 0

#

and inside a bukkitrunnable you can just do this.cancel()

fossil lily
#

So this will repeat every 60 ticks right after 20 ticks?

earnest forum
#

no

#

60 seconds

fossil lily
#

oh

zealous osprey
#

Hehe, tf is happening here, it worked just fine and now it's spitting out this error.
Could someone explain ?

fossil lily
#

thats seconds

earnest forum
#

20 ticks is 1 second, so 60 * 20 is 1 minute

fossil lily
#

OH

quaint mantle
#

60 seconds, multiplied by 20 to differentiate the ticks

earnest forum
#

yes

last ledge
#

yo PercentageBlocks.getInstance().reloadConfig(); aint working for me

#

idk why

fossil lily
#

got it

#

thanks

echo basalt
earnest forum
zealous osprey
zealous osprey
fossil lily
earnest forum
#

bukkit runnable

fossil lily
#

oh

#

okay

earnest forum
#

BukkitRunnable

sterile token
earnest forum
#

if you want to cancel from outside the runnable, you can store it as a BukkitTask

BukkitTask task = schedule runnable here

fossil lily
#

here we go

#

thanks guys

zealous osprey
sterile token
earnest forum
#

there's no point going to docs for a small query like this

zealous osprey
earnest forum
#

no warning just needed help cancelling a runnable

sterile token
#

😂

#

The same now that I realize it is the custom

flat olive
#

can you check if a user has permission from a database

#

if so how

zealous osprey
stuck flax
#
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        event.getPlayer().getServer().broadcastMessage(ChatColor.translateAlternateColorCodes('&', "&8[&a+&8] &7" + event.getPlayer().getName()));

        ItemStack profile = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta meta = (SkullMeta) profile.getItemMeta();
        meta.setOwningPlayer((OfflinePlayer) event.getPlayer());
        profile.setItemMeta(meta);
        meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&d" + event.getPlayer().getName() + "'s Profile"));

        event.getPlayer().getInventory().addItem(profile);
        event.getPlayer().sendMessage("test");
    }

i dont get the player head but i do get the test message, no console errors

zealous osprey
#

you might need to wait a few ticks before giving the player an item ?

delicate lynx
#

try to give another simple item instead?

stuck flax
#

I'm gonna try playerspawnlocationevent

quaint mantle
#

playerjoinevent sometimes needs to be delayed for a couple ticks to see results

stuck flax
#

fixed it by using a bukkitrunnable

echo basalt
#

NMS question

#

what's the difference between the 2 pathfinder goals any EntityInsentient has?

flat olive
#

can you check if a user has permission from a database

eternal oxide
#

Player#hasPermission

sterile token
spring pike
#

how can I count the amount of blocks of the same type on one blockface?
e.g I got a sponge and want the number of sponges below it

flat olive
#

also how can I pass in an object or my database into the .hasPermission method

#

Can I?

#

I asked how to use hasPermission with a database

#

I want to access whatever permissions I store into the database

#

if player has permission that’s inside of database {}

eternal oxide
#

Permissions are given to a player, you check if the player has a permission as we just said.

quaint mantle
#

if you store a permission string in a database, it should be as trivial as just querying and checking with hasPermission

proper pawn
#

Hello!
I'm trying to give a npc a custom skin but I'm having some trouble doing so.

gameProfile.getProperties().put("textures", new Property(config.getString("npcs.jeff.texture"), config.getString("npcs.jeff.signature")));

I saw this code in a tutorial so I tried it but it doesn't seem to change the skin. Am I forgetting something? Please let me know.
Thank you!

I'm getting the skin texture and signature from this site:
https://mineskin.org/

flat olive
eternal oxide
#

why?

flat olive
flat olive
eternal oxide
#

There is a full blown permission system already

flat olive
#

Yeah I’d rather make my own simple system.

eternal night
#

isn't luck perms the defacto standard for perms

#

🤔 reinventing the wheel here for no reason seems pretty not clever, especially with how good luckperms is

quaint mantle
#

yeah, you have a lot of features, a web editor, api, etc.

#

no point in just doing all that again

#

but ig he could be making a simple system just to understand how it works

flat olive
#

I’m making my own web editor and my own simple permissions command/editor. My goal is to make a fully custom server

#

Also I understand how it works I just have never queried with a database before in Java only JavaScript so idk how to access columns, or if I can with .hasPermission(permissions)

eternal night
#

Check up on the JDBC then

#

I can throw you the baeldung article

#

if you want

flat olive
#

Yes please

eternal night
flat olive
#

Thanks

eternal night
manic delta
#

Guys can someone teach me about doing a local mysql I mean I know how mysql works and all that but I don't know how to make the plugin put the database in its plugin folder and use it database for my plugin

eternal night
#

A plugin does not "put a mysql db into its plugin folder"

quaint mantle
#

research SQLite or h2

rapid rock
#

its a command

eternal night
#

mysql is a service you run on your local system

rapid rock
#

any idea

eternal night
#

yea ^^ sqlite or h2 for a file based db

flat olive
eternal night
#

it is a warning that you implemented (probs CommandExecutor) ? Without the not null annotations

#

Yes

flat olive
#

Okay thanks

eternal night
#

generally, maven/gradle are the standart

#

basically anything should be usable through them

manic delta
eternal night
#

Yea that isn't mysql

flat olive
#

I’m going to learn then

eternal night
#

that would be sqlite or h2

manic delta
#

Uhh

#

Okay i will search

eternal night
#

Do you mean like a database.db file

manic delta
#

Yes

eternal night
#

Yea

manic delta
#

Like luckperms

eternal night
#

sqlite or h2

manic delta
#

Or authme

#

Ok thanks

#

I don't know what it was called sorry

eternal night
#

No worries 👍 I believe luckperms uses h2 by default

manic delta
eternal night
#

I'd go with h2 ye

manic delta
#

Ok thanks

rapid rock
#

line 28:
this.getCommand("grant").setExecutor(new GrantCommand());

eternal night
#

sounds like you failed to register your command in the plugin.yml

rapid rock
#

i forgot that existed for a second 💀

eternal night
#

😅

rugged cargo
#

List<Block> lastTwoTargetBlocks = player.getLastTwoTargetBlocks(null, 6);
this function doesn't ignore water and lava blocks. is there a way to make it do that?

eternal night
#

the passed set iirc contains materials that should be ignored

rugged cargo
#

when i replace the null with a set of materials with Material.WATER it doesn't behave as expected

#

and its hard to describe what its actually doing

#
    public static BlockFace getBlockFace(Player player) {
        Set<Material> transparent = new HashSet<>();
        transparent.add(Material.WATER);
        transparent.add(Material.LAVA);
        List<Block> lastTwoTargetBlocks = player.getLastTwoTargetBlocks(transparent, 6);
        if (lastTwoTargetBlocks.size() != 2) return null;// || !lastTwoTargetBlocks.get(1).getType().isOccluding()) return null;
        Block targetBlock = lastTwoTargetBlocks.get(1);
        Block adjacentBlock = lastTwoTargetBlocks.get(0);
        return targetBlock.getFace(adjacentBlock);
    }
#

this is my function right now

#

could it be that my distance is less than 100?

tranquil viper
#

How should I go about making an anti kill boosting system? I want to stop giving kill rewards if you kill the same person 3 times in a row

echo basalt
tranquil viper
tardy delta
#

why multiple values lol

#

oh well

tranquil viper
#

I need to store if the same person is killed 3 times

#

By 1 player

#

and if so set them on a cooldown for rewards

earnest forum
#

you could make a custom class that holds 2 values

tardy delta
#

map<uuid, customthing>

#

where the custom thing holds a map of people which you have killed and the amount of time

earnest forum
#

you could try do map<UUID, map<UUID, int>>

tardy delta
#

basically thatt ye

#

too lazy to think just came home

tranquil viper
wary harness
#

Do dev need to provide source code of there premium plugin?

#

are they obligated by any rules

earnest forum
#

it's always public using a decompiler

eternal night
#

Well, if you want to be serious about GPL 3

earnest forum
#

if you have the jar

tardy delta
#

i have heard that you could obfuscate it a little

rugged cargo
eternal night
rugged cargo
#

i assume its something in the pom

wary harness
eternal night
#

an minecraft ?

wary harness
#

I heard before they was some licence which demands any mod to be open source

#

or something like that

eternal night
#

spigot is licensed under GPL 3

tardy delta
#

i will never understand those types of licences 🥺

eternal night
#

GPL ?

#

I mean, it is pretty fun

tardy delta
#

all those licences lol

eternal night
#

GPL is generally pretty good imo

#

ELv2 is also cool

rapid rock
#

any

rugged cargo
#

does papermc have special things that spigot doesn't? I'm trying to use Player#getTargetBlockFace(), but its not in my spigot api lib

rapid rock
#

replacement for Inventory.getTitle in 1.18

eternal night
#

no

#

inventories no longer have their title

#

the InventoryView does

#

which you can access from your event

rugged cargo
echo basalt
#

Yeah seems like a paper thing

rugged cargo
#

damn, that stinks. ok

#

thanks anyways

#

wish i could see implementation

#

if PaperMC is open source i might be able to

eternal night
#

paper is also open source yes

mighty pier
#

public HashMap<Player, Integer> map = new HashMap<>(); how do i access the integer?

eternal night
#

by having the right player instance ?

#

final Integer intFound = map.get(player)

mighty pier
#

k

#

why final integer

eternal night
#

idk I just like final

#

I would also suggest to use the players UUID instead of the instance itself

mighty pier
#

k

sterile token
#

How can search on google how to do this:

String text = "My name is {name} and i am {age}";

MessageHandler message = MyPlugin.getInstance(). getMessage();

message.replace("{name}", "alex", "{age}", 20).send(text, player);

#

How would i search to do the replace part?

tardy delta
#

how to do what

eternal night
#

👀

sterile token
#

The .replace

#

That what i dont know how to do it

#

I know that for replacing the {} (variables/placeholders) i use Patterns

tardy delta
#

lol why in two chained methods

eternal night
#

The replace depends entirely on what the fuck MessageHandler is

tardy delta
#

wait wha

sterile token
eternal night
#

Well strings have a .replace method ?

sterile token
#

My goal is to when you don .replace("{varname}", var-value) its get replaced in the text you passing

#

But i dont know how to be able to have more than 1 var

#

Do i explained?

eternal night
#

You want your method to have a variable amount of arguments ?

tardy delta
#

varargs?

eternal night
#

pretty much

#

but idk what they are after in the first place

onyx fjord
#

how do you stop certain path from minimizing in gradle shadow

sterile token
#

Wait i will use the translator

tardy delta
#

his explenation is weird

#

let play minecraft now

eternal night
#

What paths minimize in gradle shadow 🤔

sterile token
#

Im already told im not native speaker

tardy delta
#

im not one either

eternal night
#

👀

sterile token
#

Oh sorry

#

I paste the spanish messae

#

Im so dumb

tardy delta
#

smh why do i never build a house

#

lmao

sterile token
#

I want to know how I can do the replace(variables, values) method with many variables, something like this:

replace({var-1}, "value-1", {var-2}. "value-2")

It's what I don't know how to do

eternal night
#

Google "java vargargs"

sterile token
#

Oh ok

tardy delta
#

String... is what you want

sterile token
#

And them how do i parse each value to each var?

eternal night
#

however, you will have to enforce an even amount of arguments

sterile token
#

That what i dont know

eternal night
#

varargs is just a string array

tardy delta
#

and Validate(args.length % 2 == 0) kekw

sterile token
#

But im confused how to parse each var with each value

tardy delta
#

for loop is the thing

#

the first two args are args[0] and args[1] etc

sterile token
#

Yes

tardy delta
#

so match those

sterile token
#

so i will have to do a loop and match every 2 args together

tardy delta
#

smth liek

for (int i = 0; i < args.length; i++) {
  str.replace(args[i], args[i + 1]);
  i++;
} ```
#

not sure about the indexing

sterile token
#

I will try

#

Thanks to you and LynPlay

fleet pier
#

Anyone that can give me spigot 1.8.8 repo gradle?

eternal night
#

the instructions for maven should suffice

fleet pier
#

yuh sure

fleet pier
#

thanks man

sterile token
#

Sorry for tag

fleet pier
#

yea

#

its a string array if you do ...

sterile token
#

Allr thanks

#

Because intellij oblise me to use @VarsArgs annottation with String... bla

tardy delta
#

lol

sterile token
#

so tricking that i will use String[] bla

#

🤔

tardy delta
#

String... is easier

eternal night
#

a lot easier

tardy delta
#

lol where is the time that you could find enchanted books with a fishing rod

#

only catching damn fishes

fleet pier
#

now i get this

proper pawn
#

Hello!
I'm trying to give a npc a custom skin but I'm having some trouble doing so.

gameProfile.getProperties().put("textures", new Property(config.getString("npcs.jeff.texture"), config.getString("npcs.jeff.signature")));

I saw this code in a tutorial so I tried it but it doesn't seem to change the skin. Am I forgetting something? Please let me know.
Thank you!

I'm getting the skin texture and signature from this site:
https://mineskin.org/

fossil lily
#
p.sendMessage(ChatMessageType.ACTION_BAR + "" + ChatColor.GRAY + ChatColor.BOLD + "You have received Starter Dagger");
#

??

eternal night
#

Not quite how you do that 😅

fossil lily
#

:(

#

I googled it and this is how people did it

eternal night
#

definitely not how people did it

#

you have to convert your stuff into bungee chat components

fossil lily
#

ah

#

okay

sharp bough
sharp bough
#

i have a right click event

#

it runs just fine all the way to the end

#

but then the server crashes?

#

java.lang.AssertionError: TRAP

eternal night
#

basically invalid state

sharp bough
#

and it doesnt always happen

#

just sometimes

eternal night
#

spigot caches if the item is empty

vague oracle
#

You also need to delay the hiding the npc

sharp bough
#

according to google thats causing the error?

#

even the sout item removed works

eternal night
#

basically you are removing an item in the interact event

#

e.g. the server now thinks the player is interacting with AIR

#

which is impossible

proper pawn
# vague oracle Do you send a meta data packet?

Not sure what you mean exactly. I'm new to creating npc's
This is my code:

Player player = (Player) commandSender;
MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
WorldServer world = ((CraftWorld) Objects.requireNonNull(player.getWorld())).getHandle();
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), strings[0]);
FileConfiguration config = MyFirstPlugin.configfile.getConfig();
gameProfile.getProperties().put("textures", new Property(config.getString("npcs.jeff.texture"), config.getString("npcs.jeff.signature")));
EntityPlayer npcPlayer = new EntityPlayer(server, world, gameProfile);
npcPlayer.b(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), player.getLocation().getYaw(), player.getLocation().getPitch());
PlayerConnection connection = ((CraftPlayer)player).getHandle().b;
connection.a(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a, npcPlayer));
connection.a(new PacketPlayOutNamedEntitySpawn(npcPlayer));
connection.a(new PacketPlayOutEntityHeadRotation(npcPlayer, (byte) (player.getLocation().getYaw() * 256 / 360)));
connection.a(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.e, npcPlayer));
eternal night
#

spigot has a check for that, which you ran into

sharp bough
#

tf

#

should i delay it 1 tick?

fleet pier
#

Anyone knowing why gradle isnt building my dependencies into jar file?

vague oracle
eternal night
#

Just cancel the event

#

@sharp bough

vague oracle
#

I do 200 ticks but up to you

eternal night
#

then the server does not continue with its logic

fleet pier
# fleet pier Anyone knowing why gradle isnt building my dependencies into jar file?
plugins {
    id 'java-library'
}

group 'club.practicing'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven {
        name = 'bungeecord-repo'
        url = 'https://oss.sonatype.org/content/repositories/snapshots'
    }
}

dependencies {
    api project(':cloud-builder-shared:cloud-builder-shared-cloudproxy')

    compileOnlyApi 'net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT'

    compileOnly 'org.projectlombok:lombok:1.18.22'
    annotationProcessor 'org.projectlombok:lombok:1.18.22'
}

This is my build.gradle

eternal night
#

and you don't run into this

sharp bough
#

just like that?

muted idol
#

hey there, quick question. does anybody know how i would go about getting the rgb colors of items in the inventory?
is there any list or something.

eternal night
#

You are fine if you cancel the event at any point iirc

sharp bough
#

aight ig thanks

eternal night
#

try it, I might be wrong

eternal night
#

not building the dependency into a jar file ?

#

wouldn't you want the dependency to be shadowed into the fnal jar

desert tinsel
#

where and how can I save my Objects with their pharams, because when my plugin is disabled, all objects missing

eternal night
#

You may override onDisable in your plugins main class

desert tinsel
eternal night
#

and then save the required state to whatever storage solution you want

#

ye

tardy delta
#

why are there that kind of idiots that do super.onDisable()

eternal night
#

you'd want to load your data from your persistent storage

echo basalt
#

you probably need to parse the game's textures yourself

frigid rock
#

does anybody know wtf is wrong with this? i made like 4 plugins today and they worked fine

eternal night
#

you aren't in a method

#

probably a ?learnjava moment

frigid rock
#

wtfff

#

bruh.

#

i think that much coding got my brain burning

eternal night
#

😅

daring vector
#

Sorry to interrupt, quick question:
Is there a way to detect a player clicking with the mouse scroll wheel? (player being in survival, preferably)

frigid rock
#

i think that there is a click type called like "middle"

#

like ClickType.MIDDLE

#

just make a playerclickevent listener and check if the clicktype it's ClickType.MIDDLE

fallen agate
#

I have a plugin using 1.8 as the minimum version, is it possible to support rgb on 1.16+?

daring vector
#

great, thank you 😊

frigid rock
#

because rgb was implemented in 1.16 i think

fallen agate
#

"is it possible to support rgb on 1.16+?" - my quote
no, my plugin will only allow rgb if the version is 1.16+

frigid rock
#

ohhh

#

just check if Bukkit.getServer().getClass().getPackage().getName().contains("1.16)

#

idk if it will work but try

fallen agate
#

Okay thanks

frigid rock
#

np ^^

eternal night
#

well

#

that would only work for 1.16 versions

fallen agate
#

wouldnt that be checking if it is 1.16

#

yeah

frigid rock
#

oh yeah that's true

vast sapphire
#

How are hypixel mini game servers ran? They obviously didn’t manually setup 3000 bungee servers so how would I create miniature servers for a mini game?

frigid rock
#

you could make like a list of versions (under 1.16) , and then check if the package name contains each key

#

idk, never made something like that

eternal night
#

you can start servers with virtualisation software like docker

#

obviously you don't have to either

fallen agate
eternal night
#

you could very much build your own solution that provisions servers just on plain disk

fallen agate
#

might work

eternal night
#

the package name contains a bit more than just the version number

fallen agate
#

oh

eternal night
#

also iirc it is not seperated by dot

#

but by underscore

vast sapphire
#

The 3rd machine is older running a less powerful i3 but it should make do for miniature servers that don’t require much resources

eternal night
#

I mean yea, that is a bit more work if you want to build it from the ground up

vast sapphire
#

And right now I have batch files with a script to handle restarts

#

Probably not the best way but it works fine for the servers I have now

#

But when I make mini games I can’t have 100 batch files running small servers

fallen agate
sonic idol
#

how do I setup multi version for my plugins so the plugin works on 1.17.1 1.18.1 yada yada yada

eternal oxide
#

if using NMS you use modules

sonic idol
#

How do I do modules

#

I am using NMS

sonic idol
#

IJ

echo basalt
kind hatch
#

You wouldn't even need proprietary software. You could setup a network like that with docker or kubernetes.

vocal cloud
#

Probably would still need something proprietary for the starting and stopping of sub servers

simple silo
#

Is there a world name length limit?

river oracle
simple silo
#

Alright, sounds fine

subtle folio
#

is there any fun plug-in challenges/ideas that i can make

echo basalt
#

sound engine

#

unless you aren't a literal god at minecraft

#

then just make a minigame

#

You can also just mess around with pathfinders

#

I made satanic cows with those

sacred prairie
#

is there any way to make an armor stand direct invisible? because i am using this funktion to summon an armor stand:

ArmorStand stand = (ArmorStand) e.getEntity().getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
stand.setVisible(false);
stand.setGravity(false);
stand.setMarker(true);

but its always a short time visible when i spawn the armor stand

echo basalt
#

Marker should be an actual entity now

#

otherwise you can just spawn it at 0,0,0 and teleport it

sacred prairie
sacred prairie
echo basalt
#

try it and see

sacred prairie
#

ok

#

it cant have a custom name

#

😦

#

i just use the teleport method

warm crag
#

        if(event.getBlock().getType().equals(Material.POPPY)) {
            Location blockLocation = event.getBlock().getLocation();
            opiumCoords.add(blockLocation)```
Atm I have this setup so when a player places a poppy it gets the coords and adds it to an array. However, when I restart the server the array will clear so how do I make it not clear
sacred prairie
#

you can write it into an config file or on an data base

fossil lily
sacred prairie
#

i cant show you an example rn cuz i am not on my pc rn

vast sapphire
echo basalt
#

and adds it to dns and such

vast sapphire
#

I could make something like that with java for

#

Javafx *

echo basalt
#

You don't need javafx

#

just make a command-line thing

#

but it is quite technical

#

I think I have it written somewhere

vast sapphire
#

So are every one of those servers port forwarded? Or something like that

echo basalt
#

all the servers are linked to like 100 bungees

#

those 100 bungees are handled via dns

#

so yeah in a way

vast sapphire
#

I could use a router api to add port forwarding profiles when a server is created

#

And have the port increment by one each time it’s created

echo basalt
#

however you want

#

I think the version I have in hand uses some sort of cloudflare api

vast sapphire
#

Or that

#

Could I take a look at yours if possible?

echo basalt
#

I don't think I can share it without getting shot

vast sapphire
#

Oh lmao I’ll think of something then

echo basalt
#

yeah I don't want minigame networks going at my kneecaps

#

I can give you some ideas but that's about it

flat olive
#

How can I use rest api in Java to check if my database has been updated?

vast sapphire
flat olive
#

Okay thanks

vast sapphire
#

Or check the length of values and if it’s increased then do something

upper dock
#

for my friend...
he's having pom.xml import errors for 1.8.8

vast sapphire
upper dock
vast sapphire
#

?pastr

upper dock
#

?paste

vast sapphire
#

?paste

undone axleBOT
vast sapphire
#

Yeah paste it there

upper dock
vast sapphire
#

Everything seems fine, are the dependencies valid? Does maven show any errors?

chrome beacon
#

Why not use the api?

chrome beacon
#

Do you have an antivirus that might mess with it

quaint mantle
#

i have windows defender which is disabled

quaint mantle
#

it says

#

it cant find the files

#

but i can see them in file explorer

delicate lynx
#

nuke your .m2\repository folder

quaint mantle
#

lol

delicate lynx
#

close intellij first, delete folder, then reopen and try again

quaint mantle
#

ok

delicate lynx
#

I've had many problems in the past with dependencies randomly not resolving and clearing out the folder fixed it

eternal oxide
#

dev-SNAPSHOT?

#

and worldedit will not be in the spigot repo

#

in your pom <artifactId>spigot</artifactId> You need to run buildtools to make spigot

delicate lynx
#

I have no problems loading the dependencies from your pom.xml

eternal oxide
#

I'm guessing he's set to local only or somethign silly

#

there is an offline mode in IJ

#

I don;t use it so no idea where

tardy flame
#

You just waste time by removing all your libraries cached

#

There are many methods that can relocate them

#

And deleting it will only cause problems if you have multiple projects

torn shuttle
proper pawn
#

?paste

undone axleBOT
torn shuttle
#

don't have the paste because I don't have the error

proper pawn
#

I'm trying to get started with creating npc's but when I try to create a simple command that spawns a npc I get this error:

Caused by: java.lang.ClassNotFoundException: net.minecraft.world.entity.player.Player

This is my code: https://paste.md-5.net/ovifopayul.java
Could someone please help me?

slim kernel
noble lantern
slim kernel
noble lantern
#

ah

#

if your looping through 3 axis

#

you need to loop through them sequentially

#

sec

slim kernel
#

Choco said that yesterday but didnt respond afterwards anymore

#

@noble lantern

vagrant stratus
#

Is it possible to create custom statistics or am I stuck making a system from the ground up 👀

noble lantern
vagrant stratus
#

Like one's MC uses, though I'm not sure if possible to even extend those without NMS 😐

#

net\minecraft\stats

noble lantern
#

ohh i see so like extending the Enchantment class but for Statistics

vagrant stratus
#

Ye

noble lantern
#

i would assume you need NMS ive never seen any statistic class hmm

vagrant stratus
#

damn

#

guess I can just yoink those classes 👀

#

I know org.bukkit.Statistic is a thing, but I wasn't sure if there was anything else

noble lantern
#

nah theyre stored server side

vagrant stratus
#

There's server-side stuff, but I wasn't sure if there was a way for plugins to handle custom ones or not

vocal cloud
#

The client still needs to know them because you'd need to have a translation. I imagine you can't easily add one without a mod

vagrant stratus
#

hmmm, it wouldn't be something viewable in the stats menu... however I guess in this case I'll have to do something custom, annoying

slim kernel
#

Choco said smth yesterday but Idk how I can fix that

vagrant stratus
#

?paste

undone axleBOT
slim kernel
#

below

vagrant stratus
#

I'm using that for my own thing lol

vagrant stratus
patent horizon
#

how do i get a skull texture from an offlineplayer object?

chrome beacon
#

You send a request to mojang

#

Or do you just want to apply it to a skull

patent horizon
#

yes

chrome beacon
#

Ah then use SkullMeta

misty current
#

what exception should be thrown if a class has a constuctor with invalid arguments? I'm making sort of an api and I need some classes to have a 0 arg constructor

#

with should be thrown i mean what exception should I make my code throw

chrome beacon
#

illegalargumentexception

misty current
#

thanks

worldly ingot
#

Guava's Preconditions.checkArgument() will do that automatically based on a condition if you'd like. We use it in CB all the time

#

(Guava being shaded into Bukkit)

vagrant stratus
misty current
#

i've probably phrased my question wrong

#

I have an abstract class that the api user can extend

#

and they must have a declared constructor with no args

#

then my code tries to create a new instance with the newInstance() method from Class with no args

#

and if it fails, it should throw an exception letting the developer know they did a mistake

worldly ingot
#

In which case you can't really enforce that without re-throwing an exception wrapping the reflective operation exception at runtime

#
try {
    // create the instance reflectively
} catch (ReflectiveOperationException e) {
    throw new IllegalStateException(e, "Missing no-arg constructor");
}```
noble lantern
misty current
#

that's what I am doing basically

worldly ingot
#

ISE is probably the most appropriate one here unless you want to make your own exception

misty current
#

i was wondering what should I throw as a wrapper of the original exception

misty current
#

so illegalstateex it is

#

thanks

worldly ingot
vagrant stratus
#

spigot also doesn't support mixins :p

worldly ingot
#

Well, it's just not provided

#

You can shade Mixins on your own if you want, no? Or does the server require it?

noble lantern
noble lantern
vagrant stratus
vagrant stratus
wary harness
#

I am trying to add nuvotifier dependency to my maven but looks like that is not working from some reason

#

I tried to clone it from github but I am not sure what do I need to run in gradel to install it to my m2 repository

#

any one can help with that

worldly ingot
#

Did you add the Jitpack repository?

wary harness
worldly ingot
#

That artifact looks to be old

#

In fact, the dependency information is all over the place

#

It suggests the following:

<project>
...
    <repositories>
        <repository>
            <id>jitpack</id>
            <url>https://jitpack.io</url>
        </repository>
        ...
    </repositories>
...
    <dependencies>
        <dependency>
            <groupId>com.vexsoftware</groupId>
            <artifactId>nuvotifier-universal</artifactId>
            <version>2.6.0</version>
            <scope>provided</scope>
        </dependency>
        ...
    </dependencies>
...
</project>```
but that dependency doesn't look like Jitpack would service it because that repository doesn't exist, and the NuVotifier/NuVotifier repository doesn't have any artifacts as far as I can tell
wary harness
worldly ingot
#

I mean you can try that artifact if you want

wary harness
#

I tried to clone it

wary harness
worldly ingot
#
<dependency>
    <groupId>com.vexsoftware</groupId>
    <artifactId>nuvotifier-universal</artifactId>
    <version>2.6.0</version>
    <scope>provided</scope>
</dependency>```
#

If that doesn't work, you can build (and I think install) it locally by going into your command line in the project root and running ./gradlew build

#

(or however you execute a file. For windows, you need the ./)

wary harness
#

2.6.0 not working for me

#

I tried

#

to do ./gradlew build

#

and didn't show up in my m2 folder

worldly ingot
#

You can add the file manually as well.
mvn install:install-file groupId=com.vexsoftware artifactId=nuvotifier-universal version=<version_number> packaging=jar file="path/to/file.jar"

#

(in the command line)

wary harness
#

oh ok

#

where does this looks

#

file="path/to/file.jar"

#

do I need to do C:/

worldly ingot
#

Wherever the built file for NuVotifier is

wary harness
#

ok

worldly ingot
#

If you run that command while you're in the build directory of the project, you can just do file=NuVotifier.jar (or whatever the file is called)

#

It's relative, or you can do absolute with C:/, yeah

quaint mantle
#

anyone know?

#

(im new to plugins xd)

earnest forum
#

have you put the repo in

#

repository

sonic idol
#

my plugin is causing this error

#

and does not load in plugin list

delicate lynx
#

post plugin.yml

glossy barn
#

but pls give us your plugin.yml

quaint mantle
sonic idol
#

name: Watch-Kitten
version: '${project.version}'
main: me.anticheat.WatchKitten
api-version: 1.8.8
authors: [ KittenPixel ]
depend: [ ProtocolLib ]
description: The kitten is always watching! 👀

glossy barn
#

its the eyes emoji it's not recognising

#

remove that @sonic idol

terse raven
#

where on windows do i check again which spigot version i have compiled through build tools already?

solved
its under C:\Users\<User_Name>\.m2

sonic idol
#

ok

flat olive
#

How do you edit the way ender pearls work in your server? So I can make taliban pearls, cross pearls, pearling through fence gates, etc

sonic idol
#

oops forgot Protocol Lib too I was changing my anti cheat version

sterile token
#

?paste

undone axleBOT
torn vale
#

you can basically see the code in my message -.-

sterile token
#

Allr and then delete the message, because if not you spam the chat

#

Allr

torn vale
sterile token
#

How i create an item stack based the id? - Thanks

quaint mantle
torn vale
#

thank you :)

earnest forum
#

you don't need to do get server I don't think

flat olive
#

How do you edit the way ender pearls work in your server? So I can make taliban pearls, cross pearls, pearling through fence gates, etc

#

Anyone know?

atomic zodiac
noble lantern
#

allahu akbar

sterile token
flat olive
#

yeah not them bastards that chop peoples heads off

#

ender pearls

formal radish
#

Hey there. Im trying to make a custom crafting table for specific items in my plugin. Now not worry about the whole custom recipes and stuff because ive already figured out how im going to accomplish that, when I create a new inventory with the inventory type of WORKBENCH none of the vanilla crafting recipes work. I can place stuff in and such but no result will come out of it. Any way to fix this? Or any way to add recipes to the specific workbench inventory?

ebon coral
#

How would I adapt a center location to move a region? Like let's say there is a cornerOne in top left and cornerTwo in bottom right- and I want to move them solely based off the center location (and it recalculates it)... what would I do??

worldly ingot
#

Well if you're moving relative to the center, just modify the coordinates equally on both corners

#

If you want to move x-5, y+2, z+7, doing that on both corners will move your center by that amount without changing dimensions at all

#

I might be misunderstanding your question though

ebon coral
#

Well my problem is I don't know how I'd find the difference between the two coordinates and if it'd bug it out

#

Say like x-x but it returns a negative- it'll mess it up

#

The given corner location is always random so I have to find the difference somehow

#

Oh wait I'd get the distance from the corners center and then I'll adapt it to my corners and center- okay let's see.

cold pawn
#

Anyone have any suggestions as to how I can get or make a h2 sql utils that makes it easier to use h2?

fleet pier
#

What would be the name of the packet to set a prefix for the player via BungeeCord?
e.g. BungeeTabList+ also does this via Packets otherwise this would not work or does someone know better?

karmic void
#

help

#

pls

fleet pier
#

maybe send whole server log

#

in a hastebin`?

worldly ingot
#

more relevant there

rugged cargo
#

for this, List<Block> lastTwoTargetBlocks = player.getLastTwoTargetBlocks(null, 100);
passing a Set<Material> of with water in it should make it ignore water right? and just have it act normally just with a "block blacklist"?

#

ill say ive tried this and it doesn't act how id expect. its hard to describe its behavior though.

#

i wish the paper function player.getTargetBlockFace was in spigot, so badly

worldly ingot
#

Well, there is a rayTrace() method which can get you a target face iirc

#

but yes, a Set of water would ignore water

rugged cargo
#

k, well it doesn't work as id expect. so maybe ill just try to figure out what rayTrace() does, and figure it out from scratch

rugged cargo
#

the only thing i am worried about is putting incorrect data into it, and having it not work as id expect. but thats part of it i guess

worldly ingot
#
@Nullable
public static BlockFace getTargetBlockFace(Player player) {
    Location location = player.getEyeLocation();
    RayTraceResult result = player.getWorld().rayTraceBlocks(location, location.getDirection(), 100, FluidCollisionMode.NEVER);
    return (result != null) ? result.getHitBlockFace() : null;
}```
#

Should work fine

rugged cargo
#

oh!

quaint mantle
#

🍜

rugged cargo
#

result has getHitBlockFace!

worldly ingot
#

Yessir

rugged cargo
#

hm. alright. thanks! ill let you know if it works out! thanks!

worldly ingot
#

Both are nullable though in the case that a block wasn't hit

#

So, yeah, check for null

quaint mantle
#

the most energetic plugin dev

rugged cargo
#

im excited about all this stuff

worldly ingot
#

I'm almost certain Paper's method is just a default interface method that calls exactly that above

rugged cargo
#

my prior programming projects have been so dull, minecraft dev makes it WAY more fun for me

#

it worked just fine! thanks for the help there

worldly ingot
#

o/

quaint mantle
worldly ingot
#

I don't hate myself that much, sorry

past brook
#

does "world.generateTree(pos, TreeType.TREE);" queue up blocks if a chunk the tree intersects with isnt loaded

quaint mantle
#

Looking for help with LootCrates plugin for 1.18.2

#

It doesnt reward players with items after the player opens a chest. Anyone know how i would go about that?

#

is this development related

#

Yes.

#

ok there are 2 loot crates plugins which one

#

send the repository

#

im guessing you would listen to this

#

then just add the items to the players inventory

#

Im so confused as i dont know how to develop java. Is there a way to DM me and help with this a bit further if possible?

#

i mean this channel is for development

#

i mean i could just pr this to the plugin if i felt like it

#

which i might

#

are you sure you have it configured right?

#

I have a loot chest already setup, i can add items, set the key ect but when a player opens it and lands on the item they dont get it.

#

I have items set at 90% and as low as 4% chance

#

Imajin, is the info to edit in the crates.yml?

#

i would assume

quaint mantle
#

HumanBehindScreenUsesHisIndexFingerToLeftClickAndTriggerFunctionalityWithinHisComputerToDrinkFromAMilkBucketInAMovingPictureGame

#

Event

#

I wouild post my code but i cant

#

Items:
- ==: lootcrate.objects.CrateItem
ID: 38717
Item:
v: 2975
type: APPLE
Chance: 90.0
MinAmount: 8
MaxAmount: 16
isDisplay: true
Commands: []

#

This is one part of it and it doesnt have a give option for the chance amount

formal radish
summer scroll
#

First, you need to check for the Material of the consumed item

quaint mantle
#

you dont need custom inventories

summer scroll
#

Or you can directly go check it with pdc

quaint mantle
#

ohhhh

#

wait what?

#

are you doing the custom crafting table purely for design

formal radish
#

no i want to be able to only craft the things specific for my plugin in it

quaint mantle
formal radish
#

thats what I wanna do

#

issue is theres no result anyways

#

like

#

if I put in the crafting recipe for a diamond sword

#

nothing comes out

quaint mantle
#

ohhhhh ok i get it

#

send your code

#

that wont even work because vvvv

worldly ingot
#

e.getItem() is an ItemStack, Piotr. You want to compare the type. There's also no guarantee it has ItemMeta

#

and getLocalizedName() probably isn't what you want

tranquil viper
#

Is there an event (or way) to put someone on a shield cooldown?

Ie. if you crit hit someone it puts them on a shield cooldown

formal radish
#
    private static void createGUI() {
        inv = Bukkit.createInventory(null, InventoryType.WORKBENCH, Component.text("Blue Light Saber"));
    }
//farther down in the code
event.getPlayer().openInventory(inv);
quaint mantle
#

@worldly ingot i havent seen u in here for a while what happened

formal radish
#

o0h wait

quaint mantle
formal radish
#

how so

quaint mantle
#

i mean you could but

worldly ingot
summer scroll
#

choco always here xd

formal radish
#

I couldnt find anything on the api after looking for a few hours

quaint mantle
#

this is what you want mb

#

wait nvm

#

ok im just not understanding

formal radish
#

its okay lol

quaint mantle
#

you want a custom crafting table just for crafting your items

formal radish
#

yes

quaint mantle
#

ok i got it

tranquil viper
#

Like hypixel skyblock if you're familiar with that?

formal radish
#

So what I wanted to do was have it so when you interact with the block it would open a workbench inventory and disable all the unneeded recipes. Thing is no recipes work in general, like vanilla ones dont work in it either

tranquil viper
quaint mantle
#

his custom

tranquil viper
#

So then just event.setCancelled() when opening the crafting nventory

tranquil viper
#

Then open yours

quaint mantle
#

ok i got it

#

@formal radish im sure you just creating a crafting table then listen to the InventoryClickEvent

tranquil viper
#

No.

quaint mantle
#

no im literally explaining how it works

tranquil viper
#

Why would you listen to InventoryClickEvent?

formal radish
tranquil viper
#

Check if the interaction is on a crafting table

#

right click block

#

if so then you can open your gui and cancel the event

quaint mantle
#

what

formal radish
#

its on right click

tranquil viper
#

I meant right

formal radish
#

so have the gui open and then cancel it or the other way around

quaint mantle
#

i was like explaining to him how to check for his custom item recipes

#

so can i continue

formal radish
#

but @quaint mantle I do understand where youre going with it

#

so no need to explain

quaint mantle
#

cause then you can check the workbench is a custom one by the inventoryholder (the block)

#

ykw you just made me curious

#

imma write my own plugin for dis

tranquil viper
#

Oh if you know the block you're crafting that's easy

quaint mantle
#

thats not what i meant :P

tranquil viper
#

Meaning you can only craft a blue light saber, correct?

formal radish
#

yeah its a holder

#

no