#help-development

1 messages · Page 1364 of 1

worn tundra
#

There's your problem

sullen marlin
#

if you just read the error for a second, or even googled it, the issue would be obvious

crude charm
#

ok md_5 🙏

worn tundra
#
Caused by: java.lang.UnsupportedClassVersionError: me/zoibox/core/core/Core has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
crude charm
#

OMG

#

not this again

#

I was having version issues before

#

I'm running java 11

#

but

#

idk

#

oh yeah

#

when I tried java 8

#

it didnt work

worn tundra
#

Yeah, and apparently your server is running Java 8

crude charm
#

it is

worn tundra
#

or other

crude charm
#

hmm

#

if I make it run java 16

#

will this work

worn tundra
#

lol

crude charm
#

16 is the newest

#

well u need to use an api

#

u cant

worn tundra
#

Same way you would use your own classes / methods

crude charm
#

if they made it public

#

if its private ur fucked

worn tundra
#

Either tools like Gradle or Maven, or adding the .jar file to your projects build path

#

Depends on your IDE too

#

If the project you're trying to use uses Maven, then you can use that

quaint mantle
#

Hey, how can i set player's uuid when settiing the pendingConnection to onlien mode

graceful turret
#

is there any nether portal entry event?

peak depot
graceful turret
#
    public void portal(PlayerPortalEvent e) {
        if (e.getTo().getWorld().getEnvironment() == World.Environment.NETHER && !nether) {
            e.setCancelled(true);
        }

        else if (e.getTo().getWorld().getEnvironment() == World.Environment.THE_END && !end) {
            e.setCancelled(true);
        }
    }``` i did something like this
peak depot
graceful turret
#

yeah

peak depot
#

i think there were options in the server properties

graceful turret
#

🤦

#

i knoow

#

i want to do it in game without server closing

#

or restarting

peak depot
#

mhh

#

you can try it on your localhost if your plugin works

abstract spindle
#

Hey Guys can anyone tell me how i can Check if an Inventory is a org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryCustom and not a org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryCustom. I get my Inventory from the InventoryClickEvent with the function event.getClickedInventory()

unreal kayak
#

Omg its 1 ` not 2 of them

abstract spindle
river spear
#

How can I remove the cape in an NPC packet because I gave the NPC a name and it then gets a random cape, the skin is created with value and a signature

hollow arch
#

If I just make a class and implement CommandSender and simply store the result of sendMessage in an ArrayList and then simply do ```java
StringBuilder result = new StringBuilder();
CommandResult cmdResult = new CommandResult();
cmdResult.setOp(true);

                Bukkit.dispatchCommand(cmdResult, "say yes hello");

                result.append(cmdResult.getResult().get(0));
Why does it say that command sender has no perm?
#

I know the StringBuilder is useless in this case, feel free to ignore it

drowsy helm
#

why do you want to implement CommandSender?

hollow arch
#

To get a result of a command.

drowsy helm
#

most bukkit classes werent inteded to be extended or implemented

#

ah right

hollow arch
#

I don't believe there are any other easy ways

drowsy helm
#

yeah not that i can think of

#

I'd try set actual perms instead of op

#

because im not sure if it would be handled as a player or not

hollow arch
#

I don't think it can have perms by default, it's not a player

#

oh hm and cmdResult.isOp() return false even after setting it to true o.o

drowsy helm
#

i believe since it's not an instance of a player it can't be opped

#

I would say go as far as maybe extending Player?

#

since you're technically just making a spoof player

graceful turret
#

there are only 2 methods xD

#

getPlayer and getFrom

#

there's no 'getTo'

hollow arch
drowsy helm
hollow arch
#

oh

#

Yeah, I'm not sure

sullen marlin
#

well its gonna totally depend on your implementation of CommandResult

#

like did you actually make setOp store the boolean

unreal kayak
hollow arch
#

Oh.

fringe folio
#

is there any sort of generator or like a faster way for map canvases

#

?

drowsy helm
summer scroll
fringe folio
#

no I mean a way where I don't have to set every pixel my self

drowsy helm
#

yes\

#

MapRenderer

summer scroll
#

getPlayer().getLocation() will return player's location after they changed world.

fringe folio
# drowsy helm MapRenderer

yeah I know but inside the renderer you need to do

canvas.setPixel(1, 1, MapPalette.BLUE);
``` for every pixel
drowsy helm
#

use a for loop...?

fringe folio
#

nvm

graceful turret
#

i need it

summer scroll
#

getFrom

hollow arch
graceful turret
summer scroll
#

i thought all you need is the world.

graceful turret
#

l o c a t i o n

drowsy helm
#

if you're doing it in the nether you can calculate it to a degree

graceful turret
#

location != world xD

drowsy helm
#

or check if PlayerTeleportEvent gets called

#

when they go through a portal

opal juniper
#

?jd

drowsy helm
graceful turret
#

i've already done checking

#

now i want to teleport player

#

on a place where he stood on before teleportation

abstract relic
#

anyone got a clue how I'd be able to get a generic instance of Class<? extends Enum<?>>
like I need a new Class<? extends Enum<?>() basically

graceful turret
#

what's default player portal cooldown?

opal juniper
#

How can i get the block a player is looking at?

#

Ideally an event, like OnBlockTarget...

drowsy helm
#

Just use a BlockIterator

opal juniper
#

thanks

fringe folio
#

what does this error mean?

#

message could not be delivered

#

what?

opal juniper
fringe folio
#

discord

cosmic sleet
#

Hello I got a problem

fringe folio
#

I tried to send an error message

#

but nvm I solved it

cosmic sleet
#

I try to host a server on my machine

#

And I did a very basic plugin with spigot in eclipse

#

But it says something weird in my server

opal juniper
#

Ok

cosmic sleet
#

i can give you the error code

opal juniper
#

Send the stacktrace

cosmic sleet
#

the what

opal juniper
#

The whole error

cosmic sleet
#
[11:50:33] [Server thread/ERROR]: Could not load 'plugins\Tutorial.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/geoffrey/Tutorial/Tutorial has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
#

I guess it is because i compiled the wrong version

#

I used java 13

opal juniper
#

What Jdk are you using?

cosmic sleet
#

and i should have used 8?

cosmic sleet
opal juniper
#

Hmmm

crude charm
#

can someone plz help me

opal juniper
queen dragonBOT
#

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.

cosmic sleet
#

ok i found it

#

I need java SDK 8

