#help-development

1 messages · Page 945 of 1

lilac dagger
#

they should work just fine

#

they'll have the same internal and therefore they'll be stackable

lost matrix
#

In that case you should store custom data in your ItemStack, and check if the interaction ItemStack has this custom data.

#

?pdc

lost matrix
#

Dont store ItemStacks and check for .equals() or .isSimilar()
It will often times be messed up by small differences like durability or the name.

surreal wind
#

ok

lilac dagger
#

plus mutability might give you weird bugs somewhere in the code

wary harness
#

What version was e.getEntity().getItem() added to ExpBottleEvent

#

I ask for backwards compatibility

lilac dagger
#

you can skim through spigot api to see

#

see which of the abstraction has getitem

wary harness
lilac dagger
#

yeah

wary harness
#

lol

lilac dagger
#

or just lower your maven version till it stops working

wary harness
#

is there no any logs or something were we could check when was something added

lilac dagger
#

probably on the repository

tepid flicker
#

Like anyone to specify in detail

#

and what program I need to use

lost matrix
tepid flicker
abstract iron
#
    @Override
    public void onEnable() {
        ItemStack pooScraper = new ItemStack(Material.WOODEN_SWORD,1);
        ItemMeta pooScraperMeta = pooScraper.getItemMeta();
        pooScraperMeta.setDisplayName("§6Poo Scraper");
        pooScraperMeta.setLore(List.of("The legendary weapon of old"));
        pooScraper.setItemMeta(pooScraperMeta);

        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "Scraper"), pooScraper);
        recipe.shape("CCC","CXC","CCC");
        recipe.setIngredient('X', Material.WOODEN_SWORD);
        recipe.setIngredient('C', Material.COCOA_BEANS);

        Bukkit.addRecipe(recipe);
    }

Hey learning how to mess with custom recipies rn
how do I specifically make it use a full durability wooden sword for the recipe

tall dragon
#

pooScraper? 😂

abstract iron
#

Cause I dont want them to be recrafting the same sword over n over

abstract iron
lost matrix
wary harness
#

Could I extend ExpBottleEvent and make custom one

tepid flicker
wary harness
#

which I could my owne method of adding itemstack

#

?

tepid flicker
lost matrix
lost matrix
# tepid flicker in the core folder?

I dont want to discourage you, but compiling this plugin wont help you getting started with development.
This plugin is open source to help other developers. If you are a user, then you should consider just buying the plugin and supporting the devs work.

tepid flicker
#

yeah I was afraid I'd get this response

abstract iron
#
        ItemStack plainWoodenSword = new ItemStack(Material.WOODEN_SWORD, 1);
        RecipeChoice.ExactChoice woodenSwordChoice = new RecipeChoice.ExactChoice(plainWoodenSword);
        recipe.setIngredient('X', woodenSwordChoice);

@lost matrix so something like this?

lost matrix
tepid flicker
tall dragon
abstract iron
lost matrix
tepid flicker
#

thanks

lost matrix
tacit arrow
#

cket

tepid flicker
lost matrix
#

There is none. gradle.git is not a thing.

tepid flicker
#

so what file do I need to clone using git?

lost matrix
#

I wont give any more specific steps for this.
Tell me what you researched and what you need help with. Ill gladly answer general programming questions.

tepid flicker
#

Like most Spring Getting Started guides, you can start from scratch and complete each step or you can bypass basic setup steps that are already familiar to you. Either way, you end up with working code.

To start from scratch, move on to Set up the project.

To skip the basics, do the following:

    Download and unzip the source repository for this guide, or clone it using Git: git clone https://github.com/spring-guides/gs-gradle.git

    cd into gs-gradle/initial

    Jump ahead to Install Gradle.

