#help-development

1 messages · Page 1645 of 1

lavish hemlock
#

and then your type parameters, and then >, which ends the list

somber hull
#

Yea i hadnt read this part

lavish hemlock
#

also I accidentally included a void lmao

#

but yeah

somber hull
#

is arraylist a child of list?

lavish hemlock
#

it's a subclass, yes

somber hull
#

ok

lavish hemlock
#

ArrayList extends AbstractList which implements List

somber hull
#

i cee

lavish hemlock
#

you know how methods have parameters?

somber hull
#

uh oh, parent say go bed

somber hull
lavish hemlock
#

well, the value of a parameter isn't decided by the method

#

it's designed by who uses the method

#

a type parameter is just like that, except with the type of a variable

#

so like with String s, someone decides the value of s, but with T thisHasAGenericType, someone decides what T is

somber hull
#

Ok that makes sense

lavish hemlock
#

and with type parameters, you can also say
MyThing<T extends OtherThing>

#

which means T's superclass has to be OtherThing

#

so, MyThing<OtherOtherThing> requires that OtherOtherThing extends OtherThing

somber hull
lavish hemlock
#

aight

#

peace out

somber hull
#

cya

#

thank you for all the help

lavish hemlock
#

You're welcome!

#

If you ever need my help in the future, just message me or smthn

hardy swan
#

shouldn't be learning generics/wildcards type parameters before knowing covariant inheritance

quaint mantle
#

What the hell is covariant inheritance?

hardy swan
#

if S < T, then S[] < T[]

#

for example

quaint mantle
#

So strange math stuffs

hardy swan
#

if S is a subtype of T, then the array S[] is a subtype of the array T[]. In words

quaint mantle
#

That is more understandable (though wrong in Java space to be exact) - actually - no, it does apply

hardy swan
#

yep, it is commonly used in overridden return types

#

can I ask if there are any ways for plugins to query permissions of a player as if querying for configuration section

lost matrix
hardy swan
#

yes. for example, if a player has a permission of example.<number> where number is any arbitrary number, I want to know what it is

lost matrix
#

Hm. You can get the permission as raw String. Im not sure if there is any other way than manual iteration and parsing in O(n)

hardy swan
#

by that you mean iterating through all permissions that player has?

lost matrix
#

Yes

#

Then call startsWith(String) and parse whats behind

torn oyster
#

how send plugin message without any players online

lost matrix
torn oyster
#

sockets i think

#

but how

torn oyster
#

how does spigot send the message

eternal oxide
#

Spigot does not send any Plugin Message without players online

lost matrix
torn oyster
#

is there a work around

#

not using messaging system

#

but like something else

#

i REALLY need to be able to do it

eternal oxide
#

yes UDP sockets

#

its not in the API, its Java

torn oyster
#

could u send me a method that'd work with that i have no idea how to do sockets and stuff

#

or walk me through it

#

so i learn

lost matrix
#

Sockets dangerous if you dont know what you are doing.

torn oyster
#

exactly

#

so can u help me

eternal oxide
lost matrix
#

Everyone can just connect to them and send data to them

torn oyster
#

bro

#

idk if im gonna fuck it up

#

can someone walk me through how to make it

#

specifically for plugin messaging

eternal oxide
#

thats a full tutorial on sockets in java

torn oyster
#

does it tell you how to use it for plugin messaging?

#

i highly doubt it

#

idk what im doing

eternal oxide
#

You can NOT use plugin messaging

torn oyster
#

i know

#

i want to have an alternative to plugin messaging

#

that does the same thing

eternal oxide
#

that is a Mojang feature

torn oyster
#

whta

lost matrix
lost matrix
torn oyster
#

private plugin for public server

hardy swan
#

then the plugin isn't private... (Ignore me)

torn oyster
#

it is?

#

its for my server

lost matrix
#

Then you should consider redis for cross-server communication like game queues and stuff like that

torn oyster
#

ok

#

so how does one use redis

#

i've heard that a lot

lost matrix
#

A while a go i used jedis but now im really stoked on redisson. Both have good documentations.

torn oyster
#

how does redis work

lost matrix
#

You can think of redis as a simple key-value map in memory. Its not started from any of your applications and completely environment agnostic.
This means you can save data in there and access it from multiple applications.
This also includes messaging between all connected applications.

#

redis can do much more than that but the key feature is: In memory key-value database

torn oyster
#

how do i use it

lost matrix
#

Redisson has a nice feature called Topics. You can just subscribe and publish to it and all participants can react to the topic in an event-based fashion.

lost matrix
torn oyster
#

jitpack?

lost matrix
#

Nope. Maven central. Its a big framework used by companies like Netflix, Amazon etc

torn oyster
#

damn

#

ok how do i replace my plugin messaging method with redis

lost matrix
#

The documentation is a bit much and written in enterprise style which can be quite complicated.

torn oyster
#

do u know how

lost matrix
#

Sure

torn oyster
#

public void sendPluginMessage(String channel, String subChannel, int data, UUID uuid) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF(subChannel);
out.writeUTF(uuid.toString());
out.writeInt(data);

    getServer().sendPluginMessage(this, channel, out.toByteArray());
}
#

that method

#

with redis stuff

lost matrix
#

Im just thinking about how i can tell you that this is not something you just swap out.

torn oyster
#

oh

#

what is the best way to do it

#

with swapping out

lost matrix
# torn oyster what is the best way to do it

To be honest im thinking about the struggle of explaining to you how to use docker on your local pc so you can test your redis based applications
locally and came to the conclusion that you dont need to replace the plugin messages. Why do you need to send messages when no player is online?

torn oyster
#

ok

#

so like

#

im trying to get the game's state

#

and what type

#

of minigame it is

#

so i can do like

#

/findgame <player> <minigame>

#

it searches through all the servers open currently

#

and checks

#

are they the minigame i want?