crude charm
#

    public void onlinePlayersGUI(Player player) {
        int slot = 1;

        InventoryBuilder builder = Inventories.create();

        builder.title(CC.GREEN + "Online Players");
        builder.rows((int) Math.min(Math.ceil(Bukkit.getOnlinePlayers().size()/9) + 1,6));
        for (Player p : Bukkit.getOnlinePlayers()) {
            builder.setItem(getSkull(p), slot++);
            System.out.println(getSkull(p).getType());
            printConsole(CC.RED + p.getName() + slot);
        }

cosmic sleet
#

Anyone has a link where to download it?

opal juniper
#

just google it

crude charm
#

it opens the inv but no items are in it

cosmic sleet
opal juniper
#

ye

cosmic sleet
#

is it free?

opal juniper
#

Yes

cosmic sleet
#

but i need to give so many informations

#

like phone

opal juniper
#

You just gotta sign up

cosmic sleet
#

and address

opal juniper
#

Its a one time thing

crude charm
#

just give it

#

otherwise ur fucked

opal juniper
#

they aren't gonna identity fraud yo ass

crude charm
#

ikr\

outer crane
#

dont use oracle

crude charm
#

    public void onlinePlayersGUI(Player player) {
        int slot = 1;

        InventoryBuilder builder = Inventories.create();

        builder.title(CC.GREEN + "Online Players");
        builder.rows((int) Math.min(Math.ceil(Bukkit.getOnlinePlayers().size()/9) + 1,6));
        for (Player p : Bukkit.getOnlinePlayers()) {
            builder.setItem(getSkull(p), slot++);
            System.out.println(getSkull(p).getType());
            printConsole(CC.RED + p.getName() + slot);
        }

it opens the inv but no items are in it

cosmic sleet
#

and it asks a company name

outer crane
#

use AdoptOpenJDK

#

its easier

crude charm
#

with java?

opal juniper
#

With Inventories

crude charm
#

...?

opal juniper
#

what

cosmic sleet
crude charm
#

how do u not know how to use inventories

opal juniper
#

im having a look but i am just saying that i have never had to use them, especially not InventoryBuilder

quiet ice
crude charm
#

Inventory builder is custom coded

opal juniper
#

Yes

cosmic sleet
#

i found a free website to download jdk 8

opal juniper
#

hence i don't know it

cosmic sleet
#

without account

opal juniper
crude charm
#

its very self explanatory

opal juniper
#

😄

cosmic sleet
#

it isn t

quiet ice
#

Did you download the vanilla OpenJDK by chance?

cosmic sleet
#

do i have to install the jdk 8 or do i only need to add it in eclipse?

opal juniper
outer crane
#

geo is the adoptopenjdk site down for you

outer crane
#

half the websites im trying to use wont work

quiet ice
#

No, adoptopenjdk will be phased out by adoptium in the near future

outer crane
cosmic sleet
outer crane
#

bing is down too

outer crane
#

its azure

opal juniper
cosmic sleet
#

ok thx 🙂

opal juniper
#

then you change it in eclipse

outer crane
#

wtf

opal juniper
#

thought im more of an intellij guy myself

outer crane
#

how does discord still work

opal juniper
#

it may be the DNS resolver?

outer crane
#

change dns ip to 1.1.1.1?

opal juniper
#

sure

crude charm
opal juniper
crude charm
#

it is

opal juniper
#

one mo

crude charm
#

but it shouldn't b e

opal juniper
#

what is the getSkull() Method

crude charm
#
    private ItemStack getSkull(Player player){

        return new ItemBuilder(Material.SKULL_ITEM)
                .skull(player.getName())
                .amount(2)
                .name(CC.GREEN + player.getName())
                .lore(CC.GRAY + "Click to teleport to " + player.getName())
                .build();
    }
opal juniper
#

hmmm, im not sure

#

some1 else probs knows

outer crane
#

ok dns servers are back up

#

nice

graceful turret
#
                            for (Player online : Bukkit.getOnlinePlayers()) {
                                Bukkit.getScheduler().cancelTask(taskID);
                                online.setPortalCooldown(1);
                            }
                            return true;
                        }

                        if (args[1].equalsIgnoreCase("off")) {
                            taskID = Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
                                @Override
                                public void run() {
                                    for (Player online : Bukkit.getOnlinePlayers()) {
                                        online.setPortalCooldown(999999);
                                    }
                                }
                            }, 1, 20).getTaskId();

                            Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
                                @Override
                                public void run() {
                                    for (Player online : Bukkit.getOnlinePlayers()) {
                                        online.setPortalCooldown(999999);
                                    }
                                }
                            }, 1, 20);
                            return true;
                        }

                        break;``` any ideas?
cosmic sleet
#

i got it done to select java 8

#

but now i got an error

#

Syntax error on token "module", interface expected

quaint mantle
#

Does that work?

#
    public void onInvOpen(InventoryOpenEvent event) {
        if (event.getInventory() instanceof Container) {
            Container container = (Container) event.getInventory();
            StringBuilder inventoryString = new StringBuilder();
            for (ItemStack item : container.getInventory().getContents()) {
                if (isLargeItem(item) || isCrashItem(item)) {
                    item.setItemMeta(null);
                }
                inventoryString.append(itemToString(item));
            }

            if (inventoryString.length() >= 150000) {
                event.setCancelled(true);
                container.getInventory().clear();
            }
        }
    }```
vital swift
#

How do i send message to all bungee players? [By a Spigot Plugin not Bungee]

chrome beacon
#

You need a bungee plugin

#

We'll not really but please just use a bungee plugin for that

quaint mantle
#

nvm my container thing won't work, does anyone have an idea?

#

how can I set an armorstand to be vulnerable? I mean, that the armorstand CAN be destroyed? I tried armorstand.setInvulnerable(false); but I get an error in console so idk 🤷‍♂️

summer scroll
quiet ice
sullen marlin
#

Pretty sure they’re vulnerable by default, what’s the error?

crude charm
#

its a custom util

crude charm
opal juniper
#

Soooo, im trying to get the block that a player is looking at, and at the moment i am doing this:

@EventHandler
    public void onMove(PlayerMoveEvent event){
        Player player = event.getPlayer();

        Block target = null;
        
        Location location = player.getEyeLocation();
        BlockIterator blocksToAdd = new BlockIterator(location,0.0,20);

        while(blocksToAdd.hasNext()){
            Block block = blocksToAdd.next();
            if(block.getType() != Material.AIR){
                target = block;
                break;
            }
        }}

However there is a bit of a difference between where my crosshair is and where the block will be placed, as well as some lag. Is there a better way to do this?

sullen marlin
#

Player.getTargetBlockExact or something

#

Just use that

#

It’ll probably be closer, but yes it may never be 100% accurate

opal juniper
#

Ok, thanks

cinder thistle
quaint mantle
#

How can i get the item name with nms?

opal juniper
#

Is there an event listener for just the camera move, i realise now that this code
#help-development message
was largely impacted by how much the event was called

#