``` I can't find a similar file in the plotsquared similar to this https://github.com/spring-guides/gs-gradle.git
tall dragon
#

thats because its not a file

#

thats the repo itself

tepid flicker
lean pumice
#

Who could come to the phone to give me a bug that I don't know how to solve?

tall dragon
#

no

tepid flicker
#

and copy that?

#

Im unsure what to copy

tall dragon
echo basalt
#

isn't this as simple as cloning the repo on intellij and pressing build disappointment

#

Could be that the version is invalid

late sonnet
#

or maven cache issues

tepid flicker
wide coyote
#

what jar

echo basalt
#

that's a damn old version of authlib iirc

tepid flicker
# tall dragon

now that I have copied it, what is the next step that I need to research?

tall dragon
#

how to compile it

tepid flicker
wide coyote
tall dragon
echo basalt
#

solid chance yeah

wide coyote
#

ah man i am going insane

#

i swear to god i've seen some message about authlib

tepid flicker
flint warren
wide coyote
#

ah

#

thats rude

flint warren
#

😦

wide coyote
flint warren
#

nono its fixed

echo basalt
#

am I tripping or is crafty compiling without an ide

wide coyote
#

aight

tepid flicker
tall dragon
echo basalt
echo basalt
wide coyote
#

that works too

flint warren
tepid flicker
tall dragon
#

do u have intellij?

tepid flicker
#

yea

tall dragon
#

open the project in intellij

tepid flicker
tall dragon
#

jup

tepid flicker
#

where is the clone in my computer

tall dragon
#

-,-

#

wherever u ran the clone command i suppose

slender elbow
#

just pay for the project

tepid flicker
# tall dragon -,-

I opened the whole files in intellij including the other files(every file that was in the hub)

tall dragon
#

then u should be able to double tap ctrl, a "run anything" prompt should come up, where u can input ./gradlew build

tepid flicker
tall dragon
#

it made one

tepid flicker
#

gradle bin zip I got

echo basalt
#

jesus this is a 5 second thing

tall dragon
echo basalt
#

click here, paste the git url and it'll open the project for you

#

Then on the far right click on gradle and run build

#

that's it

tall dragon
#

pretty sure they just cant find the output jar now

#

;d

echo basalt
#

Gradle makes a build folder

#

The jar's on the libs folder

tepid flicker
echo basalt
#

that's my module

#

it's like a sub project

#

PlotSquared uses modules too

tall dragon
#

yours will be called Bukkit

tepid flicker
#

and build.gradle.kts

tepid flicker
tall dragon
echo basalt
#

gradle my beloved

tall dragon
tepid flicker
#

what is gradle daemon lol

#

wait

#

I think I got it

#

thanks for the help but the plugin doesn't work :/

#

but I am really thankful for the time you guys spent helping me

lilac dagger
echo basalt
#

it likes to build caches

#

Usually the first build of the day takes minutes and any following ones take seconds

slate surge
#

Thnx, adding a wait of 20 ticks fixed it, it was just that the server was shutting down before the player gets transferred to another server

lilac dagger
#

ah that makes sense

#

wait, what are the advantages of gradle?

#

i'll use chatgpt

slender elbow
minor garnet
#

does anyone know how rotate the head of an armor stand based on 2 vectors, one for direction and one for inclination ?

eternal oxide
#

you mean pitch and yaw?

minor garnet
#

not necesarilly, those blue and green line are diferrents vectors, let me show a video

eternal oxide
#

why do you have two vectors?

minor garnet
lilac dagger
#

well, do you want to sum the 2 vectors and make the head look in the direction the vector is pointing if the head is the origin?

eternal oxide
#

there is no tilt on a head

#

tilt = roll

slate surge
lilac dagger
#

oh so one vector is for roll?

slate surge
#

Maven>>>Gradle

echo basalt
#

Personal preference

#

Man came here and decided to choose violence

tender shard
lilac dagger
#

oh

minor garnet
#

basically it is a cube that rotates, and one has a steering phase and the other an inclination phase

lilac dagger
#

you can transform the vectors into blockfaces and then apply rotations based on the blockfaces

#

the magnitude can be transformed into the initial rotation speed

eternal oxide
#

I have no idea what that video was showing

echo basalt
#

wtf is youtube recommending me

minor garnet
# eternal oxide I have no idea what that video was showing

basically it is a physics cube that rotates, one has a vector on one side and the other side of the face which involves the orientation and direction

basically it's a physics cube that rotates, one has a vector on one side and the other side of the face that involves orientation and direction, irrelevant, think about the cube, I want to make the head of the armor stand have a block and that its rotation would fit inside this cube

echo basalt
#

bro left his mic on

tardy delta
#

i always forget to turn my music off when making a vid

slate surge
tardy delta
#

xml doesnt suck?

#

you from another planet?

echo basalt
slate surge
#

Better than .gradle

echo basalt
tardy delta
slate surge
minor garnet
rapid vigil
tender shard
tender shard
lilac dagger
eternal oxide
#

I like the self registering, but it's not the correct way

tardy delta
#

listener shouldnt be aware of its surroundings

minor garnet
slate surge
lilac dagger
#

what does the vector 3f in an armor stand stand for?

echo basalt
#

3 floats

slate surge
#

aka

lilac dagger
#

if it's x, y, z rotation then you should have a good idea about how you can fit your vectors

slate surge
#

3 floating people

lilac dagger
#

you just need a formula to see how much of the vector can rotate your cube

minor garnet
lilac dagger
#

i think i worked with it, i think it's in radians?

#

is there anything you struggle with? is it the formula to convert a vector into one of the vector 3f coordonate?

#

the direction vector does not convert easily into a head rotation

#

you can only infer based on the direction how the head rotates

#

i also assume when your objects collide you'll want to change the head rotation

#

there's more creativity involved into minecraft physics than realism

slow granite
#

hello guys

#

how to remove the original minecraft enchantment lore from the item?

#

im trying to make "custom" lores

#

my code:

@Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("picareta")) {
            if (!(sender instanceof Player)) {
                sender.sendMessage("Esse comando só pode ser executado por jogadores.");
                return true;
            }

            Player player = (Player) sender;

            // Criar a picareta de diamante
            ItemStack pickaxe = new ItemStack(Material.DIAMOND_PICKAXE);
            ItemMeta meta = pickaxe.getItemMeta();
            meta.setDisplayName("§rPicareta de Diamante"); // Nome do item

            // Remover completamente a lore original
            meta.setLore(new ArrayList<String>());

            // Adicionar a nova lore personalizada
            List<String> lore = new ArrayList<>();
            lore.add("§7Eficiência 10");
            meta.setLore(lore);

            // Definir a meta no item
            pickaxe.setItemMeta(meta);

            // Adicionar o encantamento de eficiência 10
            pickaxe.addUnsafeEnchantment(Enchantment.DIG_SPEED, 10);

            // Dar a picareta para o jogador
            player.getInventory().addItem(pickaxe);

            player.sendMessage("Você recebeu uma picareta de diamante com eficiência 10!");
            return true;
        }
        return false;
    }```
#

spigot version: 1.8.8

lilac dagger
#

itemmeta.removeEnchant

#

or maybe a flag to hide enchants

echo basalt
#

THere is a flag to hide enchants

river oracle
#

!?whereami

echo basalt
#

fuck

vocal cloud
#

gottem

slow granite
echo basalt
#

uH

#

learnjava moment

#

The method is addItemFlags

#

the class is ItemMeta

slow granite
echo basalt
#
public class Whatever {

  private final int whatever;

  public void doWhatever() {}

  public int getWhatever() {
    return this.whatever;
  }
}
#

The class is Whatever

#

It has a field named whatever of type int

river oracle
echo basalt
#

It has a method named doWhatever of return type void
It has a method named getWhatever of return type int

slow granite
#

xD

#

thanks ❤️

echo basalt
#

Here, let me give you a better example
pastes if-else-if-else 4 million line chess

wet breach
#

super easy to use

rough drift
#

^^

tardy delta
#

its only extra bloat

lost matrix
#
{
  "Is this compact and readable": {
    "possible answers": ["yes", "no"],
    "correct answer": "yes"
  }
}
<?xml version="1.0" encoding="UTF-8" ?>
<Is_this_compact_and_readable>
  <possible_answers>
    <item>yes</item>
    <item>no</item>
  </possible_answers>
  <correct_answer>wtf</correct_answer>
</Is_this_compact_and_readable>
echo basalt
#

nah I like my config files as a spreadsheet

lilac dagger
#

i don't wanna know how they'll look

#

probably not as bad as i'm imagining

echo basalt
#

real time validation

lost matrix
#

.txt best config format, dont change my mind

echo basalt
#

if your input is invalid the entire spreadsheet changes to red

#

and all text colors change to the background color

#

so you can see it's invalid

#

also if you type "clear" in any of the fields it clears the whole config

lilac dagger
#

lol

ocean hollow
#

what do I need to enter in Damageable#setDamage. Does it mean how much durability or how much is left? or does it damage the item for that number?

lost matrix
ocean hollow
#

thanks

lilac dagger
#

0 up to maximum durability

#

the maximum is held by material

lost matrix
#

*for now

forest moss
#