#

if so, it checks

#

are they IN_GAME, PRE_GAME, or POST_GAME?

lost matrix
#

How many users do you have?

torn oyster
#

if it is PRE_GAME, it gets a list of servers that are PRE_GAME and the minigame i want

#

it then gets the one with the highest player count

#

sends em there

#

(makes sure it isnt full either)

torn oyster
#

it will start a new server

#

as the minigame i want

lost matrix
#

Then plugin messages are the wrong choice from the beginning. They should mainly be used to
get proxy related information and not for cross-server communication.
Thats a big topic i struggled for a long time. You should take a step back and explore your options.
Then build some test plugins to fully understand the option you chose and lastly build your plugin
from the ground up with the chosen approach and stick to it.

You options are:
UDP or TCP Sockets for direct connections
REST API for simple messages
In memory grid with pub/sub system like redis.

You need to explore those options and then (this important) abstract away from it.
For example: Write your own spigot events that get fired when communication is initiated.

torn oyster
lost matrix
#

But im 99% sure that you dont need all of that because most servers can handle 50+ players if you dont bomb them with trash plugins.

lost matrix
#

And if the minigames are optimized and you dont even need survival then one instance can easily support 100 concurrent users.

torn oyster
#

currently

#

how it works

#

is u join in

#

the game starts

#

and when its done

#

it restarts

#

is that good

#

for minigames

lost matrix
#

Minigames should be build on a state machine. I would recommend you to build your minigames on one server with one world per minigame for now.
Then have a queue system set up for each minigame.

#

As you described the states could be something like PRE_GAME, IN_GAME, POST_GAME

torn oyster
#

wdym world per minigame

#

like per minigame game mode

#

or minigame instance

lost matrix
#

Per minigame instance

torn oyster
#

doesnt sound too bad

#

what if

#

i wanted to make a thing, where if you right click an npc

#

it brings up a gui where u can select like

#

1.9+ pvp mode and 1.8 pvp mode for minigames

#

how would i tell the minigame server

#

or well

#

how would i enable 1.9+ pvp

#

i would need another server, right?

onyx shale
#

preconfigured in config

#

then you simply use bungee channel to send the player

proven sierra
#

@torn oyster don't write sockets

#

just use redis pubsub for sending information across servers

plain oxide
#

i have a question.
Sometimes the player.teleport () method doesn't work
What should i do?

TeleportClass

public class Teleport {
    public static void teleport(Player player, double x, double y, double z){
        Location loc = player.getLocation();
        loc.setX(x);
        loc.setY(y);
        loc.setZ(z);

        System.out.println(loc);
        player.teleport(loc, PlayerTeleportEvent.TeleportCause.PLUGIN);
    }
}```

```java
for (Player player : Bukkit.getOnlinePlayers()) {
    Teleport.teleport(player,0.0, 30.0, 0.0);        
}

Teleport Class is not considered wrong.
Because it works fine when called from PlayerJoinEvent.

public class OnPlayerJoin {
    public static void onPlayerJoin(PlayerJoinEvent p) {
        Player player = p.getPlayer();
        Teleport.teleport(player,lobbyCoords[0], lobbyCoords[1], lobbyCoords[2]);
    }
}

(EventListener omitted )

eternal night
#

You seem to be missing the event handler annotation

hybrid spoke
#

also an event method isnt static

plain oxide
#

Is adding @eventhandler a PlayerJoinEvent?
Then it has already been added and it works fine

#

also

for (Player player : Bukkit.getOnlinePlayers()) {
    Teleport.teleport(player,0.0, 30.0, 0.0);        
}```

If you call it from here, the processing after Teleport.teleport () will stop.
#
package dorokei.pyuagotto.dorokei;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

public class Start {
    public static void start() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            Teleport.teleport(player,0.0, 30.0, 0.0);
        }
    }
}
native nexus
#

You can put all of your functionality in one class.

hybrid spoke
#

everything you have is totally static abusive

hybrid spoke
#

damn just tagged that guy twice

#

?paste

undone axleBOT
hybrid spoke
#

pls

crude charm
native nexus
hybrid spoke
#

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
check if the args.length != 0 instead of args[0] != null

crude charm
#

Thats maven

#

not intelliJ

#

original is without maven depend shading and normal has it

quaint mantle
#

Hello how do i can get top 10 kills using armorstands?
or holograms api

austere cove
#

Is it possible to make a degenerate bounding box (i.e. where min > max)

tacit drift
#

But in short, use ajLeaderboard or Leaderheads

plain scroll
#

is there a way i can use a custom player head as a mat in item stack?

#

like is there a meta to texture it as a players head?

quaint mantle
#

You need to Set that owner afaik

#

SkullMeta sm ...

#

sm.setOwner

plain scroll
#

so can i do somethin like thi s

#

but with skull meta

quaint mantle
#

yes

plain scroll
#

errr i need to initise the ver

quaint mantle
#

no no

#

sm = (SkullMeta) is.getItemMeta()

#

Dont forget to .Set the Item Meta afterwards!

#
        
        ItemStack playerhead = new ItemStack(Material.SKULL_ITEM);
        SkullMeta sm = (SkullMeta) playerhead.getItemMeta();
        sm.setOwner("Duke42555");
        playerhead.setItemMeta(sm);```
ivory glacier
#

What's the event for a nether portal breaking?

plain scroll
quaint mantle
#

Ver?

#

sm.setOwner(whoToBan);

#

As in var or as in Version?

plain scroll
#

but i get an erro r

quaint mantle
plain scroll
quaint mantle
#

can you show me the full code

#

For fully custom players you need to use NMS

plain scroll
#

also SKULL_ITEM aint a mat?

quaint mantle
plain scroll
#

would PLAYER_HEAD work

quaint mantle
#

Yes

#

Use that

plain scroll
#

kk noice that works

#