and at larger ranges it was due to the event listener not being called enough

cinder thistle
#

PlayerMoveEvent

#

iirc it's called for yaw and pitch changes

gritty mist
#

hello

cinder thistle
#

hello

gritty mist
#

I am looking for a tutorial on the spigotAPI

cinder thistle
#

google

gritty mist
#

I know java

cinder thistle
#

watch it

opal juniper
cinder thistle
#

y

#

that's 12.5 chunks away

opal juniper
#

yeah, but as an example

cinder thistle
#

quite a few players don't even have it up that high

opal juniper
#

an extreme example

cinder thistle
#

but uh, decimals

opal juniper
#

wdym?

cinder thistle
#

pretty sure yaw and pitch are floating point?

#

so you can get real accurate

opal juniper
#

Yes, however the event listener is not called every time it changes by 0.1 if yk what i mean, lemme show you

cinder thistle
#

as for making the player look at something, I don't think there's a method for that

#

then set a timer

cinder thistle
#

your FOV is ass

opal juniper
#

at long distances the error interval is several blocks compared to close the player

cinder thistle
#

set a timer

opal juniper
#

quake pro gang 😎

cinder thistle
#

normal gang 😎

opal juniper
#

wdym by set a timer tho

cinder thistle
#

bukkitrunnable

sullen marlin
#

You won’t get accurate over distance

cinder thistle
#

md pog

opal juniper
#

The event listener isn't called enough to get accurate i think

sullen marlin
#

Floating point isn’t that precise and not everything gets sent to the server

cinder thistle
#

how make WORK?!

#

tel or else

sullen marlin
#

Possibly even the client rounds things to 1/255 of a block or so, I forget

opal juniper
#

hmm, this is kinda a pain

cinder thistle
#

alternatively

#

if you really wanna be accurate ig you could try to predict where they're gonna look?

opal juniper
#

uhhhhh

opal juniper
cinder thistle
#

there's a reason it's not called that much

opal juniper
#

Yes, and i understand why, its just a pain that it is not now 🤣

cinder thistle
#

it's already calling hundreds of events a second (I think?) per player (if they're moving ig)

opal juniper
#

yeah, its a shame you can't change how much it gets triggered

cinder thistle
#

yep

#

although I mean

opal juniper
#

Do you know of any other event listener that could be used

cinder thistle
#
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
  Bukkit.getScheduler().blablabla(() -> {
    Bukkit.getPluginManager().callEvent(new PlayerMoveEvent(player));
  }, 1); // I think? one tick later
}
#

@sullen marlin are you happy dad

opal juniper
#

that is gonna turn bad fast 🤣

lost matrix
dusty herald
#

shit go boom

cinder thistle
lost matrix
cinder thistle
#

^ it looks cool

opal juniper
#

I am trying to make a gun for blocks, but atm just working on getting the aiming

cinder thistle
#

o.o

opal juniper
#

the player move event doesn't get called enough over large distances to be effective

#

as the rotation delta isn't great enough

opal juniper
#

cause it calls the event more

burnt totem
#

Does anyone know a good clean tag api that does not mess with the scoreboard? Spigot version: 1.8.8

lost matrix
#

Looks expensive... schedule it ^^

lost matrix
lost matrix
burnt totem
unreal kayak
#

Hi

#

Came to help people ;)

tulip cove
#

Anyone know how to make a Solid Line with MessageAnnouncer in JSON?

lost matrix
opal juniper
opal juniper
#

a bit

dusty herald
#

don't be so rude </3

opal juniper
#

but i try to hide it

burnt totem
opal juniper
#

m8, please don't come in here asking for help on a 1.8 plugin and then call me stupid

lost matrix
#

lul ^^

lost matrix
young knoll
#

You can have 1.8 clients on 1.16

opal juniper
#

Yeah, there is Viabackwards and ViaRewind for even older clients iirc

dusty herald
#

1.16 support for 1.8 is ass ngl

opal juniper
opal juniper
burnt totem
#

thats why i use 1.8.8 server version

dusty herald
#

who uses 1.8?

#

when someone says 1.8 assume 1.8.8 lmao

alpine urchin
#

spigot does not give support for legacy versions

lost matrix
alpine urchin
#

5-6 years

#

ago

#

1.8 was released

dusty herald
#

I think 7+ now

#

not sure

#

it's been so long

opal juniper
burnt totem
#

i would have used 1.16 if it had 1.7 pvp

alpine urchin
#

5-6

lost matrix
#

Most people who play 1.8 werent even allowed to play minecraft when it came out...

alpine urchin
#

@burnt totem its possible to make a 1.16 server and use viarewind to support 1* clients

young knoll
#

1.8.8 was July 2015

alpine urchin
#

what do you mean no

burnt totem
#

pvp will be fucked up

alpine urchin
#

you said the only reason was cause you wanted 1.7 pvp

#

no it wont

burnt totem
#

??????????????

lost matrix
alpine urchin
#

haha

dusty herald
alpine urchin
#

@burnt totem you use a 1.8 client, server is 1.16, pvp wont be fucked up

burnt totem
dusty herald
#

pretty damn close

alpine urchin
#

with the help of a plugin called viaversion and

#

viabackwards

opal juniper
#

@lost matrix, so if i make a run task timer every, lets say tick, and it will run whilst they have a stick in their hand that should work then?

burnt totem
alpine urchin
#

what about it doesn’t work

burnt totem
opal juniper
#

it does

#

i have done it

alpine urchin
#

what about the pvp isnt working

cinder thistle
#

if it doesn't work then you haven't set it up right

opal juniper
#

its the cooldown

#

but it does work

opal juniper
burnt totem
#

it works if i make a custom jar

alpine urchin
#

what?

burnt totem
#

but that's just dumb

opal juniper
#

why do you think that people use 1.8 on hypixel, they use that same type of pugin @burnt totem

alpine urchin
#

sticking on 5-6 year old software with no support is smart

#

🙉

young knoll
#

Hypixel runs on 1.8

burnt totem
alpine urchin
#

1.7.10

dusty herald
#

I thought they ran 1.7 or some shit

opal juniper
#

i take that back

alpine urchin
#

@young knoll hypixel maintains the server themselves

burnt totem
alpine urchin
#

there is no reason

#

to upsate

cinder thistle
#

never compare your server

#

to hypixel

alpine urchin
#

theyd have to rewrite a ton of their core

#

if they updated spigot

cinder thistle
#

your server is not hypixel. your server will never BE hypixel.

dusty herald
cinder thistle
#

hypixel is an extreme exception to most statements.

opal juniper
# burnt totem excactly

The difference is that they have engineers that are completely fluent with 1.8. you are not

dusty herald
#

then don't compare to hypixel lol

alpine urchin
#

