#help-development

1 messages · Page 1840 of 1

swift adder
#
Unresolved dependency: 'org.spigotmc:spigot-api:jar:1.18.1-R0.1-SNAPSHOT'
Unresolved plugin: 'org.apache.maven.plugins:maven-compiler-plugin:3.8.1'
Unresolved plugin: 'org.apache.maven.plugins:maven-shade-plugin:3.2.4'```
lethal knoll
#

yes, show me your pom.xml pls

swift adder
#

That is it

lethal knoll
#

no that is not it

#

Thats the error you have

swift adder
#
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.github.grapeapplefruit</groupId>
    <artifactId>hahgsdg</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Hahgsdg</name>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
#

This one?

lethal knoll
#

yes

swift adder
#

I have two, one for the errors and that one.

lethal knoll
#

And when does the error appear?

#

when you try to install?

swift adder
#

Yes

lethal knoll
#

come PM for a moment

swift adder
#

Ight

#

Can anyone help with these errors when downloading the api?

Unresolved dependency: 'org.spigotmc:spigot-api:jar:1.18.1-R0.1-SNAPSHOT'
Unresolved plugin: 'org.apache.maven.plugins:maven-compiler-plugin:3.8.1'
Unresolved plugin: 'org.apache.maven.plugins:maven-shade-plugin:3.2.4'```
worldly ingot
#