just whotoban wont fit in sm.owner

quaint mantle
#

Why?

#

show us the full code

#

?jd

quaint mantle
#

^^^ read it Up yourself I wont do it for you

#

Hey there! I'm not able to find the material type of light block. Can you help me?

plain scroll
quaint mantle
plain scroll
quaint mantle
#

Wont Matter that much

#

What is whoToBan?

plain scroll
#

a player

quaint mantle
plain scroll
#

oh

#

2 secsv

quaint mantle
#

You might need NMS for fully custom textures

quaint mantle
plain scroll
#

i legit forgot where it is lmao

quaint mantle
#

Use setOwningPlayer

#

Fr READ THE DOCS FFS

plain scroll
#

yup

#

that worked

#

still a player head

#

but i think ik whu

#

its bc mat is PLAYER_head

quaint mantle
#

use SKULL_ITEM

plain scroll
quaint mantle
#

oh u did?

plain scroll
#

?

#

SKULL_ITEM cant be resolved so idk if it is an acc mat

#

from the api

#

just checked the doc and people use (short) SkullType.PLAYER.ordinal());

#

BUT

#

that still aint wokin

quaint mantle
#

Isn't Skull_ITEM legacy?

plain scroll
#

yuh

#

this

#

deprecated tho

quaint mantle
#

So you are running 1.13+?

plain scroll
#

1.17.1

#

latest yeh

quaint mantle
#

So dont use legacy

plain scroll
#

im not gonna lol

quaint mantle
#

But I Wonder, wth is SKULL_ITEM?

#

OH

#

Playerhead is Block and Skull Item the Item?

plain scroll
#

so yuh PLAYER_HEAD

#

is correct

#

just it aint workin

quaint mantle
#

Yeah, SKULL_ITEM does Not exist

plain scroll
#

so... what can i use

#

that would acc work

quaint mantle
#

Has the Player been online once?

plain scroll
#

yup

#

more then once

#

wait.......

#

it work

#

s

quaint mantle
#

Oh lol

plain scroll
#

lmao

#

just not here

quaint mantle
#

Did you use .setItemMeta?

plain scroll
#

this works

#

this dont work

quaint mantle
#

Yea

plain scroll
#

would this work

quaint mantle
#

Dont Set Item Meta twice

#

Reuse the same instance

plain scroll
#

?

#

i dont set it twise?

quaint mantle
#

. get Item Meta clones the object

young knoll
#

Yes you do

plain scroll
#

oh

#

lmao

young knoll
#

Just make all the modifications to a single SkullMeta

quaint mantle
#

SkullMeta extends ItemMeta

#

So dont worry about that

plain scroll
#

works!

#

i just changed some things arround

#

lmao

grim ice
#

how to check if a certain block is an exact block i want? i cannot use pdc

grim ice
#

yeah i had that idea but is it really efficient

dense goblet
#

If you have a bunch of them just store in a hashmap

#

O(1) avg lookup

grim ice
#

o

#

ok ib

#

ig

hybrid spoke
plain scroll
#

how would i kick someone from a server? like p.kick

#

lmao

dense goblet
#

If it's always the same block type you can use a HashSet instead

plain scroll
#

nvm

#

foudn it

hybrid spoke
plain scroll
#

yeh i found it

slim kernel
#

Hello! Has anyone an Idea why that does not work? The Zombie just doesnt move at all...

EntityType entityType = EntityType.ZOMBIE;
RayTraceResult rayTraceResult = player.getWorld().rayTraceEntities(player.getEyeLocation(), player.getEyeLocation().getDirection(), 10, 5, (entity) -> entity.getType() == entityType && entity != player);

Vector vector = player.getLocation().getDirection();
vector.multiply(2);
vector.setY(1);

rayTraceResult.getHitEntity().getLocation().setDirection(vector);
dense goblet
#

I believe

plain scroll
#

ok so how can i add like a 2sec wait before i do a sout

#

like add waits between each

dense goblet
plain scroll
#

kk

slim kernel
quaint mantle
#

You can use an executor if you’re not in Bukkit

#

Which has scheduleWithDelay

#

If you’re in Bukkit you can use runTaskLater from Scheduler

dense goblet
slim kernel
hybrid spoke
slim kernel
hybrid spoke
#

and so he gets kicked along the direction

#

just like you set it

#

makes sense, no?

dense goblet
#

Only where they are facing

grim ice
#

is there .isAir() in 1.8.8 spigot?

slim kernel
#

yes you are right I just tested it

quaint mantle
slim kernel
#

does anyone know how I can get where the player is moving to?

dense goblet
#

@slim kernel intellij should show you all the possible functions if you write player.

slim kernel
dense goblet
#

Is there getVelocity or something similar

slim kernel
#

yes but getVelocity is only in one direction so the zombie gets kicked back everytime doesnt matter if the player walks right left or forward

dense goblet
#

Velocity should be a vector

plain scroll
#

wait im a bit confused....

#

how cani make this just kick the player

#

bc when i use p. it kicks me

young knoll
#

Call it on the target

slim kernel
plain scroll
slim kernel
#

I always get 0.0,-0.07875184,0.0 for that:

Vector vector = player.getVelocity();
        player.sendMessage(player.getVelocity().toString());

Why is it like this although I am moving?

#

the y changes a little bit everytime but x and z dont

dense goblet
#

@slim kernel try PlayerVelocityEvent then store it somewhere

lyric grove
#

This is returning a npe

slim kernel
young knoll
lyric grove
#

dont think it would be

eternal night
#

It would

#

Your main class is created by the plugin loader

#

During the initialisation you define a field of the hologram manager type

#

Meaning that class is loaded by the class loader

grim ice
#

why cant i use 1.8.8?

eternal night
#

And you apperantly channelled all your OOP knowledge and called a static method from your main class in there

#

Which is before your onEnable was ever called