my minecwaft server wont be as big as hypixel? :c

cinder thistle
#

yes

burnt totem
#

i forgot why we even are arguing

dusty herald
#

1.8 bad

opal juniper
#

u an idiot

lost matrix
alpine urchin
#

their server version is technically 1.7.10

#

and havent updatrd spigot since

burnt totem
dusty herald
#

1.7 pvp?

alpine urchin
#

they dont support the 1.7 profocol anymoe

dusty herald
#

1.7 pvp is 1.8 pvp

crude charm
#

no its not

alpine urchin
#

it lacks too too many features

#

the 1.7.10 protocol

burnt totem
alpine urchin
#

its a pain maintaining support for it

#

that is why

crude charm
#

use 1.8 spigot and allow 1.7 clients

dusty herald
#

who plays on 1.7 lmao wtf

alpine urchin
#

or use 1.16 spigot and add viaversion, viarewind and viabackwards

crude charm
#

everyone in the pvp com

burnt totem
alpine urchin
#

then

alpine urchin
#

spigotmc just doesn’t give support for 1.8 users, on your own sirson

cinder thistle
#

there is a reason that the 7 and 8 year old versions aren't supported here

crude charm
#

doesent mean people still dont use them

cinder thistle
#

sadly

alpine urchin
#

we didn’t say

#

that you can’t

#

but he is asking for support

dusty herald
#

you can't even get a spigot version lower than 1.8.8 legally

alpine urchin
#

with a 5-6 year old spigot build

alpine urchin
#

@dusty herald 1.8* i believe

#

no you can

cinder thistle
#

dmca

crude charm
#

yea

opal juniper
#

how do you cancel a bukkit runnable? is it cancel()

cinder thistle
#

yes

alpine urchin
#

pretty sure you can tho, md5 hosts builds on his

#

thing

cinder thistle
#

whut

alpine urchin
#

i forgot its name

#

fuck

#

jenkins

cinder thistle
#

there's a reason we have buildtools

alpine urchin
#

distributing mojangs code isnt allowed

cinder thistle
#

^

alpine urchin
#

do buildtools dowbloads mojangs jar, and applies patches(modifies it)

#

and tada, spigot

#

its all done on your machine

#

no mojang code was distributed

dusty herald
#

every1 happy

alpine urchin
#

the illegal site you provided distributes mojangs code and allegedly includes rats

cinder thistle
#

except the lazy asses who don't want to run an entire command

dusty herald
#

yes.

cinder thistle
#

and wait a few minutes

dusty herald
#

yes it is.

cinder thistle
#

yeah that's illegal

#

same with serverj*rs

alpine urchin
#

rs,

#

?

cinder thistle
#

I have to censor it so I don't get automodded

alpine urchin
#

ok

#

ic

dusty herald
#

I'm hungry

alpine urchin
#

im eating

dusty herald
#

how dare u

crude charm
#

does java 11 work for 1.8 spigot?

burnt totem
alpine urchin
#

nothing

dusty herald
#

yes

sturdy patrol
#

tons of chocolate next to my pc 😍

alpine urchin
#

@crude charm no support for spigot 1.8

crude charm
#

OMG IM NOT ASKING THAT

#

WHAT?!

alpine urchin
#

haha

dusty herald
#

sorry we can't tell u 😔

crude charm
#

lmfao

#

what

alpine urchin
#

LOLi

#

no support

#

subbort

dusty herald
#

subborb

paper viper
#

suburb

alpine urchin
#

subscribe

#

to my yt

crude charm
#