How can i make "event.setTotalCookTime(1)" also cook or consume the charcoal properly? because, for example, 64 iron and 64 coal consume 1 carbon for every 1 iron ore? @EventHandler
public void onFurnaceStartSmelt(FurnaceStartSmeltEvent event) {
if (autoSmeltEnabled && event.getBlock().getState() instanceof Furnace) {
event.setTotalCookTime(1);
}
}

lost matrix
#

This is basically a property of the ItemStack which is put into the Furnace.
Those values are currently hard coded.

#

Something something fuel value

ocean hollow
#

why does it give me this?

lost matrix
# ocean hollow

What... try allocating a String variable and see if this changes the warning

ocean hollow
wet breach
ocean hollow
#

no

wet breach
#

what is the symbol on the left?

ocean hollow
wet breach
#

probably shouldn't use that

#

since you can't guarantee it not being null

#

and you are saying its not null

#

well given you don't check

ocean hollow
#

so if I add NotNull it will also throw an error

wet breach
#

no, but if it that section is in fact null, using that annotation will hide the problem that is the case

#

and misleads you on the issue because it starts throwing trap errors

#

now your annoation is useless if you do that, anyways the purpose of such annotations is mostly for api's where you are saying this thing here is not null and should never be null and if it is we have big problems 😛

#

shame the IntelliJ tries to get everyone to use it without knowing its purpose

#

but anyways, your unsubstituted expression is happening because of a string

#
"Unsubstituted expression" means that IntelliLang isn't able to analyze the string being passed/assigned to a variable because it's neither compile time constant nor annotated with an @Subst annotation. There's also an option in the inspection configuration (Settings -> Errors -> Pattern Validation -> Validate Annotated Patterns | "Flag non compile-time constants expressions") that allows to exclude such expressions from static checks.
#

this also relates to @PrintFormat annoation as well if something were to pass something to it

lost matrix
granite owl
#

can someone redirect me to the documention for commands? i know that i can inherit some command base class to create a new instance and register the command at runtime

#

which allows for fancy things like auto completion

#

but its like 3years ago i did it and i lost my old projects

rare rover
#

why does the client give shitty exceptions

#

gives you only the first line ;-;

#

gives me nothing to go off of

ember dew
#