#

Just because intellij doesn't spoon feed it to you doesn't mean you can't

lyric grove
#

oh thanks, ill fix that

eternal night
#

Have you actually tried

grim ice
#

i tried to write it myself

eternal night
#

What version string did you use

grim ice
#

Dependency 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' not found

eternal night
#

1.8.8-R0.1-SNAPSHOT definitely still exists

#

Did you apply your pom changes

grim ice
#

then?..

#

wdym

eternal night
#

Intellij presents you with a cute little button in the top right of your pom file

#

That you have to click after you modify it

#

So it updates it's maven model

lime jay
#

Help i made a 1.16.5 flat world generator and now im porting to 1.17.1 its broken ```public class CustomChunkGenerator extends ChunkGenerator {

@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
    ChunkData chunk = generateChunkData(world);

    for (int X = 0; X < 16; X++)
        for (int Z = 0; Z < 16; Z++) {
            chunk.setBlock(X, 49, Z, Material.GRASS_BLOCK);
            chunk.setBlock(X, 0, Z, Material.BEDROCK);


            for (int y = 48; y > 44; y--) {
                chunk.setBlock(X, y, Z, Material.DIRT);
            }

            for (int y = 44; y > 0; y--) {
                chunk.setBlock(X, y, Z, Material.STONE);
            }
        }
    return chunk;
}

}```

grim ice
#

yea nothing changed

#

wait fuck

#

im a stupid low life

eternal night
#

Ooof

lime jay
# grim ice yea nothing changed

and register it in main class like this right? @Override public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) { return new CustomChunkGenerator(); }

grim ice
#

wrong reply

#

lol

slim kernel
#

Why is the x and z 0 everytime although I am moving can somebody help me pls?

Vector vector = player.getVelocity();
        player.sendMessage(String.valueOf(player.getVelocity().getX()));
        player.sendMessage(String.valueOf(player.getVelocity().getY()));
        player.sendMessage(String.valueOf(player.getVelocity().getZ()));
grim ice
#

how do i make java docs appear

vale ember
#

hey i have a problem with ArmorStand.remove() it just don't work sometimes without any reason

unreal quartz
grim ice
#

how

unreal quartz
grim ice
#

nothing happened

#

maybe my pom is wrong?

next spade
#

How can I access the config from a different class than the Main class?

unreal quartz
chrome beacon
grim ice
#

so what do i do @unreal quartz

unreal quartz
#

check ur dependencies in intellij

#

you probably manually added it and forgot about it

shy wolf
#

hey!
any one know y my code not working?

#
new BukkitRunnable() {

                @Override
                public void run() {
                    Player player = Bukkit.getOnlinePlayers().stream().skip(new Random().nextInt(Bukkit.getOnlinePlayers().size())).findFirst().get();

                    player.setGlowing(true);
                    for(Player p : Bukkit.getOnlinePlayers()){
                        if(plugin.a_event_p_list.contains(p.getDisplayName())){
                            p.sendMessage("מישהו נבחר!" + player.getDisplayName());
                        }
                    }
                    for (Player p : Bukkit.getOnlinePlayers()){
                        if(!plugin.hider.contains(p.getUniqueId())) return;
                        p.setMaxHealth(2);
                    }

                    plugin.seeker.add(player.getUniqueId());

                    ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
                    ItemMeta swordmata = sword.getItemMeta();
                    swordmata.setDisplayName("killer sword");
                    sword.setItemMeta(swordmata);

                    player.getInventory().clear();
                    player.getInventory().addItem(sword);

                    player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,10,255));
                    player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10,255));

                    ScoreboardManager manager = Bukkit.getScoreboardManager();
                    assert manager != null;
                    Scoreboard board = manager.getNewScoreboard();
                    Team team = board.registerNewTeam("RedGlow");
                    team.setColor(DARK_RED);
                    team.addEntry(player.getDisplayName());

                }

            }.runTaskLater(this.plugin, 5 * 20);```
next spade
grim ice
shy wolf
#

pom.xml

grim ice
#

?paste

undone axleBOT
chrome beacon
grim ice
chrome beacon
#

Why is optional true

next spade
chrome beacon
grim ice
#

@chrome beacon should i make it false

chrome beacon
#

Javadoc can keep it just remove it entirely from the api

grim ice
#

what

#

Oh

#

still thaat doesnt fix the problem

shut plaza
#

I want to Shoot the particle and extinguish fire at particle passed

grim ice
#

@chrome beacon u there

next spade
shy wolf
grim ice
#

help

ivory sleet
undone axleBOT
ivory sleet
ivory sleet
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

grim ice
ivory sleet
#

Elaborate appear?

#

Generate them?

grim ice
#

no, like when u hover over smth

ivory sleet
#

Oh

grim ice
#

it shwos the java docs

ivory sleet
#

Wat

grim ice
#

bruh

shut plaza
#

How to make entity WALK, not teleport a little, WALK like pig, horse, strider, etc

ivory sleet
#

Oh

#

You add <classifier>source</classifier>

#

In the dependency block

grim ice
#

what should source be

ivory sleet
grim ice
ivory sleet
#

I told you

grim ice
#

what

#

u didnt

#

inside the classififer

ivory sleet
#

bruh

dusk flicker
#

Lmao

grim ice
#

source, what should it be

ivory sleet
#

it literally says source

#

Tho I have my suspicion it might not work

tardy delta
#

where do i need to put <include> tags in pom?

ivory sleet
#

worth a try (:

tardy delta
#

for dependecy

chrome beacon
#

You shading?

ivory sleet
#

Even official

tardy delta
#

do i need that?

#

its for this
#general message

ivory sleet
#

Probably want to relocate also

grim ice
#

bruh

#

im done

#

maven shit is so confusing

tardy delta
#

i dunno : (

ivory sleet
#

Good way to avoid unnecessary LinkageErrors

grim ice
#

cant i just not use it

ivory sleet
grim ice
#

its so fucking confusing

tardy delta
#

gradle goes brr

grim ice
#

Please fix JAVA_HOME environment variable

chrome beacon
#

Gradle has given me more problems than Maven

grim ice
#

when i try to use gradle

#

fuck my life

chrome beacon
#

Then fix it?

ivory sleet
#

Bruh

ivory sleet
#

Biased

chrome beacon
#

The duplicate file error took me like 2 hours to fix

#

(When trying to shade)

unreal quartz
grim ice
#

ill try to use the minecraft dev plugin in intellIj then just import the 1.8.8 spigot jar myslef

unreal quartz
grim ice
#

cuz im so fucking done lmao

hybrid spoke
unreal quartz
hybrid spoke
#

but yeah for minecraft plugins etc. it can be simple

grim ice
#

what

ivory sleet
unreal quartz
#

you've imported the spigot jar locally with contains no javadoc

hybrid spoke
#

just dont build your projects

ivory sleet
#

Hmm I guess yeah

#

The truth

grim ice
#

wat is da solution

reef wind
#

maven is easy

unreal quartz
#

don't import the jar manually and just use maven

late stone
#

how do I import nms to my plugin??

chrome beacon
shut plaza
#

How to shoot white particle and extinguish fire at particle passed?

grim ice
#

i used minecraft dev plugin then just changed the Maven: org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT

#

to Maven: org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT

#

in Libraries in plugin structure

#

wont that be a ez spoonfeeded solution

chrome beacon
#

Or you know just open the pom and change it like a text file

unreal quartz
#

just change the version string in maven

grim ice
#

ok i did what i said and what u said

#

pog

#

ez spoonfeed

reef wind
#

idk if .extinguish() exists

dense goblet
#

Could make a virtual projectile you manage manually instead of using an arrow

#

Then spawn particles such that they match

marble granite
#

should this code not remove the zombies AI?

public class AggressiveZombie extends EntityZombie {
    public AggressiveVillager(Location loc) {
        super(((CraftWorld) loc.getWorld()).getHandle());

        //setting the location of the EntityVillager in the EntityVillager class.
        this.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getPitch(), loc.getYaw());

        this.setHealth(20.0f);
        this.setCustomName(new ChatComponentText(ChatColor.translateAlternateColorCodes('&', "&caggressive Zomboid mf")));
        //make it visible..
        this.setCustomNameVisible(true);
    }

    @Override
    protected void initPathfinder() {
        super.initPathfinder();
    }
}
``` or am i forgetting something (no the goal is not to remove its ai, i just tested it to see if it works and it didnt)
#