:((((((((((((((((((((((((((((((

paper viper
#

no

burnt totem
#

i have always gotten my spigot from an illegal website.... i didn't know before

alpine urchin
#

ok

crude charm
#

😿

alpine urchin
#

they allegedly include rats

dusty herald
#

FBI OPEN UP

paper viper
#

you shame

dusty herald
alpine urchin
#

i think i know them 🙉

burnt totem
#

a ytber had the link in his description

alpine urchin
#

you think?

cinder thistle
#

lol

dusty herald
#

yes

burnt totem
#

so i downloaded from there

dusty herald
#

I think I know them

alpine urchin
#

he probably didnt know

#

or didnt care

dusty herald
burnt totem
#

anyone know a good packet nametag api?

crude charm
#

yes

#

nametagapi

sturdy patrol
#

🤭

burnt totem
#

it's not packet

crude charm
#

no

#

wtf

#

lmfao

#

never heard of that

#

what do you even mean by name tag

#

nbt?

alpine urchin
#

whats a packetnnametag api

burnt totem
#

and using packets instead

crude charm
#

?

paper viper
#

its literally 2 kilobytes

#

lol

alpine urchin
#

I do not know of any api doing that, and I wonder why you would want that.

crude charm
#

ikr

alpine urchin
#

technically bukkit

#

scoreboards

burnt totem
# paper viper its literally 2 kilobytes

this is the code `package de.nametagapi;

import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;

public class NameTagAPI {
public static void setTag(Player player, String tag, Player toSetFor) {
Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
Team team = board.getTeam(player.getName());
if (team == null)
team = board.registerNewTeam(player.getName());
team.setPrefix(tag);
team.addPlayer((OfflinePlayer)player);
for (Player players : Bukkit.getOnlinePlayers())
players.setScoreboard(board);
}
}
`

alpine urchin
#

uses packets behind the scenes

#

duh?

#

so bukkit!

crude charm
#

ew

#

use a scoreboard api

#

or a util

alpine urchin
#

which uses bukkit behind the scenes

burnt totem
alpine urchin
#

what?

paper viper
#

he doesnt hate it

#

lmao

crude charm
#

huh

alpine urchin
#

LOL

paper viper
#

in fact, bukkit is severely outdated

crude charm
#

^

burnt totem
alpine urchin
#

what do you mean it is serverly outdated

#

Usually when people say Bukkit, they mean the Bukkit API and not CraftBukkit.

#

how are any of them outdated

crude charm
#

bukkit.jar

alpine urchin
#

what

quaint mantle
#

Why does this still block //pos

burnt totem
alpine urchin
#

and updated

quaint mantle
#
            if (!event.getMessage().toLowerCase().contains("//pos") || !event.getMessage().toLowerCase().contains("/worldedit:/pos")) { ```
crude charm
#

using bukkit as a jar

#

for the server

paper viper
#

well actually it isn't outdated, but it's more of a like "don't use it lol"

#

like spigot exists for a reason

crude charm
#

^

burnt totem
paper viper
#

i wouldn't say it is outdated -- you still get a jar

#

for the updated version

#

but you should still use the spigot jar

burnt totem
crude charm
#

what about paper spigot

#

I have a custom spigot fork

paper viper
#

that's a different story

crude charm
#

*taco fork

alpine urchin
#

Bukkit is included in Spigot.

burnt totem
paper viper
#

yeah

#

Obviously, Bukkit API isn't at all outdated

#

spigot uses it kek

burnt totem
opal juniper
#
@EventHandler
    public void onItemHeld(PlayerItemHeldEvent event){
        Player player = event.getPlayer();
        int slot = event.getNewSlot();

        if(player.getInventory().getItem(slot).getType() == Material.STICK){
            this.holdingGun.put(player,true);
            new BukkitRunnable() {
                @Override
                public void run() {
                    if (holdingGun.get(player) == false) {
                        cancel();
                    }else {
                        Block target = null;

                        target = player.getTargetBlockExact(200);

                        if(target == null){return;}

                        target.setType(Material.GLASS);
                        
                    }
                }

                }.runTaskTimer(plugin, 0,1);

        }else{
            this.holdingGun.put(player,false);
        }
    }

This is producing a null pointer exception, i am being dumb and cant work out why. it is due to the runnable i reckon

lost matrix
opal juniper
#

oh yeah, true

lost matrix
opal juniper
#

line 42 is if(player.getInventory().getItem(slot).getType() == Material.STICK){

chrome beacon
#

Does that slot contain an item

lost matrix
#

This may return null player.getInventory().getItem(slot) if no ItemStack is in there

opal juniper
#

ahhhh, makes sense. thanks

#

i added this:

if(player.getInventory().getItem(slot).getType() == null){return;}

but i still get the same error?

lost matrix
# opal juniper ```java @EventHandler public void onItemHeld(PlayerItemHeldEvent event){ ...

This would be my take in it:

public class PlayerTask implements Runnable {

  private final Consumer<Player> playerConsumer;
  private final Set<UUID> targetPlayers;

  public PlayerTask(final Consumer<Player> playerConsumer) {
    this.playerConsumer = playerConsumer;
    this.targetPlayers = new HashSet<>();
  }

  public void add(final UUID playerID) {
    this.targetPlayers.add(playerID);
  }

  public void remove(final UUID playerID) {
    this.targetPlayers.remove(playerID);
  }

  @Override
  public void run() {
    final Set<UUID> removalCandidates = new HashSet<>();
    for (final UUID playerID : this.targetPlayers) {
      final Player player = Bukkit.getPlayer(playerID);
      if (player == null) {
        removalCandidates.add(playerID);
      } else {
        this.playerConsumer.accept(player);
      }
    }
    this.targetPlayers.removeAll(removalCandidates);
  }

}

With a usage like this:

    Bukkit.getScheduler().runTaskTimer(this, new PlayerTask(player -> {
      player.sendMessage("Hi");
    }), 0L, 20L);

Which sends "Hi" once a second to each user in the runnable.

lost matrix
opal juniper
#

ohhhhh, im stupid....

burnt totem
#

what is the most useful feature in essentialsX?

daring sierra
burnt totem
daring sierra
#

but fr

#

/pt kittycannon

#

Assign to stick

burnt totem
#

my staff is griefing my server with /kittycannon

daring sierra
#

Jitterclick

burnt totem
daring sierra
burnt totem
daring sierra
#

I think your staff is just griefing your server normally

burnt totem
#

i mean yes

daring sierra
#

Only sound and particle

#

Atleast dats what it do for me

burnt totem
#

for me it griefs

daring sierra
#

maybe its in the config

burnt totem
#

or maybe i was thinking about /antioch

quaint mantle
#

I have an issue, i'm trying to block all worldedit commands but not //pos with this:
if(event.getMessage().toLowerCase().startsWith("//") || event.getMessage().toLowerCase().startsWith("/worldedit:/") && !event.getMessage().toLowerCase().startsWith("//pos") && !event.getMessage().toLowerCase().startsWith("/worldedit:/pos")) {
But //pos still doesn't work

quaint mantle
#

What can i do?

latent vale
#

[ERROR]: Could not load 'plugins\BasicCMDs.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.zeprix.BasicCMDs.Main'

I don't get what's wrong..

peak depot
#

@quaint mantle could you paste the complete class so we can see the rest

quiet ice
#

Also, you should follow basic package naming conventions

peak depot
#

it would be better if you just paste it on m5d paste thing with the event and everything

quaint mantle
#
    public void onCommand(PlayerCommandPreprocessEvent event) {```
peak depot
# latent vale ...

sometimes it doesnt export right try decompile it if is the right plugin .yml

#

im not 100% sure but i think you dont need the 1. slash at the beginning

quaint mantle
#

it's worldedit

#

it has //

peak depot
#

so like else if (event.getMessage().toLowerCase().startsWith("//") to else if (event.getMessage().toLowerCase().startsWith("/")

latent vale
#

decompiled plugin.yml is good

peak depot
#

try with PlayerPickupItemEvent to cancel it

hybrid spoke
burnt totem
#

excactly

#

so cancel the event?

lost matrix
#

If you cancel the click event then the block should not appear in your Inventory. What version are you on.
(And the PlayerPickupItemEvent makes zero sense here)

peak depot
#

lies

eternal oxide
opal juniper
#

This code gets the first non-air block in a ray:

Location eyeLocation = player.getEyeLocation();
                    BlockIterator blocks = new BlockIterator(eyeLocation,0,200);

                    Block CurrentBlock;

                    while(blocks.hasNext()){
                        CurrentBlock = blocks.next();
                        if(CurrentBlock.getType() != Material.AIR){
                            target = CurrentBlock;
                            break;
                        }
                    }

I want to get the block b4 it in the BlockIterator, is this possible?

eternal oxide
#

getBlockAt... target.getLocation.clone().add(eyeLocation.getDirection().multiply(-1))

#

That would get the block from the world

lost matrix
eternal oxide
#

Called when some entity or block (e.g. hopper)

lost matrix
#

Did it change?

eternal oxide
#

No clue, I've never used it

lost matrix
#

I was almost certain that only hoppers and hopper minecards fired this ;D

eternal oxide
#

I would assume it would fire for the shift click

lost matrix
eternal oxide
#

it looks like he wants upto a range of 200

#

not sure target would go that far (5 I think)

opal juniper
#

it would

lost matrix
eternal oxide
#

ah ok

#

in that case, use target block and then step back one with my math

opal juniper
#

however i decided to use a ray cause then i could get the block b4 it in the ray without having to deal with the block sides

opal juniper
#

one sec then

minor fox
#
        Bukkit.getOnlinePlayers().forEach(p -> p.hidePlayer(player));
        Bukkit.getOnlinePlayers().forEach(p -> p.showPlayer(player));``` what else is required to change their skin? this doesn't seem to update it
#

getSkin returns a property with value and signature

eternal oxide
#

hide/show will not cause the skin packet to be resent

alpine urchin
#

she was gonna break my heart regardless

minor fox
#

which packet is it?

alpine urchin
#

so i too kher out and dumped her in the garbage

eternal oxide
#

teh player has to move away (out of range) then back to trigger its sending

#

and I believe you have to use packets to have the player themselves see their new skin

minor fox
#

it's kind of weird that it doesn't show when reentering the render distance though

#

there's something else going wrong

eternal oxide
#

I've not done it but it does come up in here from time to time. Most google results are out of date for it.

opal juniper
eternal oxide
#

whats the random return?

#

and no that won't work

opal juniper
#

huh

#

could you explain?

lost matrix
opal juniper
#

so one block b4 the targeted block

#

in a ray

lost matrix
eternal oxide
#
Block block = player.getTargetBlockExact(200);
location loc = block.getLocation().clone().subtract(player.getEyeLocation().getDirection())
return loc.getWorld().getBlockAt(loc);```
minor fox
#

i genuinely don't understand this

opal juniper
#

Also, it doesn't matter if the block is air

lost matrix
# minor fox i genuinely don't understand this
  public void applySkinTo(final Player player) {
    final PlayerProfile profile = player.getPlayerProfile();
    profile.removeProperty("textures");
    profile.setProperty(new ProfileProperty("textures", this.skin.data.texture.value, this.skin.data.texture.signature));
    player.setPlayerProfile(profile);
    player.spigot().respawn();
  }

You need the base64 value and the signature for that skin.

eternal oxide
opal juniper
#

one sec

#

lemme print out the coords

eternal oxide
#

there, modified it to always return one block back.

#

The AIR test would just mean if no block was found in the 200 range

opal juniper
#

ok

eternal oxide
#

Note that you will need some error checking. The return from getTargetBlockExact is nullable

opal juniper
#

Yep, i have a null check

quaint mantle
#

Hey how do i stop server by code? Spigot

eternal oxide
#

shutdown()

#

?jd

minor fox
#

@lost matrix which library to handle base64?

quaint mantle
#

Oh thank you

opal juniper
#

ok, so i am looking at:
x:-242,y:71,z:811
i am at
x:-245,y:74,z:811
and it returns
x:-243,y:71,z:810

eternal oxide
#

looks one block back to me

minor fox
#

I have used the raw strings from mojang in the property and had it work before

opal juniper
#

the x & y seems fine just idk what happened to the z

eternal oxide
#

place a block at teh returned location

eternal oxide
#

ok, and thats wrong somehow?

lost matrix
opal juniper
#

Well, it is possible that it is right.... just not really what i wanted. Let me show you

#

If i am the glass and i am looking at the green wool i would like it to return the red concrete

#

the only thing im thinking now is that it will then target the red concrete and get closer and closer

eternal oxide
#

it will if it constantly runs

opal juniper
#

yes

#

hmmm

eternal oxide
#

it will always use teh targeted block

#

not the returned block. so its alwasy dependant upon where teh player is lookiung

opal juniper
#

yeah..... ugh this is harder than i thought it would be

minor fox
#

turns out I forgot to remove the textures property before setting the new one, all is good now

eternal oxide
#

oh you can also simplify this to java location loc = block.getLocation().clone().subtract(player.getEyeLocation().getDirection())

opal juniper
#

i rlly don't think this is working

eternal oxide
#

I've no idea what I'm looking at

opal juniper
#

so, i am looking at the leaves

eternal oxide
#

do you mean the glass thats on the tree?

opal juniper
#

yes

#

to the left

eternal oxide
#

if you look at that glass block and do it again what happens?

eternal oxide
#

looks shifted to teh left

opal juniper
#

ye, not towards me

#

which is -x if that helps

sturdy patrol
#

difference between 'discrete' blockpos and 'continuous' location?

opal juniper
eternal oxide
#

You could. Thsi code is my math is wrong subtracting the vector

unreal quartz
#

e.g, you can't have a block at Y=0.5 for example, it's Y=0 or Y=1

sturdy patrol
#

I mean, his weird shift to the left could be because of it

unreal quartz
#

ah

sturdy patrol
#

because the coordinate of a block are at the bottom left corner, while an entity is at the bottom center

#

things like that

#

I would try adding / substracting a 0.5 offset to x & z, and see if it does the trick

eternal oxide
#

sec I think I have it

opal juniper
opal juniper
eternal oxide
#
location loc = block.getLocation().clone().subtract(block.getLocation().toVector().subtract(player.getEyeLocation().toVector()))```Try that. You may have to change the first subtract to an add if it goes forwards instead of backwards.
chrome field
#

Hey guys, can someone help me to get that item in hand and circled around the player?

opal juniper
eternal oxide
#

in that case, switch the vector methods

#

updated code above

opal juniper
#

ok

#

have i missed something?

eternal oxide
#

check teh code again. I had a mistake

quaint mantle
#

Maybe
Location loc = block.getLocation().clone().subtract(block.getLocation().toVector().subtract(player.getEyeLocation().toVector()))

eternal oxide
#

^ is correct

quaint mantle
eternal oxide
#

then try with the first as add if subtract is wrong

quaint mantle
#

The getLocation was missing

eternal oxide
#

Yep, I updated it after

quaint mantle
#

I'm not speak english lol

chrome field
#

Hey guys, can someone help me to get that item in hand and circled around the player?

eternal oxide
#

That should calculate the vector between the player and the target.

opal juniper
#
    public Block getBlock(Player player) {
        Block block = player.getTargetBlockExact(200);
        if (block == null){return block;}
        Location loc = block.getLocation().clone().add(block.getLocation().toVector().subtract(player.getEyeLocation().toVector()));
        return loc.getWorld().getBlockAt(loc);
    }

so i have this

#

this good?

eternal oxide
#

looks good

#

the first will either be add or subtract to move forwards or backwards

#

Note sure if you need to normalize the vector is all

opal juniper
#

ok, let me compile

quaint mantle
#

@eternal oxide What does @opal juniper need?

opal juniper
eternal oxide
#

he's trying to get a target block and then return the block in front of it, 1 block towards the player

opal juniper
#

with that code

#

ill try subtract

eternal oxide
#

it also looks like you will have to normalize

opal juniper
eternal oxide
#

Location loc = block.getLocation().clone().add(block.getLocation().toVector().subtract(player.getEyeLocation().toVector()).normalize());

quaint mantle
#

so do you needs get a block in front of you?

#

i cant understand sorry

#

i'm not speak english

#

i want to help

eternal oxide
#

The block between him and the block he's looking at

quaint mantle
#

Ohh

opal juniper
#

kinda works

quaint mantle
#

And then?

eternal oxide
#

only kinda?

arctic summit
#

how would i go abt making the window on the right of the dudes screen here that says "BED WARS"?

eternal oxide
#

much closer

opal juniper
#

yeah

eternal oxide
#

ok, instead of add or subtract use multiply (now that its normalized)

opal juniper
#

im assuming im boutta get sent more code?

quaint mantle
#

wait i think i'm understanding

eternal oxide
#

nope

opal juniper
eternal oxide
#

try **removed due to embarrassment**

#

oh that will nto work.

opal juniper
#

Provided : Vector
Expected : Double

eternal oxide
#

ignore that terrible code

opal juniper
#

good cause im not

quaint mantle
#

haha

opal juniper
quaint mantle
opal juniper
#

because it is not actually there, the glass i send is using packets, more specifically the sendBlockChange

eternal oxide
#

odd. Normalizing the vector should have worked

#

its close but not quite right

quaint mantle
marble hare
#

Anyone here ever made a plugin that can change your skin?

[15:47:40 INFO]: Swift3 issued server command: /skin skeppy
[15:47:40 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'skin' in plugin SkinChanger v1.0-SNAPSHOT
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1189) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1001) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [patched.jar:git-PaperSpigot-"4c7641d"]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_281]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_281]```
opal juniper
#

It doesn't work facing north or west

#

or looking down

eternal oxide
opal juniper
#

its just the title

marble hare
#

I kinda did make it and it works just the command is returning null for some odd reason

arctic summit
opal juniper
#

spigot

#

just google it

arctic summit
#

ok

eternal oxide
#

spigot scoreboard api

arctic summit
#

yeah thanks

#

found it

opal juniper
#

ok

#

that would be very nice

#

What do you think it is

eternal oxide
#

can you show me your fake block code and I'll fire up my IDE to test here

opal juniper
#

one sec

#

ill get the rest

lost matrix
opal juniper
#

damm

lost matrix
# opal juniper ill get the rest
  @Override
  public void onEnable() {
    Bukkit.getPluginManager().registerEvents(this, this);
    final Consumer<Player> playerConsumer = pl -> {
      final Block block = this.getFirstHitBlock(pl);
      if (this.lastHit != block && this.lastHit != null) {
        this.sendChange(pl, this.lastHit, Blocks.AIR.getBlockData());
      }
      if (block != null) {
        this.sendChange(pl, block, Blocks.GLASS.getBlockData());
        this.lastHit = block;
      }
    };
    this.playerTask = new PlayerTask(playerConsumer);
    Bukkit.getScheduler().runTaskTimer(this, () -> Bukkit.getOnlinePlayers().forEach(playerConsumer), 0L, 1L);
  }

  private void sendChange(final Player player, final Block block, final IBlockData data) {
    final BlockPosition position = new BlockPosition(block.getX(), block.getY(), block.getZ());
    final PacketPlayOutBlockChange change = new PacketPlayOutBlockChange(position, data);
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(change);
  }

  public Block getFirstHitBlock(final Player player) {
    final World world = player.getWorld();
    final Location start = player.getEyeLocation();
    final Vector direction = start.getDirection();
    final RayTraceResult result = world.rayTraceBlocks(start, direction, 200);
    if (result == null) {
      return null;
    }
    final Block hitBlock = result.getHitBlock();
    if (hitBlock == null) {
      return null;
    }
    final BlockFace hitFace = result.getHitBlockFace();
    return hitBlock.getRelative(hitFace);
  }
sturdy patrol
#

@opal juniper I did something similar a few weeks ago:

Player p = event.getPlayer();

// We start by doing a raytrace to find the block the player is looking at
RayTraceResult r = p.rayTraceBlocks(distance);
if (r == null)
    return; // no hit
Location l = r.getHitBlock().getLocation();```
And this code is supposed to work. or at least it worked in my plugin
cinder thistle
#

wait @opal juniper uhm

#

you can just get the player's direction and go from there

#

oh wait someone else helped already

opal juniper
#

yes, and i really dont think it is that simple 🤣

cinder thistle
#

it is

#

technically it's more complex than that but it's done behind the scenes

opal juniper
#

ok

sturdy patrol
#

And if you want to select the block that is 'in front' of the block you look, just like when you place a block manually ingame, you can do:

Player p = event.getPlayer();

// We start by doing a raytrace to find the block the player is looking at
RayTraceResult r = p.rayTraceBlocks(distance);
if (r == null)
    return; // no hit
Location l = r.getHitBlock().getLocation().add(r.getHitBlockFace().getDirection());```
cinder thistle
#

wait there's a built-in api now?

sturdy patrol
#

For that? Yeah?

cinder thistle
#

thought that was a lib

sturdy patrol
#

But the blocks/entity you want to raycast must exist server side x) You still have do the maths manually if you want to do a raycast on a 'fake, client-side' block, wall or screen.

opal juniper
#

@lost matrix what is the lastHit thing

sturdy patrol
#

And this rayTraceResult can even give you the exact coordinate of the intersection, not only the hitted block. Well, it's neat.

lost matrix
opal juniper
#

ohhhh, i mean data type

#

like that is it

#

wait nvm

sharp bough
#

is there a way to use " in the send message?

dusty herald
#

yes

sturdy patrol
#

@opal juniper I pasted the 2 previous codes with Player::rayTraceBlocks for you x) I think it should do the trick.

sharp bough
dusty herald
sturdy patrol
#

\" @sharp bough

wide dune
#

https://paste.md-5.net/zamahakeyo.js
Just making an Inventory serializer/deserializer but theres issues with ItemStack.deserialize(map) - double being casted to an int
Could anyone help please?

eternal oxide
#

ItemStacks are already serializable

wide dune
#

???

rigid hazel
#

player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 30, 255));

#

This isnt working

#

Why?

#

Please help

cloud current
rigid hazel
#

Cant I do it like that?

#

I want it 30 seconds and the maximum amplifier

cloud current
#
World world = Bukkit.getWorld("world");
Location center = new Location(world, 0, 0, 0);
int radius = 16;

int y = world.getHighestBlockYAt(center);

for (double i = 0.0; i < 360.0; i += 0.1) {

  double angle = i * Math.PI / 180;

  Block block = new Location(center.getWorld(),
    (center.getBlockX() + radius * Math.cos(angle)),
    y,
    (center.getBlockZ() + radius * Math.sin(angle))
  ).getBlock();

  block.setType(Material.WOOL);
  block.setData((byte) 14);

}
rigid hazel
#

Ähm

cloud current
#

If someone is good in Maths, how can I fill this circle ?

rigid hazel
#

Do you ignore me?

cloud current
#

@rigid hazel check if the line is executed

rigid hazel
#

It is

#

I already checked @cloud current

cloud current
#

bro

quiet ice
cloud current
alpine urchin
rigid hazel
cloud current
#

what did you try

quiet ice
#

Basically you just remember the two furthest blocks from the center (the nearest probably also works) you have placed on a given axis and fill in between, repeat for every point

quaint mantle
lost matrix
rigid hazel
quaint mantle
lost matrix
#

A lot of performance can be gained by using the squared length of the radius and just checking it against x + z

quaint mantle
#

So an amplifier of 33 would give you 1

#

33%32 = 1

#

If you know what modulo is

#

If not it just gets the remainder

quiet ice
#

Modulo is a bit more complicated that that if you work with negative numbers iirc

tulip cove
#

Can anyone help me why this lane fails?

        Title:
        - '&cToday's Votes %page%/%maxpage%'
        - '&cPlayerName : VoteSite : Time'
        Line: '&6%player% : %VoteSite% : %Time%'```
``` in 'string', line 249, column 9:
            Title: 'Votes'
            ^
expected <block end>, but found '-'
 in 'string', line 250, column 9:
            - '&cToday's Votes %page%/%maxpage%'```
sharp bough
#

is there a way to edit a vanilla command only when a condition is met? so lets say you use /gamemode creative wich is a vanilla command, but i want to to /gamemode super, but i dont want to remake the gamemode creative, survival, spectator etc

#

like if it meets the condition then do something otherwise just use the vanilla

dusty herald
#

you could just do minecract:gamemode

cinder thistle
#

some1 recommend a good command framework other than redlib/ccf/acf

#

or just provide me some good acf docs

earnest junco
lost matrix
# tulip cove Can anyone help me why this lane fails? ``` Today: Title: -...
      Today:
        Title:
          - "&cToday's Votes %page%/%maxpage%"
          - "&cPlayerName : VoteSite : Time"
        Line: "&6%player% : %VoteSite% : %Time%"
  1. The list needs to be indented.
  2. If you are using ' in your Strings then you cant use the same character as bounds. So in your case " would be more useful because your String escapes right in the middle: Today's
tulip cove
#

thanks

earnest junco
#
  1. The list needs to be indented.
    Actually doesn't, was surprised too. As long as there's a -, it'll continue thinking it's a list
lost matrix
#

Lol this is valid yml

Mark McGwire: {hr: 65, avg: 0.278}
Sammy Sosa: {
    hr: 63,
    avg: 0.288
  }

Didnt know you could do that either.

sharp bough
#

why does intellij recommends to change

getCommand("test").setExecutor(new LocateCommand());

with

Objects.requireNonNull(getCommand("test")).setExecutor(new LocateCommand());

whats the difference?

#

isint the command already not null?

#

like if theres a command then its not null

#

oh because i used
@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args

#

right?

dusty herald
#

getCommand is nullable

mystic vault
#

Test command may not exist in plugin.yml

lost matrix
sharp bough
#

ah its like safer but the same thing

#

aight i get it thanks

sage swift
#

An anvil that falls for 3 blocks and longer destroys any item entity it lands on.
what is the best way to check for this?

compact haven
#

if u want annotations redlib is out of the question, if you want good builders then cloud

ivory sleet
#

Cloud everyday

cinder thistle
#

cloud is underdocumented

paper viper
#

ad

#

ier

#

(:

quiet ice
#

ew

ivory sleet
#

Well they’re more or less similar

#

So yeah I guess that’s a good alternative

#

Though cloud has some good framework classes for spigot related stuff which brig does not

paper viper
#

cloud is fat

ivory sleet
#

So?

#

Just download it at runtime

paper viper
#

/s

ivory sleet
#

no u

paper viper
#

If i gotta be honest here, I don't really like the builders cloud provides sometimes because they can get messy if it's too big

#

They are great tho still

eternal oxide
#

@opal juniper I just noticed your PlayerItemHeldEvent code has a memory leak. Every time a player equips a stick is starts a new repeating task

#

ah nm, I see you cancel it later

ivory sleet
#

@paper viper iirc they’re immutable which is the only thing I don’t like lol

opal juniper
eternal oxide
#

I was just playing with it to see if it performed better with a single runnable.

opal juniper
#

ahhh, i see

#

I mean it shouldn't be to hard to do that, i used hashmaps where i could

eternal oxide
#

?paste

queen dragonBOT
opal juniper
#

with like for loops

eternal oxide
velvet marsh
#

whats the difference between isBlockPowered vs isBlockIndirectlyPowered?

#

javadocs are most definitely unhelpful

opal juniper
#

if it has a lever/button or something ON it, it is directly powered or BlockPowered

velvet marsh
#

oo ok

#

so if you wanted to check if a block has some kind of power at all

#

youd need

#

isBlockPowered || isBlockIndirectlyPowered

#

cheers

opal juniper
#

yep, np

opal juniper
arctic summit
#

how do i change the color of a title?

#

from what i see it only has parameters for title, subtitle, fadein, stay and fadeout

wide dune
#

1::{"slot":1,"itemStack":{"type":280,"amount":1,"durability":0,"meta":{"enchantments":{"Enchantment[19, KNOCKBACK]":1},"repairCost":0,"hideFlag":0,"unhandledTags":{}}}}##2::{"slot":2,"itemStack":{"type":24,"amount":64,"durability":2}}##3::{"slot":3,"itemStack":{"type":270,"amount":1,"durability":0,"meta":{"enchantments":{"Enchantment[32, DIG_SPEED]":1},"repairCost":0,"hideFlag":0,"unhandledTags":{}}}}
I wrote this code to deserialize that ^, but it's giving me a null pointer on line 15 in https://paste.md-5.net/inipozafix.js
Could anyone explain why please, I'm confused haha

opaque grove
#

How do i change the color of the name obove the head

indigo galleon
#

How i put de head of the players on the tab

warm cloak
#

List<String> players = null; if(Bukkit.getOnlinePlayers().size() > 1) { for (Player p : Bukkit.getOnlinePlayers()) { players.add(p.getName()); } } else { players.add(sender.getName()); } return players;

whats wrong with this?

indigo galleon
floral flare
#

How do I get all the server names from a BungeeCord?

warm cloak
indigo galleon
#

Spanish XD

warm cloak
#

i dont know spanish bro 😄

indigo galleon
#

Okey thx

warm cloak
#

if you want to teach me spanish dm is open XD

arctic summit
#

how do i change the color of a title?
from what i see it only has parameters for title, subtitle, fadein, stay and fadeout

eternal oxide
warm cloak
arctic summit
eternal oxide
arctic summit
#

ok i can thank you

#

is there a reason you put ~ in the title or just no reason

eternal oxide
#

just to look pretty

arctic summit
#

👌