This is what I came up with @tall dragon

    public static void main(String[] args) throws Exception {
        double startUpgrades = 1.0, totalUpgrades = 1000.0;
        double minimumCost = 100, maximumCost = 3000000;

        for (double upgrade = startUpgrades; upgrade <= totalUpgrades; upgrade++) {
            double progress = (upgrade / totalUpgrades);

            double cost = quadraticBezier(progress, minimumCost, maximumCost, minimumCost);
            System.out.println(((int) upgrade) + ": " + NumberFormat.getCurrencyInstance().format(cost));
        }
    }

    private static double quadraticBezier(double t, double start, double end, double intersect) {
        double scalar = (1.0 - t);

        double firstToIntersect = scalar * ((scalar * start) + (t * intersect));
        double intersectToSecond = t * ((scalar * intersect) + (t * end));

        return firstToIntersect + intersectToSecond;
    }```
#

It's not fantastic but it does give a slight gradual curve

#

You might be able to exaggerate the intersect a little more

#

Oh oops. I put the intersect at minimumCost. If it's set to 0 it's a bit better heh

tall dragon
#

hmm

opal juniper
#

Ignored my solution PepeHands

worldly ingot
#

It's not great though. There's probably a better curve

#

Actually I calculated progress wrong

tall dragon
#

im meaning for it to cost 3million for all upgrades together

worldly ingot
#

Oh. $3,000,000 in total

swift adder
#

I want 3mil

worldly ingot
#

Ehm, I'm not sure of a great solution to that

misty current
#

i'm tryna make rotation animations for items, but it kinda looks like it jumps as u can see in this clip https://youtu.be/IAeOqvFPFXY

    public void rotateStand(){
        final PacketArmorStand stand = new PacketArmorStand(player.getLocation());
        stand.getStand().setBasePlate(false);
        stand.getStand().setInvisible(true);
        stand.getStand().setArms(true);
        stand.getStand().setRightArmPose(new Vector3f(280f, 0f, 0f));
        stand.setTool(player.getItemInHand());
        stand.show(player);

        new BukkitRunnable() {
            int tick = 0;

            final double rotationSpeed = 1.8;
            final Location center = player.getLocation();

            @Override
            public void run() {
                if(tick >= 360) this.cancel();

                final Location center = this.center.clone();
                center.setYaw((float) (tick * rotationSpeed + 90.0));

                final Vector sphericalVec = VectorUtils.getSphericalVector(0.49, tick * rotationSpeed, 0);
                final Vector offset = VectorUtils.getVectorLeft(center, 0.37);
                center.add(sphericalVec).add(offset);

                stand.setLocation(center);
                stand.update();
                tick++;
            }
        }.runTaskTimer(CosmicCore.getPlugin(), 0L, 1L);
        
    }
#

sorry for the flood

#

wtf why does it not format

tall dragon
tall dragon
round finch
#

could be that the Item is falling then it jumps to place?

misty current
#

kind of a wrapper for EntityArmorStand

#

stand.update() sends a relative move, equipment and metadata packet

opal juniper
#

i think i have one @tall dragon

tall dragon
# opal juniper

alright but how will this work should the price change to for example 5 million

misty current
#

did the formula i gave you not work yesterday?

tall dragon
#

it didnt really work how i want it

opal juniper
#

well then you change that long decimal

misty current
#

ah aight

tall dragon
opal juniper
#

brute force the decimal lol

#

there is a way i imagine

tall dragon
#

yea i dont want to do that tho

opal juniper
#

hang on

tall dragon
#

what if a server owner wants to change the price

#

hes going to have to brute force it himself

misty current
#

wdym?

#

set it to false?

round finch
#

then it won't fall the armorstand

misty current
#

the position is sent using packets so even if i stopped "teleporting" it the player would see it standing still in the air

round finch
#

setGravity(false);

misty current
#

lemme try anyways

swift adder
#

When it tries to download spigot api it breaks

#

Can someone help

#

Could not transfer artifact org.spigotmc:spigot-api:pom:1.18.1-R0.1-SNAPSHOT from/to spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/): transfer failed for https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/spigot-api-1.18.1-R0.1-SNAPSHOT.pom

round finch
iron palm
#

Im trying to cancel block break event with a bukkit runnable
However it is not working I've tried setting period & delay to 0

#

what should i do...

young knoll
#

You can’t cancel an event in a runnable

iron palm
#

btw i tried using for

misty current
royal vale
#

How to remove all online players from the tab with protocollib?

misty current
#

you need to send playpacketoutinfo

#

and they must be remove player

#

or smthing similar

royal vale
#

I need a WrappedPlayerInfo

#

But for that I need an entire array of info

misty current
#

what version?

royal vale
#

1.8

misty current
#

why don't you use nms?

iron palm
# young knoll You can’t cancel an event in a runnable

i tried this :

                for (BoundingBox s1box = new BoundingBox(ArenaData.get().getDouble("arena.pos1.x"), ArenaData.get().getDouble("arena.pos1.y"), ArenaData.get().getDouble("arena.pos1.z"), ArenaData.get().getDouble("arena.pos2.x"), ArenaData.get().getDouble("arena.pos2.y"), ArenaData.get().getDouble("arena.pos2.z")); player.getLocation().getX() > s1box.getMinX() && player.getLocation().getX() < s1box.getMaxX() && player.getLocation().getY() > s1box.getMinY() && player.getLocation().getY() < s1box.getMaxY() && player.getLocation().getZ() > s1box.getMinZ() && player.getLocation().getZ() < s1box.getMaxZ(); ) {
                    e.setCancelled(true);
                }
            }
misty current
#

i doubt you need version compatibility

#

if you are coding on 1.8

#

i don't like protocollib much tbh

royal vale
# misty current i doubt you need version compatibility

I tried this:

private static void removePlayers(Player receiver) {
        List<PlayerInfoData> data = new ArrayList<>();
        for (Player player : Bukkit.getOnlinePlayers()) {
            WrappedGameProfile gameProfile = WrappedGameProfile.fromPlayer(player);
            data.add(new PlayerInfoData(gameProfile, ((CraftPlayer) player).getHandle().ping, EnumWrappers.NativeGameMode.fromBukkit(player.getGameMode()), WrappedChatComponent.fromText(player.getPlayerListName())));
        }

        PacketContainer packet = new PacketContainer(PacketType.Play.Server.PLAYER_INFO);
        packet.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER);
        packet.getPlayerInfoDataLists().write(0, data);

        try {
            ProtocolLibrary.getProtocolManager().sendServerPacket(receiver, packet);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
#

Doesn't work

misty current
#

i have tried often to use procollib but every time it was painful

peak granite
#

how do i get the loop number in a for loop

#

like how many times the loop went

#

looping a list

#

btw

glossy scroll
#

Define an integer and increase it in the loop

misty current
# royal vale I tried this: ```java private static void removePlayers(Player receiver) { ...

if you want to use NMS, this should work:

    public void clearTablist(Player player){
        
        PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(
                PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER,
                Bukkit.getOnlinePlayers().stream()
                        .map(p -> ((CraftPlayer) p).getHandle())
                        .collect(Collectors.toList()));
        
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
    }
peak granite
glossy scroll
#

…yea

#

You want an integer right?

misty current
#

if you use enhanced for loops, yes

peak granite
#

yea

misty current
#

else use normal for loops

glossy scroll
#

Or if youre iterating over the whole list…. Just use list.size or whatever

peak granite
#

for(String s : list)

#

that's what i'm doing

misty current
#

yea thats an enhanced for loop

#

do what martoph said

peak granite
#

ojk

glossy scroll
#

Nothing will tell you how many times an enhanced for loop ran unless you track it yourself

quaint mantle
#

I have this scoreboard but there are som lines missing

#

header: "&c&lRetronix"
scoreboard:

  • "&7=--------------------="
  • "&6>> Rank: {rank}"
  • "&6>> Tokeny: {tokens}"
  • "&6>> Server: {server}"
  • "&7=--------------------="
  • "&c&lplay.mcretronix.eu"
  • "&7=--------------------="
#

this is what config looks like

#

why I cant have two or more repeating lines in it

misty current
#

because that's how scoreboards work

#

you can't have 2 lines equal to eachother

quaint mantle
#

why

misty current
#

they are meant to display players

#

and you know a player can't a ppear twice

#

actually any entity

quaint mantle
#

so how can I get around it?

misty current
#

add an empty space

#

or a color code

quaint mantle
#

it is already color coded and I dont want to make that scoreboard any longer

rapid sable
#

Is there anyone who knows how I set the skin in 1.18 from an EntityPlayer?

The DataWatcher is missing and I cannot find any method.

trim surge
#

Do &8&7————=

#

Just an colorcode letter difference

quaint mantle
#

good idea

trim surge
#

Not sure if it will work, but you can try

rapid sable
#

Edit:
I currently have the skin working (apparently the wrong parameter was given... 🤦‍♂️ )
But now it does not show the layers. As I do not have the DataWatcher, I have no clue how to solve this.

quaint mantle
#

does this look good now? 😄

rotund prawn
#

can someone help? .setExecutor() doesnt work

#

it shows an error

ivory sleet
#

Send the error then?

rotund prawn
#

its jsu tthis

#

and this

ivory sleet
#

Send ur plugin.yml

rotund prawn
ivory sleet
#

Oh yeah well, did you get any other errors?

rotund prawn
#

nothing else

ivory sleet
#

Also how do you build?

rotund prawn
#

maven

ivory sleet
#

No

rotund prawn
#

intellJ idea

#

then?

ivory sleet
#

How

#

Not what

rotund prawn
#

i click the green arrow icon and it does it for me

#

idk how

#

in the tutorial it said that it complies the plugin

ivory sleet
#

Because that sounds horribly wrong

rotund prawn
#

then how?

ivory sleet
#

Also bad tutorial

#

You should run the tasks maven clean install

rotund prawn
#

in command prompt?

ivory sleet
#

And then use the outputted jar from a target folder which gets generated

rotund prawn
#

?

ivory sleet
#

In the terminal

rotund prawn
#

oh

ivory sleet
#

Or with the IntelliJ maven user interface

rotund prawn
#

how

#

im new to this

ivory sleet
#

Well look at the top right

#

there’s a tab called maven

#

Just click it and a window will expand

rotund prawn
#

i see

#

ooh

#

im here

#

then what

ivory sleet
#

Then run clean

golden turret
ivory sleet
#

Consecutively run install

rotund prawn
#

it jsut shows this

ivory sleet
#

you have to expand the Lifecycle

rotund prawn
#

i see

#

i ran it

ivory sleet
#

Then fetch the jar from the target folder which gets generated

#

And then put said jar into your plugins folder

#

And obviously remove the old jar

rotund prawn
#

hows to get that target folder?
where it located?

ivory sleet
#

in your project folder

#

./target/

rotund prawn
#

i see

#

this?

ivory sleet
#

Myes

rotund prawn
#

thanks

#

let me test

ivory sleet
#

Well that tells you straight what’s wrong

golden turret
#

how could i get the block in front of an entity?

ivory sleet
#

Trying to use api version 18 on a 1.16 version

rotund prawn
#

whats wrong?

rotund prawn
#

i made it the version 1.16.5

ivory sleet
#

And?

rotund prawn
#

it worked before

ivory sleet
#

If your plugin is minimum 1.18 it won’t work

rotund prawn
#

with that arrow thingy

ivory sleet
#

That’s just an axiom shrug

rotund prawn
#

whats an "axiom"

ivory sleet
#

Okay but it doesn’t update your resources

ivory sleet
#

axiom is something which is inherently true by itself

rotund prawn
#

im not english

#

so im not that good at it

ivory sleet
#

No worries neither am I

rotund prawn
#

i dont understand

rotund prawn
#

okay

#

can you tell how to fix this error?

#

it was working before

#

the plugin

#

just that error

ivory sleet
#

Send ur plugin.yml

rotund prawn
#

name: Alma version: '${project.version}' main: Alma.Tanulas api-version: 1.16 authors: [ ferro31 ] description: tanulas commands: gui: description: Open a GUI

ivory sleet
#

I mean it says something different in the logs but try to put the api version to 1.13

rotund prawn
#

okay

ivory sleet
#

And then run maven clean install

rotund prawn
#

its here

ivory sleet
#

And take the jar again and replace it with the old one in the plugins folder

#

ok cool

rotund prawn
#

only the error needs a fix

ivory sleet
#

What error?

rotund prawn
#

that theres not .setExecutor()

ivory sleet
#

Wut

#

That looks like a warning

rotund prawn
#

its not working

ivory sleet
#

Not an error

rotund prawn
#

the setExecutor

#

but it still doesnt work

ivory sleet
#

Any errors?

rotund prawn
#

wait

#

with the clean install

#

its a command now

#

and it works

ivory sleet
#

rotund prawn
#

onl the clean isntall or what needed

#

thanks

ivory sleet
#

nice

rotund prawn
#

thanks for help

ivory sleet
#

Have a good time (:

rotund prawn
#

you too

#

bye

vague swallow
#

Can someone please tell me how to create a team in 1.16+?

#

And how to let players join the team

#

Like the /team teams

ivory sleet
#

Isn’t like ScoreboardManager::getMainScoreboard and then ::registerTeam or ::createTeam

vague swallow
#

Ahh okay

ivory sleet
#

Key thing is the main scoreboard

#

as opposed to getNewScoreboard

royal vale
#

How to remove all players from the scoreboard with ProtocolLib? I tried this but it doesn't work:

private static void removePlayers(Player receiver) {
        List<PlayerInfoData> data = new ArrayList<>();
        for (Player player : Bukkit.getOnlinePlayers()) {
            WrappedGameProfile gameProfile = WrappedGameProfile.fromPlayer(player);
            data.add(new PlayerInfoData(gameProfile, ((CraftPlayer) player).getHandle().ping, EnumWrappers.NativeGameMode.fromBukkit(player.getGameMode()), WrappedChatComponent.fromText(player.getPlayerListName())));
        }

        PacketContainer packet = new PacketContainer(PacketType.Play.Server.PLAYER_INFO);
        packet.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER);
        packet.getPlayerInfoDataLists().write(0, data);

        try {
            ProtocolLibrary.getProtocolManager().sendServerPacket(receiver, packet);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
golden turret
ivory sleet
#

For 1 or 2 blocks tall entities?

#

Or more?

#

And entity may have more than a single block in front of it

misty current
golden turret
royal vale
#

Don't mind the layout, still developing that

misty current
#

your method?

royal vale
#

Yes

misty current
#

what's the issue? your player being in the tablist?

royal vale
#

yes

#

If I match the server version it doesnt work, if I do it does work

misty current
#

hmm

#

via version i guess?

royal vale
#

Yes

misty current
#

probably the packet changed in later versions

royal vale
misty current
#

worth a shot

royal vale
#

Doing it

royal vale
misty current
#

does it do the same thing or doesnt work at all

royal vale
#

Same thing

misty current
#

ah rip

#

do you want to create custom tablists?

royal vale
#

Is there a different method for 1.8?

royal vale
mortal arrow
#

hey uhh

#

people

misty current
#

the packet is the exact same

royal vale
#

80 slots, first 40 for players, other 40 for placeholders

mortal arrow
#

anyone using google colab

#

for hosting MC?

tardy delta
#

pls dont

misty current
#

i guess you are filling in the slots right?

#

with fake players

royal vale
#
List<PlayerInfoData> data = new ArrayList<>();
        for (int i = 0; i < 80; i++) {
            WrappedGameProfile gameProfile;
            if (i == 0 || i == 25 || i == 40 || i == 60) {
                gameProfile = getGameProfile(limeSkinURL, i, "lime");
            } else {
                gameProfile = getGameProfile(graySkinURL, i, "gray");
            }
            WrappedChatComponent wrappedChatComponent = WrappedChatComponent.fromText("");
            data.add(new PlayerInfoData(gameProfile, 1, EnumWrappers.NativeGameMode.SURVIVAL, wrappedChatComponent));
        }
mortal arrow
#

alrightt guess no one gonna help.

misty current
#

try to not set them for a second

#

just remove everything

royal vale
#

Quoting it

misty current
#

and check if the tablist still has you

misty current
#

lol

misty current
royal vale
#

So I don't loose it lol

#

Also I made a funny mistake at the start

misty current
#

oh oke

royal vale
#

Had a loop that added 80 players per second

#

Appears ur fps dies

misty current
#

lmao

#

packets are fun

royal vale
#

Yea

#

Usefull

misty current
#

someone managed to make a shulker open its lid 5 blocks

royal vale
#

Oh so

misty current
#

or something like that

royal vale
#

Nice

#

Anyways so the tab is still the same

#

Just without the fake players

misty current
#

so it still has your player

#

in 1.18

royal vale
#

Wait no

#

Now 1.18 and 1.8 both have players

#

Ig my player was on slot 81 and not visible

#

On 1.18

#

Cuz of ordering or smth

misty current
#

oh yea

karmic grove
#

whats best way to drop random items not just 1 certain item every time

misty current
#

i'm not sure if you can remove the player itself from tablist tbh

tardy delta
royal vale
misty current
#

if that doesn't work, i'm not aware of another method to hide players from tablist

karmic grove
misty current
#

anyways can't help rn, i gtg

karmic grove
#

or is there better way

quaint mantle
#

how do I make my scoreboard update every 60 seconds using runnable

royal vale
misty current
#

Yep

royal vale
tardy delta
#

something like that

tender shard
#

in 1.18 it's different

misty current
royal vale
quaint mantle
royal vale
misty current
peak granite
#

how do i cut the first two args from a command and make the rest a string together

royal vale
misty current
tender shard
tender shard
misty current
#

Start the for loop with index 2 or whatever u wwnt

royal vale
misty current
#

Why dont you use a lambda

#

My eyes hutt

#

Hurt

royal vale
misty current
#

Yes

#

Good

royal vale
fierce quail
#

I have managed to create a Team Using Scoreboards and managed to show a suffix+prefix+Color in the Tablist using it. On the other hand, it doesnt appear in the Nametag above the player. Is this a feature, or what did i do wrong?

fierce quail
#

Thanks

royal vale
#

Not sure if that works

royal vale
peak granite
#

String.join(" ", args[2]) removes arg 0 and arg 1? so everything after is one string

#

@tender shard

#

i want everytihng after arg 2

#

to be one string

#

string join is shorter

ivory sleet
#

Or use ::runTaskTimer (:

golden turret
peak granite
#

so?

tardy delta
golden turret
#

didnt worked

#

actually

#

it is working for only 1 direction

karmic grove
#

so i cant figure out how to tell if maxhealth is 0

late sonnet
karmic grove
#

it is a double

tardy delta
#

max health 0?

karmic grove
#

im recreating i lifesteal basicly

late sonnet
karmic grove
#

o

#

can a max player health be set to 0

mortal arrow
#

what is this

tardy delta
#

i'm wondering too

ivory sleet
#

I think it must be a positive value

karmic grove
#

so if they have 2 health left and i have it go down 2 will it go to 1 cuz it cant go any lower

#

then i can do this

waxen plinth
#

That won't work

karmic grove
#

oh i know

quaint mantle
# peak granite to be one string
StringJoiner joiner = new StringJoiner(" ");
        for (int i = 2; i < args.length; i++) {
            joiner.add(args[i]);
        }
        String str = joiner.toString();
waxen plinth
#

Why do that when you could do

#
String joined = Arrays.stream(args).skip(2).collect(Collectors.joining(" "));```
#

Though you should clarify whether you want the argument at index 2 to be included

#

If not then change skip from 2 to 3

wet breach
#

because not everyone likes lambda

waxen plinth
#

Much cleaner though

#

Also there are zero lambdas in this code

#

So even if you don't understand lambdas you can understand what's going on

#

It creates a stream from the array, skips the first 2 elements, and joins the rest to a string delimited by spaces

wet breach
# waxen plinth Much cleaner though

perspective on that. Just because there is more lines does not inherently mean bad. Its like compressing pictures. You can compress all you want, but you lose information in the process of doing so. What you posted is alright as I do understand it. But I am sure you get the point though 😛 anyways continue on with providing your help XD

waxen plinth
#

I think there's value in verbosity sometimes

#

And it's true that compressing the code down with streams can make it hard to understand

wet breach
#

I do believe there is a balance between the two

waxen plinth
#

But in the case of very simple operations like this, where you're joining all but the first 2 elements to a string

#

The verbosity is not necessary to understanding

wet breach
#

exactly

waxen plinth
#

So you shouldn't use streams for everything but they are definitely much cleaner for this

wet breach
#

anyways that is my two cents worth until next year 😄

waxen plinth
#

No reason to write so much more than is really needed

burnt current
#

Quick question: I am trying to create a method to insert different values into my MySQL database table. This has also worked well so far. However, I have now added another column to the data table that is not to be filled by the method and accordingly can also have the value null. Since this column exists, I now get the following error message when trying to insert values there:
java.sql.SQLException: Field 'chunkid' doesn't have a default value
chunkid is in that case the table column I mean. Does anyone happen to have an idea what I might have done wrong?

wet breach
gusty gorge
#

How can I summon an ItemFrame on a clicked block face instead ins8de of the clicked block?

wet breach
#

if so, then it is saying that column can not be empty and requires a value, even if its just NULL

waxen plinth
#

You can get the relative block for the face that was clicked

gusty gorge
#

So e.getClickedBlock().getRelative();

echo basalt
#

getRelative(event.getClickedBlockFace())

grim ice
#

Hey

#

so I was wondering

#

how would I make a sort of chat app thing

ivory sleet
#

Group chat?

grim ice
#

like if a person clicked enter in a text field, it will get that text and send it to the other people with the app open

#

Yeah sort of

ivory sleet
#

Hmm with java?

grim ice
#

Yes

ivory sleet
#

I believe Java has a datagram channels api you could look into

grim ice
#

my first idea was databases but there is no events or listeners for when a new data is there

#

oh

ivory sleet
#

Or like udp api

echo basalt
#

generally a centralized server

#

udp can have packet loss

#

so tcp is a bit better imo

ivory sleet
#

It can have yeah

grim ice
#

so is there a best option

echo basalt
#

I'd just have a domain (ips can change so dns handles that) that contains the chat backend

#

and the client would connect to that domain via a socket

#

and magic happens

grim ice
#

only thing is I don't have a single clue on how to do that

#

I have 0 experience with sockets and packets and all that

#

well probably not 0 but very low

ivory sleet
#

You can start by just trying to write a Socket ServerSocket mock system

#

Assuming you’re still going with Java

grim ice
#

Yes I will use java

grim ice
#

t look promising

young knoll
#

You would have to compare the item from the event to the main hand and off hand

wet breach
# grim ice I have 0 experience with sockets and packets and all that

super easy to create such a thing, however what would be better here is a restful api for your chat app. The restful api, can then communicate the payload to the MC server as it comes in. Obviously need a custom plugin, and that plugin not only receives the chat, but does the opposite and sends the chat back to the restful api server. Using a restful api solution lets you use normal webserver here. Or you can optionally create your own which I don't advice because I assume you want logins/security?

grim ice
#

i suck at this

wet breach
#

so you are asking for development help for something that doesn't relate to mc?

#

o.O

grim ice
#

yes

ivory sleet
#

Well, this channel is for programming related questions shrug

wet breach
#

not some random applications XD

ivory sleet
#

Well I mean

#

“Ask other questions here”

wet breach
#

the basic premise of creating a chat app @grim ice is the chat app itself, a server that receives and sends the messages. The server doesn't need to be created from scratch and again don't recommend it. What I said earlier still applies. Use a restful API setup which you have to create yourself. Just don't need to create the server it runs on from scratch. If you make that, it will make a lot of other things more easy to manage especially with keeping security in mind. If you want to do this in java, you could make use of Apache Tomcat or Jetty. Recommend Tomcat.

grim ice
#

uh okay

wet breach
#

the reason people can use things like %s is because the plugins are coded to handle those custom markers for formatting and then translating them to appropriate MC format. There is format API you need to make use of to re-format the string before sending

#

you could yes, but if you want to maintain the formatting you are going to have to parse the text to remove those things you see and/or apply the formatting expected. Or you can just strip those things all away. String has replace function and some other functions to make it easier to do things with strings 😛

gusty gorge
#

Is there a way to remove the velocity from spawned particles?

wet breach
young knoll
#

They aren’t entities

#

There is a speed value in the spawnParticle method, setting it to 0 should work

wet breach
#

Right forgot they are not entities XD

wet breach
# grim ice uh okay

you can start with easy methods if you are just looking for an easy thing to create/understand. However if you are making something legitimate that you intend for others to use, then you are going to want to learn what restful api is and how you would create one.

#

restful apis can be ran on any kind of server you want, since you have to pretty much create it yourself.

gusty gorge
waxen plinth
#

It really depends on if you need chat history or not

young knoll
#

Look at the javadocs

waxen plinth
#

If you don't need chat history to be stored it's incredibly simple to create a chat server and client

#

Otherwise it's more complicated

wet breach
#

well the reason I say restful api is because it makes it easier to store the chat to then send off to others

#

without compromising security

#

not necessarily for chat history although it can be used for that too

vestal moat
#

on bungee how can i modify commands sent to client?

wet breach
#

in other words you don't need to program into the chat app credentials to the logging server for the chat 😛

gusty gorge
#

Thank u

minor garnet
#
    public void addNBT(final Entity entity, final String value) {
        net.minecraft.server.v1_12_R1.Entity nms = ((CraftEntity) entity).getHandle();
        NBTTagCompound nbt = new NBTTagCompound();
        nms.c(nbt);
        nbt.set("Pose:", new NBTTagString("Head:"));
        nms.f(nbt);
    }```

I have this method of adding nbt to entities, my goal is to take your nbt from this value and add it to another nbt, how could I do that?

Example: **addNBT(value)**, the purpose of doing this is to change the position of the head of an armor stand instead of using the .setEulerangle() methods
wide coyote
#

use nbt api or smth

#

and be aware that you can only use vanilla tags for (tile)entities

#

but i think it is already an vanilla tag so

waxen plinth
#

Config

#

For data that's not going to take up all that much space and won't change often, config makes sense

bitter sentinel
#

Why is protection 20 same as prot 100??

young knoll
#

Because the cap is 12

pliant tundra
#

when is an itemstack's item meta null?

earnest tulip
#

what it's air i guess

young knoll
#

When it’s air

earnest tulip
pliant tundra
#

is that the only case

earnest tulip
#

yea pr much

pliant tundra
#

ok good

earnest tulip
#

i think the Waterlogged interface is broken

#

am i doing it wrong

#

cus it looks fine to me idk

#

oof everyone disappeared

waxen plinth
#

Oh I guess not

#

Slab extends Waterlogged

earnest tulip
#

yea im pr sure its not a typo

#

ik

waxen plinth
#

So casting to Waterlogged should work fine

earnest tulip
#

exactly

#

but it wont work

waxen plinth
#

Won't work as in what

earnest tulip
#

im so confusd

#

like

waxen plinth
#

What is the expected behavior and what is the observed behavior

earnest tulip
#

the observed behavior is that any line of code after that one in the if statement doesnt run

#

including it

waxen plinth
#

No errors?

earnest tulip
#

let me look at them again

waxen plinth
#

Can you show more code

earnest tulip
#

like over and over

#

sure

waxen plinth
#

Cause it seems like you are casting the wrong thing

#

MaterialData is not BlockData

#

Origins v${project.version} lol

earnest tulip
#

lol idk

waxen plinth
#

Waterlogged data = (Waterlogged) block.getState().getData();

earnest tulip
#

everything works perfectly until u introduce that line

waxen plinth
#

This is your issue

earnest tulip
#

wait let me fix that

waxen plinth
#

You need to do block.getBlockData() not getState().getData()

#

getState().getData() returns a MaterialData

earnest tulip
#

it was doing it with getblockdata too

#

1 sec

waxen plinth
#

Which is not the same as BlockData

young knoll
#

Origins?

earnest tulip
#

same exact error

#

let me paste

#

waitwait

#

still being spammed as well

#

Waterlogged data = (Waterlogged) block.getBlockData();

young knoll
#

Looks like you are trying to cast plain water

#

I assume that’s what CraftFluids is anyway

earnest tulip
#

Block block = player.getLocation().getBlock();

#

yeah but idk why its doign that

#

i didnt

waxen plinth
#

Waterlogged data = (Waterlogged) block.getBlockData();

#

You should really do a check before casting

#

If you're using java 16+ you can do

earnest tulip
#

i did try that already

#

the check

waxen plinth
#
if (block.getBlockData() instanceof Waterlogged waterlogged) {
  waterlogged.blahblah();
}```
#

No you're clearly casting before you do the check

#

You cast and have a check further down

earnest tulip
#

dude its for testing

#

its not the actual code

#

it doesnt every work with the check

#

im keeping the lines that are commented to retest

native nexus
#

You should include actual code in testing

#

? xD

earnest tulip
#

wdym

#

im showing the problem at its core

#

if I uncomment all of the unnecessary stuff its more to look at

#

like it literally will not run anything after that line including the line itself, idk what im doing wrong

#

i thoroughly test things before asking here

#

and im using jdk 17 btw

waxen plinth
#

@earnest tulip

    @CommandHook("test")
    public void test(Player player) {
        Block block = player.getLocation().getBlock();
        block.setType(Material.STONE_SLAB);
        BlockData data = block.getBlockData();
        Waterlogged w = (Waterlogged) data;
        w.setWaterlogged(true);
        block.setBlockData(data);
    }```
#

This code works perfectly for me

#

Clearly it's not a problem with spigot, you're doing something wrong

vestal moat
#

bungee CommandManager#getCommands

#

the string in map is name of plugin?

waxen plinth
#

I would guess it's the name of the command

wind tulip
#

Is there a way to use the //fill command through Spigot's API?

vestal moat
#

i need the name of plugin

waxen plinth
#

Why

vestal moat
#

don't why me, if u know how tell me

waxen plinth
#

Oh my god

#

Answer the question

#

I'm trying to help you

#

Why do people insist on refusing to answer basic questions when asking for help?

vestal moat
#

ok fine im trying to get a command owner by name

#

owner is the plugin

#

its ez on spigot i mean PluginCommand

waxen plinth
wind tulip
#

I mean the vanilla command

#

not worldedit

#

I meant /fill sorry

#

not //

waxen plinth
#

Oh

#

Then yes

wind tulip
#

so... What's the code? Couldn't find anything about it online

waxen plinth
#

Bukkit.dispatchCommand(senderHere, "command here excluding leading slash")

wet breach
#

@waxen plinth every year, always rude people 😩

waxen plinth
#

To send a command from console you can do Bukkit.getConsoleSender() as the sender

#

Otherwise you can pass a player

wind tulip
#

kk thanks

dense shoal
#

I am creating a shapeless recipe that takes two ingredients, an iron nugget and a dragons breath. Upon crafting and receiving the item, the crafter also gets an empty bottle. I'm confused to why this happens, but it seems to be related to the dragons breath being one of the ingredients.

Upon debugging, I can't see any mention of the glass bottle being there. Does anyone have any idea?

waxen plinth
vestal moat
#

command implementation does not include the plugin

waxen plinth
#

Bukkit has PluginIdentifiableCommand, you can print out the interfaces with .getClass().getInterfaces() I believe

#

Okay then you'll probably need to iterate over the bungee plugins and get the info from their bungee.ymls

waxen plinth
#

Milk buckets, bottles, etc

#

They return the empty container because they assume the "contents" of the item is being used

#

I don't know if there's any way around it

dense shoal
waxen plinth
#

¯_(ツ)_/¯

vestal moat
gleaming grove
#

hi guys how to get player inventory?

waxen plinth
#

It's likely related to the tags of the item

#

Have you tried player.getInventory()

gleaming grove
#

o thanks

waxen plinth
#

If they have fallback prefixes you could go based on that

vestal moat
vestal moat
waxen plinth
#

Oh I see

#

You create a Command like this, yes?

vestal moat
#

ye

waxen plinth
#

Ok

#

Then you could get the Command instance

vestal moat
#

when time to register i pass the plugin not in constructor

waxen plinth
#

Do

vestal moat
#

im going to use reflection

#

only way

waxen plinth
#
JarFile file = new JarFile(new File(command.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()));```
#

This would give you the jar of the plugin

#

Then you could get the bungee.yml entry to get the name of the plugin

#

It's ugly but it seems like there isn't a better way

vestal moat
#

isnt there Plugin#getName?

waxen plinth
#

Well you can't get the name of the plugin through that

#

You can get the jar the command is defined in

#

But not the name of the plugin itself

#

So you'll need to look inside the jar in its bungee.yml to grab the plugin name from that jar

dense shoal
#

Is there a way to get all events that are fired?

vestal moat
#

does that block the thread?

waxen plinth
#

Since I'm not familiar with bungee it's entirely possible there is a better way but I don't see another right now

waxen plinth
waxen plinth
dense shoal
#

When I craft the item

vestal moat
waxen plinth
waxen plinth
#

I mean you only need to do it once

vestal moat
#

i think im going to cache them

waxen plinth
#

Then you could keep a map from classes to the plugins

#

Yeah that's the way to go

vestal moat
#

ye, i need the proxy ready event lol

waxen plinth
#

Or better yet a map from the jar names to the plugin names

vestal moat
#

is it fine to do this on enable?

waxen plinth
#

Sure

vestal moat
#

i mean plugin jars should have been enabled

#

also idk how to read yaml at all, what does bungee use

lavish hemlock
#

what is getProtectionDomain()?

vestal moat
#

i have snakeyml as dependency for another library

lavish hemlock
#

I've seen it a few times but honestly I don't know what it refers to

vestal moat
#

maybe check javadoc?

#

oracle java docs not bungee

lavish hemlock
#

ye I know

dense shoal
#

Doesn't that have to do with the permissions of the code?

#

Something like that

lavish hemlock
dense shoal
#

dang I was like half right

lavish hemlock
#

yeah it's part of java.security

#

aaand

#

protection domains allow you access to code sources

#

which are basically just URLs + certificates & signers

outer crane
#

how do i get intellij to stfu

lavish hemlock
#

go over the method call

#

Alt+Enter

#

go over to the warning

#

suppress for statement/method/class

outer crane
#

alright

#

thakns

dense shoal
#

Alternatively, you should probably store that into a boolean and use that in your logic

lavish hemlock
#

that would be the proper way

outer crane
#

where would that be useful?

#

i don't need that value

dense shoal
#

If !file.mkdir(), I mean, you're going to have to catch a SecurityException, right?

bitter sentinel
#

is there a way to make a 1.16 plugin work on a 1.17.1 server?

lavish hemlock
#

I think

bitter sentinel
#

but it didnt

#

it says unsupported api

lavish hemlock
#

Java is decently backwards compatible and unless the plugin uses NMS then the versions should be fine

lavish hemlock
outer crane
#

I'd rather that exception gets thrown and stops loading of the plugin, since it is an error that I don't intend on handling.

dense shoal
bitter sentinel
# lavish hemlock full error?

Could not load 'plugins\UberEnchant.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.18
at org.bukkit.craftbukkit.v1_17_R1.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:358) ~[patched_1.17.1.jar:git-Paper-391]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[patched_1.17.1.jar:git-Paper-391]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.17.1.jar:git-Paper-391]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.17.1.jar:git-Paper-391]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:419) ~[patched_1.17.1.jar:git-Paper-391]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[patched_1.17.1.jar:git-Paper-391]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1220) ~[patched_1.17.1.jar:git-Paper-391]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-391]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

lavish hemlock
#

change api-version in your plugin.yml to 1.17

#

1.18 doesn't exist for that field

bitter sentinel
#

thats the problem

lavish hemlock
#

yeah

#

there is no API version for 1.18

bitter sentinel
#

the .yml doesnt load

lavish hemlock
#

bc afaik there is no additional API for 1.18

lavish hemlock
#

so just use fucking 1.17 like I said

bitter sentinel
#

Where?

dense shoal
#

Looking here, it looks compatible for 1.18, is this not what you want?

bitter sentinel
#

nnono

#

i have a 1.17.1 server

#

and the plugin only supports 1.16

dense shoal
#

Ohhh

lavish hemlock
#

then use 8.9.3

#

8.9.4's only purpose is to update to 1.18

bitter sentinel
#

THATS WHAT I AM USING

lavish hemlock
#

wElL Ya DidN'T MaKE thaT cLeAr

bitter sentinel
#

u didnt ask lol

lavish hemlock
vestal moat
#

i cant get the classloader of class it just gives null

#

Im confused

paper viper
lavish hemlock
#

although NIO can be kind of a bitch sometimes

#

but it is better

bitter sentinel
#

is there a plugin that lets me bypass 255 enchants?

wicked lake
young knoll
#

It used to be 32k

#

But Mojang changed it for some reason

waxen plinth
#

Can you not just check the weather of the world when handling an event

wet breach
#

the data type for it changed

young knoll
#

Still saved as a short

wet breach
#

oh interesting

#

that would have been the only reason for it being changed to 255

halcyon mica
#

How would I turn a json formatted string into a chat component that I can send to a player as a title?

wet breach
#

thought chat components accept JSON o.O

halcyon mica
#

Doesn't look like there's a way to load one from json

dense shoal
#

I want to make something where I can use any method within the Player.java class in game. Is this a good use case for Java reflection?

#

Via commands I can use it I mean

paper viper
#

which are probably better in this case when executing the methods cause its faster

sullen marlin
modern sluice
#

Caching entity location

paper viper
halcyon mica
#

The methods on the player entities only take strings

lavish hemlock
#

hello again, Vatuu

runic mesa
#

How would i check if a value of an attribute is null

halcyon mica
#

Sup

runic mesa
#

since .getBaseValue returns with a double and i cant null check it

undone axleBOT
wet breach
#

but all objects in Java can be null checked though

runic mesa
#

just without base value

#

but it wouldnt work

#

and would always catch on the null

wet breach
#

tried to do what? o.O

runic mesa
#

Im using creaturespawn

#

and whenever a 50% chance is made

#

i want to change the creatures attack speed

#

which im trying to do with attributes

#

but the attribute constantly returns null

wet breach
#

why not instead of doing this the hard way

#

well hmm I think attack speed is only changed via attributes

runic mesa
#
public void onCreature(CreatureSpawnEvent event) {
        LivingEntity creature = event.getEntity();
        if (creature instanceof Monster) {
            Random ran = new Random();
            int n = ran.nextInt(2);
            if (n == 1) {
                System.out.println("This is n " + n);

                if (creature.getAttribute(Attribute.GENERIC_ATTACK_SPEED).getBaseValue() =! 1.0);
                    System.out.println("returned");
                    return;
                }
                Random rann = new Random();
                int f = rann.nextInt(5);
                System.out.println(f);
#

I used to try checking

#

== null

#

but u cant null check primitives

#

and without getBaseValue() It would always return null

#

i think

#

lemme check again

#

I was wrong

#

it doesnt return null

#

but then it returns null later and causes an error

wet breach
#

then probably need to add some debug code to see where it goes null later

runic mesa
wet breach
#

why are you needing to grab info from the armorstand?

runic mesa
#

Does attackspeed usually have base value

wet breach
#

well it has a range. Not all entities have the ability to attack

#

usually when dealing with doubles when it comes to ranges, the max range is usually 1

#

and then lower speeds being less then 1 like 0.5

quaint mantle
#

Hi! I'm making a spawners plugin, how to check if there is a spawners block 5 blocks away

"block" is my block in the event ( Block block = e.getBlock() )

runic mesa
#

it shows up for mobs but theres no base value

wet breach
dense shoal
#

Hi guys! Does this make sense? I want to increase how much food is given to someone if they eat in direct sunlight. I'm especially curious about the event.getItem() call; is that a good way of determining if someone is actually eating something?

    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
    public void onPlayerEat(FoodLevelChangeEvent event)
    {
        // If it's a player that eats the food
        if (MUtil.isntPlayer(event.getEntity())) return;
        
        Player player = (Player) event.getEntity();
        UPlayer uPlayer = UPlayer.get(player);
        
        // and the player is at least a level 2 Qadir
        if (!abilityCheck(uPlayer, 2)) return;
        
        // and the light level where the player is standing is high enough
        if (player.getEyeLocation().getBlock().getLightFromSky() < ConfigQadir.get().heatAdaptabilityFoodIncreaseLightLevelMinimum) return;
        
        // and it's daytime
        if (player.getWorld().getTime() > 12000) return;
        
        // and they are actually eating something (like food or a potion of saturation)
        if (event.getItem() == null) return;
        
        // And the food level would not exceed 20 already
        if (event.getFoodLevel() >= 20) return;
        
        // Set the amount eaten higher
        int resultantFoodLevelAfterModification = (int) (event.getFoodLevel() * ConfigQadir.get().heatAdaptabilityFoodIncreaseMultiplier);
        
        // If the resulting modification is 20, we will fully fill the player's hunger bar, otherwise, we will give them the amount that they'd get after the modification
        event.setFoodLevel(Math.min(resultantFoodLevelAfterModification, 20));
    }```
wet breach
#

best way is to use reflection to hook into the network protocol and simply stop the packets going to which ever players you don't want to be able to see the entity, or modify the packet to those players and have it set that the entity is invisible.

#

well I don't really know of another way without using NMS

#

there is a few packets that players get that have something to do with entities too

#

Well I suppose the alternative is making use of scoreboard and teams

#

yeah then there is no other way I can think of since other then scoreboard and teams, there really isn't a method that exists for setting entities visible or invisible on a per player basis

sullen marlin
#

In 1.18 there is Player#hideEntity

modern sluice
#

would Caching entity location do anything

quaint mantle
#

monke

#

🐵

patent horizon
#

is there a way i can reset my pom.xml on my kotlin project

#

it's all sorts of messed up

modern sluice
slow oyster
#

So when you run some plugins on decompiled CraftBukkit anything using reflection crashes because there is no NMS version in the package names. Anyone got around this?

runic mesa
#

Is there an event i can use to check when a player move chunks, im trying to temporarily delete all stone in a chunk when a player is on that chunk

waxen plinth
#

You could do that with PlayerMoveEvent

#

Just get the chunk in getTo() and the chunk in getFrom() and compare them

#

If they're not the same then the player has moved chunks

wet breach
slow oyster
quaint mantle
#

how to cancel a event '-'?

#

if event implemented cancelable

slow oyster
#

Man, I need to test some stuff with skins that requires two players, but I can't run offline servers because then skins disappear and I don't have a second MC account lmao

quaint mantle
#

then e.setCancel or something similiar (e is event you may ask)

#

How to cancel the BlockPlaceEvent event?

#

e.setBuild(false)?

hasty prawn
#

e.setCancelled(true)

quaint mantle
hasty prawn
#

?

quaint mantle
#

is setBuild

hasty prawn
#

In BlockPlaceEvent?

#

What

#

Send a screenshot of what you're doing

quaint mantle
#

Sorry

hasty prawn
#

Still, should be there.

#

Send a screenshot

quaint mantle
#

Is in break event

#

sorry

fallow storm
#

Optifine lets you define custom item icons based on NBT data, so I had been setting NBT via nms in the past, despite using PersistentDataContainer for actual plugin mechanics. With the changes to nms referencing in 1.18 I don't really want to do this anymore. Does anyone know if there's a way to reference PublicBukkitValues in the custom item textures formatting in Optifine, or alternately, is there an in-API way to set a custom nbt value now?

sullen marlin
#

What is wrong with CustomModelData

#

Isn't that what its for

quaint mantle
#

yeah

#

but people still prefer optifine cit

#

because for some reasons idk

#

i forgot

#

why

hasty prawn
#

Can anyone think of a reason that one of the NMS methods isn't being remapped? Thonk

#

The class is remapped, and other methods/fields are remapped, but this one in particular just isn't, and it was in the past I think

fallow storm
#

Some respacks with Optifine features have items with hundreds of sprites, it also supports 3D models and animation

hasty prawn
#

I'm using Mojang mappings for development, the issue is when it remaps back to Spigot's mappings.

#

It's ignoring some of the methods for some reason. It's happened twice now, so I assume I've just done something wrong peepoGiggles

#

It's odd that some of the methods and classes get remapped and some don't though. I can find them all in the mappings files. Thonk

quaint mantle
#

oh you mean the files when u use the classifier or something it didnt remap everything?

hasty prawn
#

Yeah, it's not remapping everything

quaint mantle
#

dunno

#

¯_(ツ)_/¯

hasty prawn
#

Yeah it's weird Thonk

quaint mantle
#

so theres must be errors when you run the plugin right?

hasty prawn
#

Yeah, I get NoSuchMethodErrors

quaint mantle
#

maybe you should give the pom.xml

#

im just gonna narrow down the issue, i dont use 1.18 so idk 😦

hasty prawn
#

I'm using Gradle

quaint mantle
#

gradle?

#

ur using paperweight?

hasty prawn
#

wot

#

No

quaint mantle
#

i thought there are no plugin for gradle?

hasty prawn
#

There's not

#

You can still get obfuscation to work without Paperweight or a plugin

quaint mantle
#

oh

#

special source

hasty prawn
sullen marlin
#

Did you remember to change from 1.18 to 1.18.1

hasty prawn
#

Yes

sullen marlin
#

Well you haven’t otherwise given much info

hasty prawn
#

True, hang on.

#

?paste

undone axleBOT
sullen marlin
#

And double check all your versions, seriously

#

I bet it’s that

hasty prawn
#

And I always use that variable

#

https://paste.md-5.net/tijekoxija.bash

That's the gradle task. The methods I've noticed aren't being mapped are

BlockPos#getX should be BlockPosition#a but maps to BlockPosition#getX
BlockState#getProperties should be IBlockData#s but maps to IBlockData#getProperties

sullen marlin
#

You don’t include the jar in your classpath

#

Check the example commands in the thread again

hasty prawn
#

Yeah, I tried re-adding them and it didn't seem to make a difference. I'll try it again.

sullen marlin
#

Nice gradle config though

#

You can also use the specialsource from maven repo rather than tooling dir

hasty prawn
#

Oh interesting, once I get this fixed I'll do that

sullen marlin
#

Read the example

#

What character does it use?

hasty prawn
#

Yeah I used a colon and got yelled at angy

sullen marlin
#

What yelled?

hasty prawn
#

I only switched it to a semicolon because

patent horizon
#

cant seem to find the old forum threads for my problem. how would i push a player forward according to their direction?

quaint mantle
#

Is this the best channel to ask for help on setting up a spigot server?

lavish hemlock
patent horizon
# quaint mantle Is this the best channel to ask for help on setting up a spigot server?

Step 1: download whatever version of spigot jar you want
Step 2: stick it in a folder
Step 3: make a file called run.bat
Step 4: click the file and click edit (in notepad)
Step 5: enter this in the file:

java -Xmx1G -DIReallyKnowWhatImDoingISwear -jar (name of whatever your server jar is, including .jar) --nogui
pause```
> Step 6: Run the jar. It'll fail the first time because you have to accept the EULA
> Step 7:  Open the file named EULA, and change `false` to `true`
> Step 8: Run the run.bat again.
> Step 9: Connect to your server in game with the ip: `localhost`
young knoll
#

I wouldn't give that flag to newbies

patent horizon
#

what flag

young knoll
#

-DIReallyKnowWhatImDoingISwear

patent horizon
#

oh ye

hasty prawn
#

Doesn't it just yell at your for using outdated versions

#

If you don't put that I mean

winged anvil
#

is there a way to create a custom PotionEffectType?

patent horizon
#

yes

#

PotionMeta

#

items with extra nbt, like playerskulls have their own metas

winged anvil
patent horizon
#

im not sure

#

i got frustrated the first time i messed with potions and havent touched them since

#

the docs were confusing

quaint mantle
#

Why is this so hard to do :/

quaint mantle
#

buildtools first

indigo sage
#

How can I list a full raw config.yml? I just want it's content fully raw

#

I am pretty sure it's possible If I can get the full path to a config.yml but I doesn't look as if spigot supports that

young knoll
mighty sparrow
#

A custom potion effect type? Like what? @winged anvil

indigo sage
#

For a custom potion effect you cannot do it afaik. You can create a BukkitRunnable function with a timer and the custom effect you want and display the time remaining and the effect name in the chat, tablist, scoreboard and or the thing above the hotbar.

crude pine
#

any ideas why EntityExplodeEvent works fine in one world but not another? ExplosionPrimeEvent is fired, but not EntityExplodeEvent. Mob griefing is on

Another thing to note is that it works fine in 1.8 and 1.16, but doesnt work on 1.12. Any ideas or what a workaround might be?

indigo sage
#

This looks like a bug in 1.12 to me. Can you show your code?

crude pine
#
    @EventHandler
    public void fireballExplode(EntityExplodeEvent e) {
        System.out.println("explode!");
    }
    @EventHandler
    public void fireballPrime(ExplosionPrimeEvent e) {
        System.out.println("prime");
    }
#

prime is printed, but not explode!

indigo sage
#

What entity were you testing it with?

crude pine
#

fireball

stone sinew
#

Isn't fireball ProjectileHitEvent or something with projectile?

indigo sage
#

Yea it seems so. Try it with a creeper

crude pine
#

it works fine with a ghast fireball in the nether

indigo sage
#

Pretty sure you go to use ProjectileHitEvent for fireballs. AFAIK the spawned in fireballs might be different than Ghast fireballs.

crude pine
#

the same code works fine on 1.8 and 1.16. just not on 1.12 for some odd reason

#

ill test the spawned in fireballs in the nether

indigo sage
#

AFAIK the fireballs don't actually explode by default.

#

It just produces fire

#

Using ProjectileHitEvent check if Projectile is a fireball create an explosion then you should have a exploding fireball and then you can check it using EntityExplodeEvent

#

/summon Fireball ~ ~3 ~ {ExplosionPower:50,direction:[0.0,0.0,0.0]} use this command to summon a fireball in the overworld and check if the message comes

indigo sage
crude pine
#

im working on it

quaint mantle
#

how to set the mob type in itemstack spawner

indigo sage
#

#4 reply of that should work

crude pine
#

ok, looks like i can actually detect it with ProjectileHitEvent, thanks

#

any idea how to make the fireball do the explosion without manually spawning in one?

#

ig worst case i could just remove blocks manually but eh

#

weird that it works fine in 1.8 and 1.16, but is all funky on 1.12

indigo sage
crude pine
#

yea thats what i want to avoid

indigo sage
#

World world = e.getWorld();

crude pine
#

so nothing other than that?

indigo sage
#

nope

crude pine
#

ok, guess ill remove blocks manually then

indigo sage
#

But why?

crude pine
#

its fireball with custom knockback and damage

#

spawning an explosion will mess that up

indigo sage
#

Why not just create a manual explosion with no power

crude pine
#

if no power, how break blocks?

indigo sage
#

Or mitigate that damage and knockback

crude pine
#

then theres also the issue of having two explosions (and sounds)

indigo sage
#

Using something like PlayerDamageEvent and check if the damage is explosion damage if it is cancel the event

#

that should mitigate the knockback and damage

crude pine
#

yes, but theres still the sounds

summer scroll
#

Does someone know why is this returning true

int upgradeLevel = petPlayer.getUpgrade(upgrade.getName());
System.out.println("Max Level: " + upgrade.getMaxLevel());
System.out.println("Player Level: " + upgradeLevel);
System.out.println("upgrade.getMaxLevel() >= upgradeLevel = " + (upgrade.getMaxLevel() >= upgradeLevel));

Log:
[13:27:44 INFO]: Max Level: 10
[13:27:44 INFO]: Player Level: 1
[13:27:44 INFO]: upgrade.getMaxLevel() >= upgradeLevel = true
crude pine
#

because the max level is greater than the player's level. > mean greater than

indigo sage
# crude pine yes, but theres still the sounds

Yea there is that. You can ask the players to turn down explosion sounds in the settings or you could create a custom texturepack with that sound not added (bad idea) or you just manually remove the blocks

summer scroll
crude pine
crude pine
reef viper
#

can anyone hop in a call and help me with my pluigin

indigo sage
reef viper
#

k

last ledge
#

in /give player

#

player is args 0 or args 1

indigo sage
#

args 9

#

args 0 ***+

last ledge
#

args 9?

#

oh

#

what if I want to count the whole word

#

like give = args 0 ig

#

and player = args 1

indigo sage
#

args = stuff after the initial command

#

args fullform = arguments. Which is the stuff after the initial command

last ledge
#
            if(Bukkit.getPlayer(args[1]) == null) {
                sender.sendMessage(ChatColor.RED + "player offline");
            }```
#

trying to make a command /give (player)

indigo sage
#

if(args.length == 1){
if(Bukkit.getPlayer(args[0]) == null) {
sender.sendMessage(ChatColor.RED + "player offline");
}

summer scroll
last ledge
#

oh got it

#

thanks

#
                ItemMeta Spawner_meta = Spawner.getItemMeta();
                Spawner_meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&e&lDragon Spawner"));
                ArrayList<String> Spawner_lore = new ArrayList<>();
                Spawner_lore.add(ChatColor.translateAlternateColorCodes('&', "&a&L| &7Test"));
                Spawner_lore.add(ChatColor.translateAlternateColorCodes('&', "&a&L| &7Test2"));
                Spawner_meta.setLore(Spawner_lore);
                Spawner.setItemMeta(Spawner_meta);
                Bukkit.getPlayer(args[0]).getInventory().addItem(Spawner);```
#

When I try to run, it gives this error in console

#
        at frolic.dragonspawner.commands.SpawnDragon.onCommand(SpawnDragon.java:24) ~[DragonSpawner-1.0.0.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]```
winged anvil
#

use camelCasing when naming variables

#

so spawner instead of Spawner

indigo sage
#

Does Material.ENDER_PORTAL_FRAME exist

#

also rename Spawner to spawner so you don't get a class when getting something

last ledge
#
                ItemStack spawner = new ItemStack(Material.ENDER_PORTAL_FRAME, 1);
                ItemMeta spawner_Meta = spawner.getItemMeta();
                spawner_Meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&e&lDragon Spawner"));
                ArrayList<String> spawner_Lore = new ArrayList<>();
                spawner_Lore.add(ChatColor.translateAlternateColorCodes('&', "&a&L| &7Test"));
                spawner_Lore.add(ChatColor.translateAlternateColorCodes('&', "&a&L| &7Test2"));
                spawner_Meta.setLore(spawner_Lore);
                spawner.setItemMeta(spawner_Meta);
                Bukkit.getPlayer(args[0]).getInventory().addItem(spawner);

            }```
indigo sage
#

same with everything else and follow @winged anvil advice

last ledge
#

ah The problem is with the item End portal Frame