im at 1.16.5

#

it spawns just fine, but it moves like a normal zombie

#

oh hey turns out i do not know how to properly extend classes lol

#

the super isnt suppossed to be there

eternal night
#

why would that remove the AI ?

marble granite
#

because the pathfinder doesnt have anything in it?

#

i meant moving ai, but it works

eternal night
#

Well you are not overwriting the aiStep methods or anything

#

so they just default to whatever the parent class defines

quaint mantle
#

my code:

        if (cmd.getName().equalsIgnoreCase("topkills") || cmd.getName().equalsIgnoreCase("lb")) {
        
            ThreadPool.SQL_POOL.execute(() -> {
                List<String> top = Main.getInstance().getAPI().getTop(10);
                
            
                int i = 0;
                for (String si : top) {
                    i++; 
                    int kills = Main.getInstance().getAPI().getKillsByName(si);
                    MinecraftServer.getServer()
                            .postToMainThread(() -> createArmorStand("§b" + "1" + ". §f" + si + " §-  §d" + kills,
                                    player.getLocation().add(0, -0.3, 0)));


                }
                

            });

        }```
#

i just want to move armor stands

hybrid spoke
#

just set the Y -1?

lost matrix
#

MinecraftServer.getServer().postToMainThread <- Dont
Just use the BukkitScheduler instead

lost matrix
quaint mantle
#

@lost matrix well thx !

lost matrix
#

Oh. 3 options:
Use MutableInt
Create a new variable which is effectively final
Use AtomicInteger

#

Oh there is another one

lost matrix
quaint mantle
#

thx!!!!

#

i'll try it

#

thx ❤️

tardy delta
#

for some reason this outputs

Utils.message(player, Utils.colorize(sell ? "&a+&b " : "&c-&b " + String.format("%.1f %n", amount * price) + " &3coins"));

and i'm sure amount and price have a value different from zero

lost matrix
regal lake
#

I have 2 EntityDamageByEntityEvent Event listerns.
In the first event i change the damage e.g. to 18, if i now do

Bukkit.broadcastMessage("DAMAGE : " + event.getDamage());

the 18 is gone, so i get a other damage amount.

The order of the events is correct, the second listener (with the broadcast) will be executed AFTER the first one.
Any ideas ?

lost matrix
regal lake
#

Oh i forgot to write that i don't get the 18 on the second listener (broadcast message)

lost matrix
#

Show both listener methods pls. Do you use priorities?

eternal oxide
#

getFinalDamage ?

regal lake
eternal oxide
#

?paste as 7smile7 said, show both your methods

undone axleBOT
tardy delta
#

(that means thank you)

quaint mantle
#

no

lost matrix
#

Hm. Does every listener access the same event instance? I think so.
Meaning setting the damage should affect every following event handling.

tardy delta
eternal oxide
#

It shoudl yes, as you can check the cancelled state in later events

quaint mantle
#

stop

#

its not cute

tardy delta
#

😔

regal lake
toxic mesa
#

I have smth rlly weird and i'm not sure if it's just a bug or what;
Just using this to get main class
private main plugin = main.getInstance();
Which apparently is null. In a different class I have the exact same and that's not null. Does anyone know wth is going on?
I'm loading the class and it just spit's out a null error when using a method in the class

toxic mesa
undone axleBOT
quaint mantle
hybrid spoke
#

?paste

undone axleBOT
quaint mantle
#

send it here

#

its a help channel

regal lake
#

I can't make it public as it is a customer project 😅

quaint mantle
#

nobody cares

eternal oxide
#

its two events of course you can post it here

lost matrix
regal lake
#

The customer cares 😄

quaint mantle
lost matrix
toxic mesa
#

I have

eternal oxide
#

Then get better at java and fix your own errors. If you can;t show us the code.

toxic mesa
#

First thing I do is setting the instance

#

after that i'm loading the classes

#

both classes are after setting the instance

#

it's weird af

quaint mantle
#

you should be using di anyways

#

?di

undone axleBOT
lost matrix
hybrid spoke
quaint mantle
#

^

regal lake
quaint mantle
#

post the damn code

eternal oxide
#

We all do, then we ask for help and show the problem

lost matrix
lost matrix
# hybrid spoke you have a customer but have to ask here for help for a project which is most li...
      @EventHandler(priority = EventPriority.LOW)
      public void onDamageA(final EntityDamageByEntityEvent event) {
        System.out.println("DamageA: " + event.getDamage());
        event.setDamage(10);
      }

      @EventHandler(priority = EventPriority.HIGH)
      public void onDamageB(final EntityDamageByEntityEvent event) {
        System.out.println("DamageB: " + event.getDamage());
      }

Resulting in:

[16:18:35 INFO]: DamageA: 1.0
[16:18:35 INFO]: DamageB: 10.0

So everything works as expected.

regal lake
lost matrix
#

What version?

vital ridge
lost matrix
#

Woops wrong ping

vital ridge
tardy delta
eternal oxide
regal lake
#

@lost matrix

lost matrix
eternal oxide
#
event.setDamage(event.getDamage() / 100 * 150);
Bukkit.broadcastMessage("ASSASIN SET DAMAGE" + event.getDamage());```
#