What's the procedure for specifying a custom directory such as "mod/config/errors.yml" instead of just putting it in its default directory(/mod/errors.yml)

        customConfigFile = new File(getDataFolder(), "custom.yml");
        if (!customConfigFile.exists()) {
            customConfigFile.getParentFile().mkdirs();
            saveResource("custom.yml", false);
         }

        customConfig = new YamlConfiguration();
        try {
            customConfig.load(customConfigFile);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }```
lost matrix
ember dew
#

Oh

hollow vessel
#

when PlayerFishEvent is called? Because when I'm trying to figure it out i can't

#

or what is the best event to do some actions when player uses fishing rod and bobber is on the ground

ember dew
tardy delta
lost matrix
hollow vessel
ember dew
lost matrix
#

Let me find an example

surreal wind
#

how can i make a custom potion item?

lost matrix
surreal wind
#

ty

lost matrix
#

The generated config:

#

Im using a library called Ambrosia for this

#

Which i wrote smileybolb

ember dew
echo basalt
#

Not a fan of that style of config

lost matrix
#

Which part bothers you? 🙂

echo basalt
#

The fact it hides code flow

#

I hate anything that does runtime generation or reflection-based hackery

#

I worked for a server where every command and listener was initialized automagically

lost matrix
#

Serialization without reflections is an absolute nightmare

echo basalt
#

Codec 🗿

lost matrix
#

I dont use reflections or code generation for anything else than serialization

lost matrix
echo basalt
#

Im past my days of gsoning out entire pojos and praying the database knows how it works

#

And then crapping the bed because it faced an abstract class

lost matrix
#

Im past my days of writing my entire code twice. Once for the object itself and once to manually searilze each field.

#

My serializer can serialize interfaces and abstract classes

surreal wind
#

guys i tried finding if i can do brewing stand custom recipes but i cant find anything, can i make brewing stand recipes?

lost matrix
#

BrewingStands work in a unique way. iirc there are no recipes for them.

surreal wind
#

So technically it is possible it is just really hard?

lost matrix
#

I think you just tinker with the brew events

surreal wind
#

It's too advanced for me im trying to make wine

#

i think i will just use a crafting table recipe

lost matrix
#

Another idea:
Use barrels to ferment berries and sugar 🙂

surreal wind
#

so i put the berries inside and wait?

wanton comet
lost matrix
lost matrix
lost matrix
surreal wind
#

dont worry i think i will be fine

#

the holograms are the only thing i dont know how to do

lost matrix
#

🤨

#

What

slender elbow
#

sus

lost matrix
#

Show your code

ember dew
eternal oxide
#

paper

surreal wind
#

@lost matrix It doesn't let me pass ItemStacks as an ingredient for a recipe...

lost matrix
#

You are not developing a plugin so this is the wrong channel

surreal wind
lost matrix
lost matrix
lost matrix
# surreal wind where do i specify the recipechoice

Te make the lingo clear:

Declaring a variable:

int x;

Initializing a variable:

x = 10;

Defining a variable: (Declaring + Initialization)

int x = 10;

Creating an instance of a class (often synonymous to Object)

new SomeObj();

Declaring a variable and initializing it with a new instance of a class:

SomeObj something = new SomeObj();
surreal wind
#

ty, im new to java i only know python and c#

ember dew
surreal wind
#

it's way harder

#

@lost matrix do you know how i can make a berry bush that when it grows it gives me grapes?

flint warren
#

best way to naturally spawn entities would be to increase spawn rate and replace the entity in an entityspawnevent given a certain chance right?

surreal wind
orchid hinge
#

?ui

#

?gui

lost matrix
surreal wind
#

ok

#

is there any way i can add a tag in the brewing barrel to identify it later?

eternal night
#

?pdc

surreal wind
#

what event is used when i right click a block?

worthy yarrow
#

Uhhhh

#

Don't quote me, but I believe you have to derive that from playerInteractEvent

lost matrix
surreal wind
#

and the one that happends when an inventory pops up?

#

cause i want to cancel that for the brewing barrel

worthy yarrow
surreal wind
#

ty

worthy yarrow
# surreal wind ty

btw, spigot api in google will give you the answers to "what event does what", just try searching for (action)Event

surreal wind
#

oh

#

ty

worthy yarrow
surreal wind
#

how can i find out from the InventoryOpenEvent if i clicked on a brewing barrel and not any barrel?

worthy yarrow
surreal wind
#

i tried but i can only check if its a barrel inventory

#

or a chest's

worthy yarrow
#

Then you're probably gonna have to get into block states

#

Unless I'm just wrong ofc

lost matrix
#

You need to get the holder and check if its an instance of BlockInventoryHolder.
I would honestly just cancel the PlayerInteractEvent and open my own inventory instead.

#

*if you want a custom inventory for that

surreal wind
#

no, i want to right click once with a berry and once with a sugar, no gui needed

young knoll
#

Why use the open event then

acoustic pendant
#

I'm trying to get the item clicked from a menu which is a head, above 1.13 works fine but when I'm in a lower version and try to click that item and check if it is the same than the item in a hashmap (Which is the same) it says that the hashmap is null I already have a method that detects the version and sets "PLAYER_HEAD" or "SKULL_ITEM" so the error only happens when the item is the SKULL_ITEM id from 1.12 and less, does someone know why this happen?

young knoll
#

Just use the interact event

worthy yarrow
#

^ , but he also needs to specify the inventory being a brewing barrel

surreal wind
#

how would i use the interact event?

young knoll
#

Cancel that

worthy yarrow
#

Check that the interaction is with your brewing barrel, cancel the vanilla action(s), and proceed with whatever logic you want

surreal wind
young knoll
#

Well it probably identifies itself somehow

#

PDC maybe

worthy yarrow
#

The interaction event should be enough to return what block was interacted with

surreal wind
#

event.getClickedBlock() gives me a block but i doesnt have a name

#

should i compare this to the brewing barrel itemstack?

worthy yarrow
#

Right you're not checking for a name

#

you should be checking for a block/block type I believe

surreal wind
#

do i need to make a custom block for this to work?

round finch
#

do you mean casting?

worthy yarrow
surreal wind
#

like this?

lost matrix
#

A Block object will never be equal to a String object

surreal wind
#

ye ik

#

just a placeholder

ocean hollow
#

how can I iterate this values from config?

worthy yarrow
#

Now you should just be able to check for the block

surreal wind
worthy yarrow
#

Yk I don't even know what a brewing barrel is...

surreal wind
#

its an itemstack i made

#

a barrel

#

with a custom name

worthy yarrow
#

Mmmm

young knoll
#

You should add PDC to it when placed

worthy yarrow
#

So it's a custom block, when clicked with sugar / berry it does something?

surreal wind
#

it's just an itemstack

#

no block

#

do i need to make one?

young knoll
worthy yarrow
#

Itemstack can mean literally any material

#

Just do what coll said when it's placed

surreal wind
#

ok

worthy yarrow
#

It seems you are trying to make a custom / interactive BLOCK, so just continue with what you're doing now, when it's placed add pdc to the block as to maintain the fact it's a custom block

#

also make sure to note that these are two different functions so keep your concerns separated

hollow vessel
#

is there maybe some event like TridentThrowEvent? or i just must use PlayerInteractEvent? what would be the best event to check when player throw trident?

young knoll
#

ProjectileLaunchEvent

hollow vessel
#

thanks

hollow vessel
#

is there any other event?

#

I need event that is called when player throw trident

tall dragon
#

ProjectileLaunchEvent#getEntity()#getShooter

lost matrix
#

You can get the ProjectileSource from the Projectile and check if its an instance of Player

hollow vessel
#

thank you very much guys!!

granite owl
#

if i want to write my commands myself without using the plugin.yml for it to create and register them at runtime, should i work with the BukkitCommand class or the CommandExecutor interface and why?

lost matrix
#

You would have to inject your commands directly into the command map.
I would probably just use an existing command api.

granite owl
#

there are methods to register the commands without injecting them with reflection though

#

from the docs i assume that BukkitCommand calls its superclass Command which registers them to the map already?

#

by name

lost matrix
#

If you have questions regarding adventure, then the paper discord is probably a better place to ask

surreal wind
#

guys can i add pdc to blocks?

young knoll
#

?blockpdc

undone axleBOT
young knoll
#

Unless it’s already a tile entity

#

Then you can

surreal wind
#

is there any other way

#

cause idk how to use this

#

or just mark a block

eternal oxide
#

Sharpie

lost matrix
#

If its a TileState (Like a Furnace, Chest, Barrel etc), then they automatically have a PDC.
You just need to get their BlockState and cast it to TileState.

surreal wind
#

ok

granite owl
#

apparently i do need to get the map via reflection

#

should i then register it using the plugin.yml and set this commands executor instead?

lost matrix
#

You dont need the plugin.yml at all if you just throw your commands into the command map.

granite owl
#

but im using reflection rn

#

isnt that discouraged?

junior anvil
#

how to get nms entity from bukkit entity

young knoll
#

Cast to CraftEntity and getHandle

#

Obligatory: why tho

inner mulch
#

is there an event for when the server is fully initialized and players are able to join?

eternal oxide
#

1 tick after your onEnable finishes

inner mulch
#

thanks

junior anvil
young knoll
#

^

junior anvil
#

yeah, i got it

#
List<Player> nearbyPlayers = getNearbyPlayers(entity.getBukkitEntity().getLocation(), range);
        if (!nearbyPlayers.isEmpty()) {
            Player randomPlayer = nearbyPlayers.get(new Random().nextInt(nearbyPlayers.size()));
            bossEntity.setTarget(((CraftPlayer) randomPlayer).getHandle());
        }

i hope this is right

#

getNearbyPlayers returns a List of players

lost matrix
#

Write an aggro system. Attack the player that does the most damage and let it cool down a bit every tick 🙂

junior anvil
#

Ooh, interesting idea

lost matrix
#

Map<UUID, Double> should be enough to track damage dealt

echo basalt
#

call of duty zombies style where it just attacks the nearest player

young knoll
#

That’s just normal mob behaviour

echo basalt
#

eh

#

Don't mobs have a cooldown?

autumn ingot
#

does anyone know why setTongueTarget on Frog doesn't work? i expected it to stick its tongue out at the specified mob; but its not doing anything

#

not sure if im misusing the method or something

inner mulch
#

how do i get the port and host of my minecraft server? (with the api)

inner mulch
#

yes, i guess?

drowsy helm
#

Bukkit.getServer().getAddress(); but doesn't really mean much if you are behind a proxy or rerouting the port

#

why do you need to get it through the api?

inner mulch
#

dynamic proxy

#

i dont want to have it all in the config

#

do you know the event for when the server is disabled? is there something called after ondisable?

drowsy helm
#

if its dynamic you would probably benefit more by having some orchestrator

#

pretty sure onDisable is the last event called

lost matrix
drowsy helm
#

if you use docker or kubernetes you can have all servers on 25565 then just use that api instead

lost matrix
drowsy helm
#

yeah it does, there wont be any solid methods that give public ip

#

unless you ping an outside server

#

even still, a proxy or router could reroute the port to another external port, making any port thats given through api useless (unless everything is on the same LAN)

torn shuttle
#

I have a very important question

#

which fornite dance would play best with a mc model

#

serious answers only

sullen marlin
#

Flossing

#

What other dances are there even

torn shuttle
#

fucked if I know, I never saw any media about it

#

I just want to meme with my new custom model plugin

#

alright as per requested by md5 I'll make a flossing animation for a showcase

#

md5 can I put a quote on there with you saying this dance is lit af?

sullen marlin
#

This dance is lit af

torn shuttle
#

perfect

#

alright off I go to make models floss

sullen marlin
#

Instructions unclear, dentists pleased with tooth hygiene

torn shuttle
#

my dentist is very happy with me

#

I just paid him 4k for braces

#

and change

echo basalt
#

mine quoted me 5k

#

told him to eat shit

torn shuttle
#

I paid that guy 2k to quote you 8k

#

he ripped me off!

worthy star
#

is it possible to get the file.yml node from the key of it?

lilac dagger
#

why is file.yml a node?

worthy star
#

no i mean like

something: 'id'
```, i want to be able to get the 'something' from the 'id'
worthy star
lilac dagger
#