Is what you need

lost matrix
#

You just display the wrong value

regal lake
#

As i said.. sometimes there are small issues.. In germany we would say: "Manchmal sieht man den Wald vor lauter Bäumen nicht"
Thanks, i will test it.

lost matrix
#

Thats one example why its important to have a lot of meaningful variables even if it seems verbose sometimes.

eternal oxide
#

Instead of divide by 100 and multiply by 150, just multiply by 1.5

regal lake
#

Yes, that was the issue.
Thanks @eternal oxide and @lost matrix

lost matrix
#
      @EventHandler(priority = EventPriority.LOW)
      public void onDamageA(final EntityDamageByEntityEvent event) {
        double initialDamage = event.getDamage();
        double modifiedDamage = initialDamage / 100D * 150D;
        event.setDamage(modifiedDamage);
        System.out.println("Damage: " + initialDamage);
      }
regal lake
#

Custom Textures, i guess

lost matrix
#

You need a resourcepack for that

lucid bane
#

guys,
I want to replace my scoreboard's String portion, not a integer
Is there any way except making a new Objective?

fleet cosmos
#
EntityPlayer op = ((CraftPlayer)e.getPlayer()).getHandle();
                        GameProfile gameProfile = new GameProfile(UUID.randomUUID(),ChatColor.translateAlternateColorCodes('&', "&4&lFake Player"));
                        EntityPlayer fakeplayer = new EntityPlayer(op.c,((CraftWorld)e.getPlayer().getWorld()).getHandle(),gameProfile);
                        PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a,fakeplayer);
                        for(Player p : Bukkit.getOnlinePlayers()) {
                            ((CraftPlayer)p).getHandle().b.sendPacket(packet);
                        }