getsection .getkeys false

#

returns the key list

worthy star
#

its not a section

lilac dagger
#

in yml everything is a section

worthy star
#

oh

#

anyway

lilac dagger
#

if you are in the root just do config.getkeys(false)

worthy star
#

i mean
i have the key, but i don't have the node.. how can i get the node from the key? each node has its special key

hazy parrot
#

You get lists of key

#

Iterate trough it

#

If value == your value

lilac dagger
#

and then get the section ^

hazy parrot
#

Return that key

#

But tbh that design doesn't sound right to me

lilac dagger
#

i assume node = section

worthy star
#

can i get the list of sections, and check if section's key = the key i have?

worthy star
#

i see some people calling it nodes

lilac dagger
#

yeah, it all depends but in bukkit they go by sections

torn shuttle
#

man it's not easy to make a steve model floss

lilac dagger
#

3d model?

#

or you're trying to animate the skin somehow?

torn shuttle
#

3d

worthy star
#

for(String section : config.getConfigurationSection("linked").getKeys(false)) { is the section here the path? because not really interested to test it out xd

lilac dagger
#

oh, that's nice

#

it should be doable

lilac dagger
#

linked:
test1: a
test2: b

#

you'll get test1 and testb as strings

worthy star
#

oh nice

#
    public static Object getSection(YamlConfiguration config, Object key) {
        for(String section : config.getConfigurationSection("linked").getKeys(false)) {
            if(config.get(section) == key) {
                return section;
            }
        }
        return null;
    }``` i got this so far
#

not sure if its good

lilac dagger
#

assuming the key is alright it should be good

worthy star
#

ighty thx

#

i'll test it

lilac dagger
#

oh wait

#

you might wanna consider equals when dealing with objects @worthy star

worthy star
#

what?

#

wdym?

#

ohy wait

#

if(config.get(section).equals() you mean?

lilac dagger
#

objects can be different and therefore == would fail

#

yeah

worthy star
#

can i ask JDA related things here?

lilac dagger
#

it should be fine

#

i tried jda but not really that familiar with it

worthy star
#

if i want to get a discord member from his id, should i use User or Member

#

and whats difference

lilac dagger
#

you can look into what methods each provide

#

i'm sure one is for some tasks while the other is for others

remote swallow
#

both will return the same thing

#

they just have different info as one relates to the user as a whole and one relates to then as a member in the discord

vocal cloud
#

The JDA documentation is amazing I highly suggest reading it

worthy star
#

is the member for a member in the dc server or the whole thing?

remote swallow
#

as a member in the discord

#

the id is the same both ways

lilac dagger
#

i just realised i can up the source compiler version to the highest while keeping the target as java 17

#

that's nice

#

i haven't tested it yet

buoyant jasper
#

can anyone help me solve problem with my plugin code its a mess

lilac dagger
#

it depends on how long the mess is

buoyant jasper
#

i tried to get another plugin classes into my plugin

#

is there anyway i can send the code files and you see it tell me what i did wrong

lilac dagger
#

that might be a problem, you can shade them into your plugin

#

unless you manually copied them into your plugin

buoyant jasper
#

i manually copied

lilac dagger
#

i don't know if i can help, it might sound like trouble from the original developer

buoyant jasper
#

i made both plugins

lilac dagger
#

you can just copy the source code into your new plugin

#

or have a common library and use it in either

buoyant jasper
#

i already tried to solve errors with other classes so its all connected with problems

lilac dagger
#

there's no magic button to fix incompatibility issues

buoyant jasper
#

can i send you the code tell me whats wrong

lilac dagger
#

sure

buoyant jasper
#

how can i send the project file

lilac dagger
#

verify then i guess you can zip it and send it, altho if it's large i don't think i'll be able to help you much

worthy star
#
    public static String randomString(int length) {
        String[] chars = new String[]{"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"};
        chars = String.valueOf(chars).split("");

        StringBuilder builder = new StringBuilder();

        for(int i = 1; i < length; i++) {
            builder.append(new Random().nextInt(chars.length));
        }

        return builder.toString();
    }``` is this a proper way to get a random string?
echo basalt
#

You can optimize it a little bit

#

Let's start by not creating a random for each iteration

#

That's expensive

#

We can also use random.nextBytes to generate a bunch of bytes in one go

lilac dagger
#

same for the string array

#

there's nextBytes?

echo basalt
#
public static String createRandomString(int length) {
    Random random = ThreadLocalRandom.current();

    String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    byte[] bytes = new byte[length];

    random.nextBytes(bytes);

    // transform into char[], no need for StringBuilder
    char[] chars = new char[length];

    for (int index = 0; index < length; index++) {
        // clamp the byte to 0-255, then mod it to the charset length so that it doesn't go out of bounds,
        // and just wraps around
        chars[index] = characters.charAt((bytes[index] & 0xFF) % characters.length());
    }

    return new String(chars);
}
#

Sure it'll pick some characters more than others

#

Because uh

lilac dagger
echo basalt
#

the mod

lilac dagger
#

i have this

#

static final char[] STRING_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890".toCharArray();

#

along with this

lilac dagger
#

does it help performance that much?

echo basalt
#

Not really

worthy star
#

it worked, thx

echo basalt
#

You can fix the "some characters are more likely than others" by either making your alphabet length a multiple of 2, or just skipping the byte[] generation part entirely and generating an int for each iteration

lilac dagger
#

oh

echo basalt
#

no clue why I mod the byte it's never gonna go past its own limit

lilac dagger
#

so it has issues, i guess i'll stick to new int per each

echo basalt
#

Yea

young knoll
#

Gotta do a full random utf 16 character each time

lilac dagger
#

good luck displaying that in most contexts

young knoll
#

Hey minecraft supports it

#

Mostly

lilac dagger
#

when i think utf-16 i imagine looking at this

echo basalt
#

avg resourcepack

young knoll
#

Minecraft uses unifont stuffs now so it can display most of them

rough ibex
#

well, minecraft upgraded its unifont

#

its always used unifont

echo basalt
#

can't wait for minecraft 1.21 to release

young knoll
#

Did they use a version from like

#

2005 or something

echo basalt
#

change logs:

  • added native kubernetes support
  • rewrote the whole game in cpp
  • minestom's the native server now
#

actually that's 1.20.6

rough ibex
#

now it's 15

#

maybe before that

young knoll
#

I swear it only supported like

#

Base Unicode before

rough ibex
#

wdym base unicode

#

there is no such thing

#

you mean plane 0?

young knoll
#

Sure

rough ibex
#

minecraft used to only have glyphs for <= U+FFFF

#

plane 0, BMP

#

the unifont update brought Unifont's plane 1 glyphs

#

10000 .. 1FFFF

young knoll
#

Not even all of those worked

rough ibex
#

no, the unifont support back then was also limited upstream

young knoll
#

I remember miscellaneous symbols and pictographs never worked

rough ibex
#

only some of it

#

well, misc symbols & pict is plane 1

#

you may be thinking of Misc Symbols

#

2600 26ff

#

Miscellaneous Symbols is a Unicode block (U+2600–U+26FF) containing glyphs representing concepts from a variety of categories: astrological, astronomical, chess, dice, musical notation, political symbols, recycling, religious symbols, trigrams, warning signs, and weather, among others.

young knoll
#

Is 2600-26ff not < ffff

rough ibex
#

it is < ffff

#

but misc symbols and misc symbols & pict are not the same block

#

the former is plane 0, the latter is plane 1

young knoll
#

Ah I see

#

Dingbats is plane 0, those also never worked

rough ibex
#

the latter has a lot of emojis

#

only some of dingbats

#

upstream unifont at the time was not complete

young knoll
#

Yeah makes sense

#

It’s nice having the expanded character set, even if I don’t need nearly that many

rough ibex
#

meh, I made my own font

#

-with these characters, before minecraft imported unifont 15

#

I just don't really have a name for said font.

young knoll
#

Unifont

#

Wait no that’s taken

rough ibex
#

the first name was EUCF

#

extended unicode character font

#

and then it was EXTD, EXTenDed

#

now I'm trying on Rhos but I'll likely renege

young knoll
#

I didn’t realize we now have like

#

100k+ private use characters

rough ibex
#

mhm

#

and some people still use chinese

young knoll
#

Lol

#

I think OR does

rough ibex
#

hypixel does

#

I think I might go back to EXTD

young knoll
#

Tbf hypizel only has the 6400 private use characters

#

But that should still be plenty so

rough ibex
#

I don't think so

young knoll
#

?

rough ibex
#

Why can't hypixel use plane 15?

young knoll
#

I don’t think you could address those back then, even with the surrogate pair stuff

#

Could be wrong tho

rough ibex
#

I don't think that's correct

#

UTF-16 works on surrogate pairs.

#

that's how it exists

#

by using surrogates to encode points > FFFF

#

all UTF encodings are lossless

#

UTF-16 can encode all 10FFFF

young knoll
#

Yeah but Minecraft just didn’t support it

rough ibex
#

why not

young knoll
#

Or at least I never saw it used before like, 1.18

rough ibex
#

Well, custom fonts only existed really in 1.13+

#

so it wasn't very relevant

#

since you couldn't retexture

#

but I think you could still send the actual character, it should just show as tofu

young knoll
#

Tofu

rough ibex
#

yes

#

Noto is a font family comprising over 100 individual computer fonts, which are together designed to cover all the scripts encoded in the Unicode standard. As of October 2016, Noto fonts cover all 93 scripts defined in Unicode version 6.1 (April 2012), although fewer than 30,000 of the nearly 75,000 CJK unified ideographs in version 6.0 are cover...

young knoll
#

I just called em a rectangle

#

I guess you could compare that to tofu

rough ibex
#

notdef is another name

young knoll
#

[]

rough ibex
#

I think I'll stick to EXTD

torn shuttle
rough ibex
#

now speed it up

remote swallow
#

where sound

young knoll
#

That’s still in blockbench

#

In game or riot

echo basalt
#

make it default dance

remote swallow
#

can it teach me how to dougie

trim lake
#

Can I somehow dettect if item was taken after CraftItemEvent? Im modifying results of event if item is not taken Im modifying that modified item again and I dont want to show that modified item in results slots it it is not takne. I want show modified item when is not taken as restuls to player inventory. I want to display not modified item.

torn shuttle
rough ibex
#

the kids are having fun

remote swallow
#

no i want swish swish bish

torn shuttle
#

buddy I ain't an animator, I make the systems that let you animate

#

this already took way longer than it should've

inner mulch
torn shuttle
#

no

inner mulch
#

ok

torn shuttle
#

this is just to showcase FMM

sullen marlin
#

looks good, nice work

torn shuttle
#

well let's see how it looks in-game

livid dagger
#

Hi, I have a question. Is there any plugin for skyblock where can I make my own style of island and then people who just write /island create or something for creating, it would just make them the one I made?

torn shuttle
#

I think it's a bit too fast for it to cope lol

#

this is interesting, I wonder if there's a value leaking somewhere

lilac dagger
#

yeah, it's a bit too fast

torn shuttle
#

it's weird too because it supposedly resets all the data every time

#

but it's clearly rounding something in here

young knoll
#

I kinda want to see what it would look like with mine

lilac dagger
#

and it looks 2d as well

#

the main body i mean

torn shuttle
#

it's an accurate recreation of the exact mc model, just adding a segment for the arms and another for the legs

#

not my fault mc is the flattest 3d game ever made

lilac dagger
#

true

torn shuttle
#

how weird

#

I need to figure this out

young knoll
#

He’s not looking so good

remote swallow
civic sluice
#

Is he ill and has lepra?

young knoll
#

I think he has more than that

torn shuttle
#

the loop shouldn't be cumulative

grave vale
#

probably a stupid question but does anyone know how I can get NMS? I need to use the ServerLevel class but I don't seem to have it all

worldly ingot
#

ServerLevel is WorldServer

grave vale
#

is OpenInv's code outdated then?

#

they're using ServerLevel

worldly ingot
#

They're using Mojang mappings where you're not

#

WorldServer is CB mappings, ServerLevel is Mojmaps, but they're the same class

#

?mappings

undone axleBOT
worldly ingot
#

I mean not quite what I was looking for, but a useful resource nonetheless lol

grave vale
#

oh I forgot to use them

#

I built them with buildtools but I haven't put them in all my projects yet

remote swallow
grave vale
#

works much better, thank you

deep herald
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setTabCompleter(org.bukkit.command.TabCompleter)" because the return value of "org.bukkit.Bukkit.getPluginCommand(String)" is null
    at me.snowyjs.minehuttracker.MinehutTracker.lambda$onEnable$1(MinehutTracker.java:39) ~[MinehutPlus-1.2_03.jar:?]
    at java.util.Arrays$ArrayList.forEach(Unknown Source) ~[?:?]
    at me.snowyjs.minehuttracker.MinehutTracker.onEnable(MinehutTracker.java:39) ~[MinehutPlus-1.2_03.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:190) ~[paper-1.20.2.jar:git-Paper-318]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.2.jar:git-Paper-318]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugin(CraftServer.java:646) ~[paper-1.20.2.jar:git-Paper-318]
    at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugins(CraftServer.java:557) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:627) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:424) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1086) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-318]
    at java.lang.Thread.run(Unknown Source) ~[?:?]```getting this error?
echo basalt
#

Command isn't on plugin.yml

deep herald
#

oh im using extend command

echo basalt
#

go figure

#

Then you need to register it on the command map

deep herald
#

oh the tab completions?

grave vale
sullen marlin
#

?whereami

worldly ingot
#

ClientInformation is the same between CB and Mojmaps so unsure why you would be unable to find it

deep herald
grave vale
deep herald
#

nms 😭

echo basalt
#

If you have it on your plugin.yml you should use Plugin#getCommand

deep herald
echo basalt
#

If you want to register your own without putting it in the plugin.yml you gotta grab the CommandMap from the bukkit server and register stuff

deep herald
#

like this isnt a thing

young knoll
#

There are no exposed register methods

#

You need reflection

echo basalt
#

It's usually done in a pretty hacky way :)

#

reflection go brr

deep herald
#

thats aids

echo basalt
#

(this is my own audience stuff)

young knoll
#

Wtf catch reflective operation exception

#

Kthx

echo basalt
#

lmao

deep herald
#

why is this aids to do

#

i just dont want tab completions on my cmd 😭

grave vale
young knoll
#

You can remove tab completions with the normal command system?

#

Just return Collections.emptyList()

grave vale
young knoll
#

Wut

sullen marlin
ember dew
#

Is the 1.8.8 documentation currently down?

worldly ingot
#

We don't have 1.8 documentation

lilac dagger
#

about time

deep herald
#

1.8>>

worldly ingot
#

Oh, via Maven lol

sullen marlin
#

not even via maven

worldly ingot
#

Sorry, Nexus*

sullen marlin
#

via abusing nexus

worldly ingot
#

Yeah that's not how you're supposed to use Nexus

sullen marlin
#

the actual maven URLs still work

worldly ingot
#

If that url was ever browsable I'd be impressed

ember dew
#

¯_(ツ)_/¯

sullen marlin
worldly ingot
#

That feels sketchy tbh

ember dew
#

So what was I using as a reference then

#

I'm so confused

sullen marlin
#

some url that google picked up that no one knew existed

#

which now doesnt exist

grave vale
coral flower
#

Hey guys, I'm still trying to spawn a Custom Zombie. I try it like that:

public class CustomZombie extends Zombie {
    public CustomZombie() {
        super(EntityType.ZOMBIE, ((CraftWorld)Bukkit.getWorld("roguelike")).getHandle());
        this.setPos(0,0,0);
    }
}
@Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        CustomZombie zombie = new CustomZombie();
        return true;
    }

but I just get an error in minecraft: An internal error occurred while attempting to perform this command and the console doesnt give me any feedback. Any ideas how to tackle this?

ember dew
#

it's been up for years

#

And and goes missing now

sullen marlin
#

yep, because nexus got upgraded

echo basalt
#

I'm surprised the console has nothing

ember dew
#

That's really unfortunate timing I guess

echo basalt
#

you still have to add the entity to the world

#

(level().addFreshEntity(this))

sullen marlin
#

I guess

#

official javadocs are here

#

?jd

undone axleBOT
ember dew
#

Yeah ik

#

Just wanted to be able to sort through everything available and not for 1.8

coral flower
#

still nothing happens. Any Ideas how to fix this no error issue?

valid burrow
#

but you still get startup logs right?

coral flower
#

yuo

#

yup

valid burrow
#

huh

#

that is really weird

coral flower
#

like I also get sout logs

valid burrow
#

mh

#

well yh waht imllusion said was correct thouhg

#

about adding the entity to the world

coral flower
#

yea I tried that. But I think it doesnt work bc of the error I make somewhere else

grave vale
#

well it seems ClientInformation was added after 1.20.1 because I built and used 1.20.4 with mojang mappings and now it's there

sullen marlin
#

sounds about right

#

what are you trying to do anyway

echo basalt
#

yo md quick question given you're already here

#

what's the job of bungee's InitialHandler?

#

I need to port some stuff to velocity disappointment

sullen marlin
#

it handles logging in the player before they are joined to any servers

echo basalt
#

Is it bound to a specific protocol phase or does it do handshake, login and play?

sullen marlin
#

it wouldn't do play, but it probably does all the rest at some point

echo basalt
#

hm

grave vale
silent tendon
#

Hello, I would like to install the NMS for Spigot so that I can use it. I already have the spigot-1.20.1.jar file, but I don't know how I can use the whole thing in inellij. Can someone help me with that?

grave vale
#

if you built spigot with the buildtools then you already have it

#

also it depends on whether you're using gradle or maven to build your plugin

silent tendon
#

I use maven

grave vale
river oracle
#

what gamernic sent isn't even a good approach anymore

deep herald
#

why

river oracle
#

use Mojmaps obfuscated now adays is like shooting yourself in the foot for no good reason

deep herald
#

bro no way its the kid from cosmic reach again 💀

silent tendon
grave vale
river oracle
deep herald
#

fr

river oracle
#

it walks you through everything

grave vale
#

I don't know how this translates to maven but you need to use the remapped-mojang

deep herald
#

imo, cosmicreach>>

river oracle
echo basalt
river oracle
#

lol

#

you have like 100 more messages than me

echo basalt
river oracle
# echo basalt

you've been around for less time than me nvm you joined the day of apparently :P I Joined late april

#

so consider me impressed

coral flower
#

okay even if I do and out of bounds error it doesnt show up in the logs:

int[] arr = {0, 0};
System.out.println(arr[-1]);
``` So it doesnt seem nms related. What else can I try?
river oracle
#

is the code even running

#

this doesn't provide much context that code 100% of the time will trigger an index out of bounds

coral flower
#

yea the code is running. Like when I change the onCommand like a sout it works.

#

What context do you need?

echo basalt
#

bro prob has a trycatch ignore

dawn flower
#

is there a sound for firework launch?

coral flower
river oracle
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

fierce whale
#

To save ItemStack object in mysql db, Is serializing the best way?

coral flower
dawn flower
dawn flower
#

it's supposed to throw an exception tho

coral flower
#

yea like in minecraft I get the an error. But it doesnt specify what error it is. Just that there is one

#

and the console is just empty

dawn flower
#

send the error

coral flower
#

In minecraft I just get An internal error occurred while attempting to perform this command what perfectly makes sense cause there is an out of bounds error. But the server isnt giving me any feedback. I assume there is a problem how I setup the server

dawn flower
#

in the console

#

check the console

valid burrow
#

@dawn flower are you not listening

#

he said theres no consle error

#

like 5 times now

dawn flower
#

that's weird

#

if it's in a try-catch then it wouldn't send that

valid burrow
#

mhm

dawn flower
#

try this

try {
  int[] arr = {0, 0};
  System.out.println(arr[-1]);
} catch (Exception ex) {
  ex.printStackTrace();
}```
if it doesn't print it then there's a problem with ur server
coral flower
#

okay there was some weird issue with the server and not with java. I did setup a new spigot server and now I'm getting errors again :) so back to my zombie problem. I try to spawn a custom Zombie:

@Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        CustomZombie zombie = new CustomZombie();
        return true;
    }
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.monster.Zombie;
import net.minecraft.world.level.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_20_R3.CraftWorld;

public class CustomZombie extends Zombie {
    public CustomZombie() {
        super(EntityType.ZOMBIE, ((CraftWorld) Bukkit.getWorld("roguelike")).getHandle());
        Level level = ((CraftWorld) Bukkit.getWorld("roguelike")).getHandle();
        this.setPos(0, -57, 0);
        level.addFreshEntity(this);
    }
}

and I get an java.lang.ClassNotFoundException: net.minecraft.world.entity.monster.Zombie am I using the wrong Zombie class?

sullen marlin
#

did you remap your plugin

coral flower
livid dagger
#

Hi, I have a question. Is there any plugin for skyblock where can I make my own style of island and then people who just write /island create or something for creating, it would just make them the one I made?

silent tendon
river oracle
#

You can't build artifacts you must mvn package

#

Or whatever

gleaming grove
#

Question, how can I dynamically register commands in Spigot> Currently I'm using this hacky way, hovever it only works inside onEnable method. When server is running commands are not longer registered properly (I can not see them in minecraft)

public class CommandCreator {

    public static void Create(String name) {
        FluentLogger.LOGGER.info("Creating command,", name);
        registerBukkitCommand(new TestCommandClass(name));
        FluentLogger.LOGGER.info("cmd created", name);
    }

    private static boolean registerBukkitCommand(TestCommandClass simpleCommand) {
        try {
            var commandMap = (SimpleCommandMap) ObjectUtility.getPrivateField(Bukkit.getServer(), "commandMap");
            return simpleCommand.register(commandMap);
        } catch (Exception e) {
            FluentLogger.LOGGER.error("Unable to register command " + simpleCommand.getName(), e);
            return false;
        }
    }

    public static class TestCommandClass extends Command {

        protected TestCommandClass(@NotNull String name) {
            super(name);
        }

        @Override
        public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) {

            FluentLogger.LOGGER.info("Siema tutaj commenda " + this.getName());
            return false;
        }
    }

}
echo basalt
#

There's a method for that

gleaming grove
#

provided by API, or I need to use reflections?

echo basalt
#

Reflections, of course

#

syncCommands is the method you're looking for

#

No params

silent tendon
gleaming grove
echo basalt
#

SimpleCommandMap

coral flower
gleaming grove
#

hmm what version of spigot are you using? I can not see it at 1.19.4

echo basalt
#

Hm, might be new

#

or paper-specific, go figure

#

In that case for existing players there's a method to resend commands

#

the command api is icky as hell

gleaming grove
#

okey, thanks for help

dawn flower
#

can u hide a player WITHOUT invisibility for a specific player without hiding him from the tablist

coral flower
#

I'm still trying to figure out what is wrong with my project that I get the class not found error. Maybe there is something wrong with my pom.xml, maybe someone can have a look at it: https://pastebin.com/Yy15LKqq

sullen marlin
#

<outputFile>C:\Users\user\OneDrive\Desktop\PluginTestServer\plugins\RoguelikeSpigot.jar
</outputFile>

#

its your shade config

#

delete that

coral flower
#

just that line? and how do I export my jar then?

sullen marlin
#

copy it from the target folder

coral flower
#

oh that worked,thx!

gleaming grove
grim hound
#

I'm writing a map data packet like this

#

but the client disconnects on 1.16.5 with "ArrayIndexOutOfBounds"

#

on wiki.vg I found this to be the only difference in protocol on 1.19 and 1.19.2

#

so it shouldn't change

#

and it works on 1.20.1

lilac dagger
grim hound
#

I did

#

it just writes false

#

this is 1.19.2+ /\

#

this is 1.19 and below

#

hmm I guess there is a difference

lilac dagger
#

i'm pretty sure you forgot something somewhere

#

these things are finicky

grim hound
lilac dagger
#

as far as i know minecraft uses special byte manipulation in some areas

grim hound
#

the array is not optional here

lilac dagger
#

what about ?

#

you might wanna look what mojang does different to this

#

mojang has a friendly byte buffer that extends what you're using

grim hound
#

ye

grim hound
#

also, I can't even use the FriendlyByteBuf class

#

👍

lilac dagger
#

so you might wanna make sure it matches