can u tell me what's wrong with this code , it doesn't add the fake player to the tablist :((

minor wedge
#

where does multimap come from and how can I include it in my gradle plugin?

eternal night
#

I believe it is part of guava

#

Their commons to be exact

#

It should be exposed by spigot API tho

minor wedge
#

not for me, but im using paper api so ill ask there

eternal night
#

Paper should also expose it

halcyon coral
#

Is there any method to start a raid

tardy delta
#

raid.start()

quaint mantle
#

is there any way to kill all armorstands entites?

tardy delta
#

: )

quaint mantle
#

or minecraft command

#

i want to kill all armorstands

tardy delta
#

/kill @e[type=armor_stand]

quaint mantle
#

or that

#

Entity type 'armor_stand' is invalid

lost matrix
quaint mantle
quaint mantle
halcyon coral
quaint mantle
#

hes joking

quaint mantle
halcyon coral
#

Are you sure that's the way to do it

quaint mantle
#

?

tardy delta
quaint mantle
halcyon coral
#

What's that

quaint mantle
#

or, try spawning a pillager in the village

tardy delta
#

?

halcyon coral
#

And is there anyway to have multiple raids at once

tardy delta
#

prob

tardy delta
#

make a new object?

quaint mantle
#

???

tardy delta
#

nvm

halcyon coral
#

Can I have multiple raids happening in the same place at once

tardy delta
#

why is google that trash atm

quaint mantle
#

no

halcyon coral
#

If there's a raid and I spawn pillagers in the village will they become raiders

#

Or is there anyway to add more raiders

#

I'm trying to make a plugin to cause a massive raid

quaint mantle
#

just spawn pillagers

halcyon coral
#

And they'll count as raiders?

quaint mantle
tardy delta
#

no

halcyon coral
#

Is there any way for me to make them count as raiders

quaint mantle
#

Jesus christ

#

spawn the damn pillager

#

!!!

halcyon coral
#

Fourteenbruh just said it won't count

quaint mantle
#

hes joking

halcyon coral
#

K

#

Thx

tardy delta
#

if you just spawn random pillagers 🤔

#

why would that be a raid

quaint mantle
tardy delta
#

smh

quaint mantle
tardy delta
#

but if you want to start one where there are no villages?

#

aha

quaint mantle
#

just stop

tardy delta
#

hihihi

dense remnant
#

I want to create a kind of vault gui and I need to get an Event when any slot changed inside the inventory to properly safe it to prevent dupes.

How do I do this?

lost matrix
dense remnant
#

idk as it might allow dupes
I already know the case where the server reloads and the player leaves

lost matrix
#

How would it allow dupes?

dense remnant
#

If someone would take an item out and the server cant save it because it was unable to catch the closing

lost matrix
#

Oh you mean when reloading. Reloading is not supported and should never ever be done one live servers anyways.

opal juniper
#

^

#

owners do it tho

#

should pr to spigot the removal of /reload

#

lmao

#

like i really don’t know why it hasn’t been removed

lost matrix
#

I mean it already yells at you that reloading is stupid and you shouldnt do it. If you do it anyways then
its your own fault.

opal juniper
#

fair enough

#

but people are stupid

quaint mantle
chrome beacon
#

I've had way too many people using /reload or plugman comming to our support chat because the plugin doesn't work

quaint mantle
#

other than that itd poopoo

stiff topaz
#

I know this isn't really the right place to ask this, I am having trouble using the SpigotAPI on my website to show a plugin's version. It is denying access

quaint mantle
#

dony use legacy

stiff topaz
#

what should I be using

chrome beacon
#

non-legacy 🧠

stiff topaz
#

Getting the same error any way

quaint mantle
#

send code

#

@stiff topaz

stiff topaz
#
<div id="plugin-version">
</div>
<script>
    $(function(){
      $("#plugin-version").load("https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=91015");
    });
</script>

This code will work on any other website

#

I think it's to do with Spigot's cloudflare

quaint mantle
#

@jade perch

quaint mantle
#

wtf

stiff topaz
jade perch
#

I changed the link

stiff topaz
#

I want to get the latest version

jade perch
#

new one only requires resource

stiff topaz
#

How can I extract just the version from that

jade perch
#

it's JSON

opal juniper
#

xD

#

just use gson

ivory sleet
#

Moshi tho

opal juniper
#

no

ivory sleet
#

Yes

opal juniper
#

no

ivory sleet
#

Gson ded

opal juniper
#

no

#

mr fanboy

ivory sleet
#

yes actually

opal juniper
#

use gson

#

xD

#

idk use whatever conclure uses cause he is conclure and very cool

ivory sleet
#

But like uh I will just link ya response from google dev

opal juniper
#

ThAtS NoT gOOgLE

ivory sleet
#

No it isn’t

opal juniper
#

oh wait@

ivory sleet
#

But it’s from someone who was developing gson

opal juniper
#

i didn’t see dev xD

#

well

#

i think i know why you like it

#

“Upcoming Kotlin support”

#

lmao

ivory sleet
#

That’s a bonus nevertheless

jade perch
#

convert that to jquery or whatever, but that's how you extract it

quaint mantle
#

why leave java

#

and spigot

#

How to replace an item in the GUI with another item with a name when clicked?

jade perch
#

I haven't left I still maintain hpwp and i'm working on a new plugin -.-

stiff topaz
lucid bane
#

I want to replace my scoreboard's String portion, not a integer
Is there any way except making a new Objective?

frigid falcon
#

Hello, i have some problems with maven and spigot 1.8.8 could someone send me a working pom.xml?

frigid falcon
#

Wait

chrome beacon
frigid falcon
#

Wait i missed to type sth

#

Sorry

#

In my message

#

But i figured it out

jade perch
frigid falcon
#

I didnt even want to send this message fixed it some time ago thank you tho :)

quaint mantle
chrome beacon
#

Inventory#setItem

opal juniper
#

event?

chrome beacon
#

I assume they mean method

opal juniper
#

that ain’t an event olivio

#

lmao

chrome beacon
#

I am speeed

unreal quartz
# stiff topaz

this is a problem with the configuration on spigot's end and you can't do anything about it

quaint mantle
#

setType(Material.AIR) works, but how do I give a name to the changed item?

chrome beacon
quaint mantle
#

and how to use it? I wrote the air for an example

chrome beacon
#

Use getItemMeta on the item then set the display name and then set the ItemMeta back on the item

waxen plinth
#

Does anyone know the 1.17 method to convert from Material to nms IBlockData

#

In 1.8 it's nms/Block.getByCombinedId

quaint mantle
waxen plinth
#

1.17 has that method as well, but I fear it won't work with the modern Material

chrome beacon
opal juniper
waxen plinth
#

Mmk

toxic mesa
#

What protocollib packet could I use to detect player movement?
If I use REL_ENTITY_MOVE and simply this piece of code;

            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                Bukkit.broadcastMessage(String.valueOf(packet.getBooleans().readSafely(0)));    
            }

it detects all entities expect my player which is weird af

opal juniper
grim ice
#
Please fix JAVA_HOME environment variable.```
quaint mantle
grim ice
#

in IntelliJ IDEA

#

pls help kthx

quaint mantle
#

set the jdk in project settings

#

gradle sucks

grim ice
#

i need it for forge

quaint mantle
#

stupid forge

chrome beacon
grim ice
#

wdym stupid bruh

quaint mantle
#

forge sucks

#

fabric better

chrome beacon
#

Forge is good

grim ice
#

also imaginedev what shit r u saying rn

#

fabric is way worse

quaint mantle
#

ItemStack clickedItem = event.getCurrentItem();

#

fabric > forge

grim ice
#

in performance yes

#

in functionality 100% no

#

many people agreed to that

quaint mantle
#

clickedItem.setType(ItemUtil.create(Material.ACACIA_DOOR, "asd"));

#

not worked

chrome beacon
#

I told you to use ItemMeta

#

That's not ItemMeta

quaint mantle
#

in ItemUtil it is

#

Whut

chrome beacon
quaint mantle
#

event.setCurrentItem

chrome beacon
#

if ItemUtil creates an item for you use setItem

quaint mantle
#

ItemStack clickedItem = event.getCurrentItem();

fluid cypress
#

is there any way to "un" generate a chunk to save disk space?

chrome beacon
quaint mantle
#

@chrome beacon

reef wind
#

and he is back..

chrome beacon
#

I have no idea

#

You would have to parse the world and delete stuff

quaint mantle
chrome beacon
#

I know that the WorldBorder plugin can do this. You can take a look there

fluid cypress
#

maybe deleting mca files inside the region folder? idk

reef wind
#

Olivo I warn you too not borher with the guy that pinged you, he doesn't even seem to understand english (not harassing I am serious) because he never listens and doesn't do what you say, he has pinged around 5 people with the same shit multiple times.

quaint mantle
#

no

reef wind
chrome beacon
quaint mantle
#

Because what you said didn't work and I checked it

reef wind
#

I never said anything and you never provided information

#

all you say is "not work" "not working" "not worked"

chrome beacon
quaint mantle
reef wind
#

you didn't provide info now either

quaint mantle
#

I wrote above

reef wind
#

reply to it

reef wind
chrome beacon
#

It should work 🤔 Try asking Paper about that

reef wind
#

I am not going to deal with you again anyway, I am moving to the chill place.

quaint mantle
quaint mantle
reef wind
#

😐

quaint mantle
#

I need to replace this item with another one with a different name when clicking on an item in the GUI

reef wind
#

that is not how it works

#

if you are trying to replace it with that

chrome beacon
#

Oops sorry for the ping

reef wind
quaint mantle
reef wind
#

the mods are chill

reef wind
#

that is the answer

quaint mantle
dense goblet
#

event.setCurrentItem(the new item);

chrome beacon
dense goblet
#

setClickedItem then?

chrome beacon
#

No it's setCurrentItem

reef wind
dense goblet
#

Maybe he's on an old version

chrome beacon
#

I don't think that has changed

dense goblet
#

Or the event is the wrong type

reef wind
quaint mantle
dense goblet
#

Use a keyboard

reef wind
#

witch is not the event

chrome beacon
#

^^

dense goblet
#

This is kinda funny ngl

reef wind
#

key-board

#

it's the thing that you type on

#

it's is short for "it is"

#

clear enough?

quaint mantle
#

event.setCurrentItem(ItemUtil.create(Material.STONE, "asd"));

#

it works, thank you very much

reef wind
#

congrats!

wary harness
#

So having a problem after saving message.yml file

#

after file is edited

#

and all lines are inside double quotation marks

#

after u save

#

they are back to single quotation marks

#

which is some cases brakes config

eternal oxide
#

single is the correct format

wary harness
#

well it fucks up whole thing

#

give me sec

eternal oxide
#

Not if you read the file correctly

wary harness
#

example

#

here

#

be default it was in double quotation marks

eternal oxide
#

you have to escape ' if you want to use it in a string

wary harness
#

after file got saved because there was added some values

#

well that happended after auto update of config

young shell
#

So, I'm currently trying to Replicate the Spigot Annotation Processor and I have Issues narrowing down how to get the plugin.yml File. From what I can tell, the Spigot one uses a RoundEnvironment to get the File but I couldn't find any good Info on how to get that one. Any Help is greatly appreciated

eternal oxide
#

There is no auto update on configs

wary harness
#

which added missing lines

#

and then I save it

eternal oxide
#

your original file is wrong, you have to escape the ' to use it in a string in yaml

gentle venture
#

Anyone here have any idea how to connect a minecraft plugin to an external Node JS server?

chrome beacon
#

You can use Sockets or a REST API

#

It really depends on what you want to do

gentle venture
#

Tytyty I am trying to get my head round Sockets atm 🥲

#

I am wanting to upload chat Log files to a Node JS server

wary harness
eternal oxide
#

Just format it correctly

wary harness
#

I personaly think it is better

#

what back slash at fron every special carracter

chrome beacon
gentle venture
#

Eh all of it right now but i should be ok, using sockets should work for that right?

eternal oxide
#

yes, \ before '

gentle venture
#

I just gotta take some time to sort of comprehend all the info i am reading lol

#

just got back from work so I am very tired

wary harness
#

that is so retarded

#

xd

#

and u need to use it at front of the most special carracters

#

I think

#

or am I wrong about

#

it

#

@eternal oxide

eternal oxide
#

only characters that can terminate a string

wary harness
#

like ?

gentle venture
eternal oxide
wary harness
dense goblet
#

' and " mostly

eternal oxide
#

\ before '

wary harness
#

ah fuck it that is so ugly

#

so dam ugly

dense goblet
#

It's standard

#

You get used to it

wary harness
#

if you want to use \n

#

as I remember that is not working

#

with ' '

eternal oxide
#

you escape it

#

\n

torn shuttle
#

escape characters are fun

eternal oxide
#

with an extra \

wary harness
#

so \n

#

dam \ \ n

dense goblet
#

\\n will display as \n

tame coral
#

I have both jdk 14 and jdk 16 installed and i want to build spigot 1.15.2 using buildtools but it keeps using java 16, is there a way to force it to use java 14 ?

quaint mantle
#

?google set java home variable

undone axleBOT
chrome beacon
#

Instead of starting the command with java use the path to the java.exe

tame coral
#

okay thanks

quaint mantle
#

that works too

toxic mesa
#

This may be a dumb question but if I have a packet on the protocol wiki, how can I get the PacketType from protocollib for it?

tame coral
chrome beacon
#

Setting Java home gets quite annoying if you have to keep swapping it

quaint mantle
toxic mesa
#

yup

#

edited my message

#

to be a bit clearer

chrome beacon