#help-development

1 messages · Page 2011 of 1

misty current
#

i'd suggest using aoe clouds if you need to show the name only

#

they are less heavy

rough drift
#
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if(args.length >= 1 && sender.hasPermission("crates.admin")) {
        switch (args[0]) {
            case "reload":
                CratesPlugin.getInstance().reload();
                sender.sendMessage("§aCratesPlugin config reloaded.");
                break;
        }
        return true;
    }

    if(!(sender instanceof Player)) {
        sender.sendMessage("You must be a player to use this command.");
        return true;
    }

    try {
        User user = UserProvider.get(((Player) sender));
        user.showMenu(MenuManager.getMenu(user, Menu.Type.CRATES, -1));
        user.setViewingCrates(true);
        user.success("Opening the crate menu.");
    } catch (Exception e) {
        e.printStackTrace();
    }
    return true;
}
misty current
#

what is line 47

young knoll
#

I guess you can use an aoe cloud

#

They both tick though so I doubt it’s much different

rough drift
misty current
#

i think the stand tick is heavier because it's a livingentity

young knoll
#

It doesn’t have AI tho

#

And you can even set noAi on it

misty current
#

it says line 47 here or am i stupid

misty current
rough drift
#

its PluginCommand

#

not the actual command

misty current
#

then no big deal

rough drift
#

PluginCommand is the dispatcher iirc

#

yeah PluginCommand#execute is internals

misty current
#

check what is the ex caused by

#

spigot throws the command exception when it catches one so the actual ex should be under caused by

rough drift
#

iirc its showMenu, but this is the entire code in showMenu, and menu.getInventory is a final value initialized with Bukkit#createInventory

#

and player.getPlayer() can't be null as i first check player.isOnline

misty current
#

hm i'm not sure

#

can you send the whole stacktrace?

rough drift
#

thats the whole stack trace

#

no other errors are printed

misty current
#

oh wat

rough drift
#

yeah thats the full exception

misty current
#

strange it doesnt even say anything about ur plugin

#

thats why i was confused

rough drift
#

yeah

quaint mantle
#

how do I teleport a player to somewhere

young knoll
#

Please use the javadocs

#

Entity has a teleport method

quaint mantle
#

found it

halcyon mica
#

How would I go about applying completely custom NBT data to a itemstack?

young knoll
#

?pdc

misty current
#

can I use == for worlds or do i need equals? iirc they are the same instances

young knoll
#

Hmm good question

#

Try it and see I guess

misty current
#

lemme check the implementation

halcyon mica
#

I am talking raw NBT data

#

A json formatted string

ancient plank
#

nbt more like

young knoll
#

Idk why you need to do that

glossy venture
#

id excpect equals(...) to do the same thing as == cuz i dont think it will check all blocks

young knoll
#

But NMS

halcyon mica
#

Figures

young knoll
#

Or name

glossy venture
#

yeah thats also possible

young knoll
#

Why do you need to set a json string on an item

halcyon mica
#

Because it's for a config system where a user is able to append a custom tag to a item

#

For whatever reason they need it for

quiet ice
young knoll
#

I mean that sounds like pdc would work fine

halcyon mica
#

It does not

quiet ice
#

Bukkit creates wrapper objects, so they may differentiate (instance-wise) without differences in runtime behaviour

misty current
young knoll
#

Not like comparing UUIDs will be slow anyway

misty current
#

it was not really for performance, just curiosity

hexed hatch
#

I’m struggling to think of a scenario in which it fails

misty current
#

if you don't want to use pdc, you can either mess around with nms or use nbtapi and don't go through the pain

young knoll
#

Forgot about nbtapi

halcyon mica
#

Because many of the keys are not custom values, but vanilla ones instead

hexed hatch
#

No they aren’t

#

You can register your own keys

halcyon mica
#

I have no influence on wether a key is custom or vanilla

#

It's up to the user

misty current
#

Namespacedkey has a constructor that allows to input a string as the key, even tho it's meant for internal usage only so maybe that could suit your case better

ancient plank
#

I knew someone who uses nbt because they don't like how there's no documentation on TAG_CONTAINERs

young knoll
halcyon mica
#

I don't want alternative approaches, I want to know how to modify the nbt data attached to a object

hexed hatch
#

NamespacedKey.vanilla(string)

young knoll
#

Doesn’t work

hexed hatch
#

no?

misty current
#

hm right because the key would have to be something anyways

young knoll
#

Because it still gets put in the PublicBukkitValues container

halcyon mica
#

So how can I construct a compound tag from a json object with unknown layout

hexed hatch
#

nms

young knoll
#

Gonna have to dive into NMS to find that out

#

Maybe you can find something online, who knows

hexed hatch
#

so the reason you don't use pdc is because the user specifies the keys, right?

young knoll
#

It’s because they want vanilla keys to work too

hexed hatch
#

what's to stop them from throwing a map in a pdc

#

get the pdc and then get the keys from the map

halcyon mica
#

...the fact that I want vanilla keys to work?

#

You know what, just forget it, I'll figure it out

sterile token
hexed hatch
#

lol

sterile token
#

Alllright

#

Thanks

#

And sorry people, i know im 24-7 annoying

#

😂

misty current
#

since when are chunks not properly aligned at -1, -1

misty current
#

it's 1 wide

#

the middle is -1 -1

#

that's very annoying

#

i wanted to chunk align islands

west oxide
#

hey everyone i have a question

how can i override another plugins existing command ?

hexed hatch
#

command preprocess event

arctic moth
#

y e s server outdated

misty current
young knoll
#

Nah the event works

misty current
#

same if you want to remove it

arctic moth
young knoll
#

You could remove it with the event too

west oxide
#

ooh that sounds like something useful

#

thank you

hexed hatch
#

Is there a somewhat easy way to detach a player from their body with packets so to speak? Like, have their game character in one place and have the player's view in spectator?

#

I want to make sort of a freecam plugin

#

Where their body stays where they are so they can't use it to just escape mobs

misty current
#

also im not sure how could you resync the player with the server

iron tundra
#

I am trying to make a wolf despawn after a certain amount of time after being summoned as a guard, it doesn't give me the length of time lived nor does it work with another method of getting the world. I have tried making this check occur in the function that spawns it and getting the world through that but that still doesn't work. If you can explain what is wrong I would appreciate it!

public void main(String[] args) {
        for (Entity e : Objects.requireNonNull(this.getServer().getWorld("minecraft:overworld")).getLivingEntities()) {
            if (e instanceof  Wolf) {
              if (Objects.equals(e.getCustomName(), ChatColor.GOLD + "Queen's Guard")) {
                  System.out.println(e.getTicksLived());
                  for (int i = 0; i <= 100; i = i + 10) {
                        System.out.println(e.getTicksLived());
                        if (e.getTicksLived() == 100) {
                            e.setSilent(true);
                            e.remove();
                        }
                  }
              }
            }
        }
    }
hexed hatch
#

Perhaps it'd be just easier to spawn in new player on the server while they're in ghost mode

misty current
#

it would be better to just save the location where the player started to freecam and then teleport them back

ancient plank
#

make a fake player with packets and just don't let the og player see the fake player WinkTeehee

hexed hatch
#

wanted to have it so if they get hit by a mob or a player, it yoinks them back

hexed hatch
#

because you can just use it to escape a sticky situation

misty current
#

put them in spectator

quaint mantle
#

Am I doing this correctly?

#
stand.setCustomName(ChatColor.getLastColors(EmeraldsPlugin.jp.getConfig().getString("Crates."+blockKey+".Color")) + EmeraldsPlugin.jp.getConfig().getString("Crates."+blockKey+".Name"));
#

Its not setting the color

#

Color: GREEN

#

in config.yml

hexed hatch
young knoll
#

Yeah getLastColors won’t work there

misty current
#

hm thats right too

viral crag
young knoll
#

You would have to use ChatColor.valueOf

hexed hatch
iron tundra
misty current
#

but again i am not sure how could you resync the player

ancient plank
#

idk

young knoll
#

Fake players don’t exist server side

ancient plank
#

I don't use packets

young knoll
#

So no

hexed hatch
#

I'm not looking to spawn in a fake player altogether

#

I just want to create a semi real player

#

that will be seen by the server as a real player

quaint mantle
#

@young knoll Can you get the state of an armor stand?

#

Cause Idk how lol

#

for getPersistentDataContainer

sterile token
young knoll
#

Iirc it’s just getPersistsntDataContainer on entities

viral crag
sterile token
young knoll
#

?scheduling ^

undone axleBOT
sterile token
#

I dont know why javadocs where invented if most people doesnt reading them...

misty current
#

skill issue

quaint mantle
sterile token
misty current
#

entity extends persistentdataholder

sterile token
#

Idk i think i cannot use an api without having the documentations

misty current
#

and an armorstand is an entity

#

so you can

viral crag
misty current
#

but ofc you can't call it on the class, but on an instance of the class

#

if you are doing something like ArmorStand.getpersistent... consider learning java

quaint mantle
#

can i vonvert ArmorStand to Entity?

glossy venture
#

yes

misty current
#

an armorstand is an entity

#

polymorphism 101

young knoll
#

^

glossy venture
#

it is an Entity so you can cast it

quaint mantle
#

so I can do this

Entity entityStand = (Entity) stand;
#

cool

glossy venture
#

yeah

misty current
#

there is no need

glossy venture
#

but you dont need to

quaint mantle
#

?

misty current
#

a child class identifies as its superclass too

glossy venture
#

it has all methods the entity has

quaint mantle
#

oh no need to call it as an Entity

misty current
#

or its interfaces

misty current
young knoll
#

ArmorStand extends entity

#

So it has all the methods entity does

glossy venture
#

inheritance

misty current
#

send ur code

#

how do u get the armorstand

wet breach
#

there is certain times you might want to cast

sterile token
quaint mantle
#

oh my god im an idiot

quaint mantle
#

stand.getPerst... exists

misty current
#

;-;

wet breach
# sterile token When?

lets say you were dealing with other types of entities, and need to be able to compare for example

sterile token
# quaint mantle stand.getPerst... exists

That why i always told you, and im like a parrot telling you - "Javadocs (jd) is your best friend and you always ignore the message". But idk its like not my problem, im just giving you the tools to work faster

sterile token
#

And sorry if i look rude but sometimes i run out of patiente

quaint mantle
#

No its understandable

misty current
#

i don't really understand how you didn't notice that getpersistentwhatever autocompleted when you wrote it after stand.

#

buttt its fine i guess

viral crag
#

not everyon uses autocomplete

sterile token
#

And less using shitty eclipse

#

Sorry eclipse*

#

I always confuse them

#

😂

dire salmon
#

can making particle lag servers?

misty current
quaint mantle
#

In all seriousness however, is there a way I can store an object in a PersistantDataType?

#

it doesnt seem I can and I want a way to delete a armorStand later on

sterile token
#

Why tag, btw. just anways the message and its tag too

dire salmon
misty current
#

most that can happen is that the server gets overloaded because it has to send too many particle packets but i really doubt it

sterile token
#

Yeah i know but you can answer the message

#

And it tag me too

#

But no problem

#

hahaha

misty current
#

from memory, might be wrong but thats the general idea

misty current
#

huh

#

oh

#

lol

quaint mantle
hexed hatch
#

You could serialize it to a string

#

And then deserialize it out

misty current
#

more than serializing it, break it down into doubles and a string

hexed hatch
#

I usually just store locations as world;x:y;z

dire salmon
#

wha?

#

oh

#

ever heard about my Tower of Babel staircase?

#

used this do draw shapes with particle

quaint mantle
#

Any way to run a command in java? "/summon villager 1 5 1"

#

cant find anything

misty current
#

no

#

nonononono

dire salmon
#

yes, i dont remember how but yeah

sterile token
dire salmon
#

this ^

dire salmon
misty current
#

it just defeats basic oop principles and its unreadable

#

but apart from that nothing that bad

sterile token
#

Potion effect

dire salmon
#

^

misty current
#

it's not complete darkness

sterile token
#

You cant

dire salmon
#

nope

sterile token
#

Its not supported front the client

misty current
#

you can and i am thinking

kindred valley
#

?paste

undone axleBOT
dire salmon
#

you can, send them to void

sterile token
#

No

kindred valley
misty current
#

^

dire salmon
#

black concrete box

#

^

misty current
#

ok i give up

hexed hatch
#

If you're so sure, why are you asking us?

dire salmon
#

lots of black particle

sterile token
#

You cannot set the client completly black, because the client doesnt support it

dire salmon
#

?jd may say it

hexed hatch
#

mmm

misty current
#

i am sorry you have to go through this

hexed hatch
#

This is for the spigot api

#

not for messing with packets

misty current
#

wtf of a reply is that

#

it's about spigot development+

#

using packets is a big part of it

hexed hatch
#

I'm just saying this is the spigot server, you should at least expect the people here to be knowledgeable about the api itself

dire salmon
#

bro

hexed hatch
#

is it though?

#

it's not in spigot, but you can send them with plugins

#

it's the minecraft server protocol which is not part of spigot

misty current
#

sys what if you showed a fake block on the player's head? when your head is in a block the screen should be pitch black

dire salmon
sterile token
#

So if you know how to do it. Do it by your self.... Just asking for support and them you shitying us that we are trying to help...

lost matrix
#

Technically speaking they are not. Packets are part of nms. Spigot abstracts everything packet related away.
But packets have traditionally been a big part of Spigot development.

misty current
#

unless you need the effect to move with the player

quaint mantle
#

... Did I type this correctly..?

Bukkit.dispatchCommand(p, "/execute @a "+block.getX()+" "+block.getY()+" "+block.getZ()+" @e[type=armor_stand,distance=2]");
#

Feel like I screwed up somehow

subtle folio
#

im trying to check if a item has itemmeta the thing says it doesnt have any item meta but I generated it with itemmeta. how to fix?

quaint mantle
hexed hatch
#

Yeah, I'm being a little pedantic. My point is don't expect world class help with packets here. You can ask of course, but don't get pissy when no one can help you

dire salmon
dire salmon
#

is delay 0L longer than 1L?

kindred valley
subtle folio
sterile token
lost matrix
#

The only ItemStack that does have no ItemMeta is air

subtle folio
#
public static void giveItem(Player p, Items item, int amount) {
        String name = item.getName();
        String lore = item.getLore();
        ItemStack itemStack = item.getItem();
        itemStack.setAmount(amount);
        ItemMeta meta = itemStack.getItemMeta();
        meta.setDisplayName(name);
        List<String> loree = new ArrayList<>();
        loree.add(lore);
        meta.setLore(loree);
        itemStack.setItemMeta(meta);
        p.getInventory().addItem(itemStack);
    }``` setting
```java
if (e instanceof EntityDamageByEntityEvent) {
                    if (p.getInventory().getItemInMainHand().hasItemMeta()) {
                        for (Items item : Items.values()) {
                            if (item.getName().equals(p.getInventory().getItemInMainHand().getItemMeta().getDisplayName())) {
                                for(Item i : ItemManager.items) {
                                    if (i.enumeration.equals(item)) {
                                        i.execute(p, p.getInventory().getItemInMainHand(), (EntityDamageByEntityEvent) e);
                                        Bukkit.getLogger().info("Executed " + i.enumeration.getName());
                                        return;
                                    } else {
                                        Bukkit.getLogger().info("4 " + i.enumeration.getName());
                                    }
                                }
                            } else {
                                Bukkit.getLogger().info("3 " + item.getName());
                            }
                        }
                    } else {
                        Bukkit.getLogger().info("2");
                    }
                } else {
                    Bukkit.getLogger().info("1");
                }``` checking
misty current
#

i have never seen such behaviours in this chat lol

hexed hatch
#

you asked how to make a player's screen black, people answered, and then you clarified after that you wanted it done with packets

subtle folio
#

it only gets to 2 tho

undone axleBOT
lost matrix
sterile token
#

Paste the code there

subtle folio
sterile token
dire salmon
misty current
#

also another flaw, if the player is not centered it might not work really well

subtle folio
#

there

hexed hatch
#

you could probably just send a 3x3 cube of black concrete to their location

misty current
#

maybe the suffocation pitch black can even be simulated by sending a packet

#

not sure

#

i am not sure tho

sterile token
misty current
#

you are joking right

#

lmfao

#

dude i am legit laughing

lost matrix
#

The most reliable/less disrupting way to make the screen of a player black is by using a forced resourcepack.
You can substitute a character with a huge black square and display it as a title to the player.

hexed hatch
#

Night vision and blindness used to make a super black effect as well

cosmic pelican
hexed hatch
#

Not sure if that works in the current version

viral crag
#

wonders why you dont just alter the demoscreen and push a resourcepack to make it black

kindred valley
sterile token
#

Agree

hexed hatch
#

In what cases are you making a player's screen black? Is it when they're in a specific state or place, or will it occur at any time?

lost matrix
#

Only with a bit of tinkering

hexed hatch
#

You might as well just have a block of black concrete and put the player there lol

#

if it's one location

cosmic pelican
#

it's not

#

here, let me show you.

hexed hatch
#

ah

misty current
#

another thing, what if you showed a falling sand at the player?

sterile token
#

And why you wanna set player screen to black?

cosmic pelican
#

https://www.youtube.com/watch?v=teCsBdCBqjA

I've recreated the following, all the math, etc. It's really smooth, but my only issue is the black screen. I apologize for my friends actions from before. I'm essentially trying to achieve that.

hexed hatch
#

you could throw a 3x3 cube of black concrete on the player with sendBlockStateChange

misty current
#

does it make the vision black too?

#

i dont' remember tbh

#

you could make it move with the player

dire salmon
#

@weary geyser
its easy
put them in a black concrete cube
night vision level 255
blindness level 255

cosmic pelican
#

I'm much more experienced with Java itself than the Spigot API so I need a little bit of direction.

lost matrix
misty current
#

when they send a movement packet, relocate the fallingsand

dire salmon
#

or put them in void in a level they dont die, and make them unable to fall

cosmic pelican
#

Well it's supposed to fade.

cosmic pelican
misty current
#

just ignore them

hexed hatch
#

It's intended to fade?

cosmic pelican
#

Yes, look at the video I sent above.

hexed hatch
#

Oh

#

Might be a bit of a challenge to get that effect

#

Though a resource pack is your best option I think

cosmic pelican
#

I like @lost matrix 's suggestion of the title but I'm not sure if the character can get that large.

hexed hatch
#

I have a proposal, actually

cosmic pelican
#

I'm all ears haha

sterile token
lost matrix
hexed hatch
#

You could spawn an armor stand with a large black square model emplaced on it, and send multiple item updates to it for each stage

#

like, each model a different transparency level

subtle folio
#

this works in 1.18.1>

lost matrix
quaint mantle
#

Ugh. This is pissing me off.

#

Why wont it delete the armor stand?

hexed hatch
#

It'll be a little clunky but it might be as close as you can get to that effect

sterile token
misty current
#

oh nevermind, falling blocks don't seem to make the screen black @weary geyser

lost matrix
#

strictly yes

viral crag
cosmic pelican
hexed hatch
#

that won't get a clean fade

cosmic pelican
#

Thanks so much guys!

lost matrix
#

It supports dynamic types and has api support.

hexed hatch
dire salmon
#

sysdm what about putting a big black particle in player screen + make them unable to move head

viral crag
misty current
#

compatibility and api

cosmic pelican
hexed hatch
#

However, I am somewhat aware of a caveat there

#

I believe textures only support certain degrees of transparency

cosmic pelican
#

sysdm stfu

sacred scaffold
#

stop talking spo fpr,al;y giuys it ok to make mistakes in writibg'

dire salmon
#

you also dont

sacred scaffold
#

thia sint coll;ege clas

hexed hatch
#

I'm not sure what values work or how smooth you can make it, however you can always layer multiple transparent objects on in a sequence

dire salmon
#

do you know how to solve it?

sacred scaffold
#

stop uisoing cpmmas and apostro[hes

sharp flare
sacred scaffold
#

no

dire salmon
sharp flare
#

Jesus

dire salmon
#

at least i got a cool effect

sacred scaffold
#

i am sinply here to educate you younglings its ok to type regularly

sharp flare
#

It's so inefficient

dire salmon
#

how would i do it better then

hexed hatch
dire salmon
#

i tried for loop but it kept the particle at one place (or made the shape instantly, idk)

lost matrix
sharp flare
#

I'll leave that to you to discover since my eyes went black already

lost matrix
cosmic pelican
dire salmon
hexed hatch
#

Cool cool

sharp flare
#

But hey atleast he giving u pseudo clues, you wouldn't want a full code for it

lost matrix
viral crag
#

hmmm

hexed hatch
quaint mantle
#
stand.setCustomName(ChatColor.getLastColors(EmeraldsPlugin.jp.getConfig().getString("Crates."+blockKey+".Color")) + EmeraldsPlugin.jp.getConfig().getString("Crates."+blockKey+".Name"));
#

Any reason why the color is being set to gray?

#

When the value is "GREEN"

dire salmon
#

googled but couldnt find

lost matrix
sharp flare
#

Its used back the days

sterile token
sharp flare
#

We used it for C language

#

But it works on any language, its an step by step way to solve a problem but with only simple words as syntax

quaint mantle
#

Its not like im begging for help

#

Just a general concern

lost matrix
sterile token
wet breach
# dire salmon i dont know what pseudo code is

its basically just the broken down explanation in how something is supposed to work in terms that is easy to understand so that you could create your own code based on such things and know what needs to be accomplished.

sage patio
#

How I can spawn a block break particle in 1.8 ?

viral crag
quaint mantle
dire salmon
sage patio
#

1.8 is dark

dire salmon
#

is 1.8 even supported?

#

i mean, its very old

sage patio
dire salmon
#

o

hexed hatch
#

Children born when 1.8 was released are 8 now

wet breach
# dire salmon ohhh so if someone send me like ```java while 4 > 3 print result ``` it...

no, its more like lets say you asked me how would you make a gui and then I proceeded to tell you

you need to create an inventory object and etc etc.

basically describing to you the steps needed to create a gui inventory, without actually showing you any code. In this manner, you are free to implement it however you see fit but know what needs to be done to get it working overall.

sage patio
misty current
#

LOL i have found the definitive troll

#

send a demo packet

misty current
#

and show the "you have demo mc" screen

dire salmon
#

So you tell me what i have to do in a simplified and no-code way?

wet breach
#

exactly

dire salmon
#

Pog

#

Thanks

wet breach
#

this way you are not copying code and creating your own version of it 🙂

#

which is generally better

dire salmon
#

But

#

What if they tell me to do something i have no idea how?

#

And if its the case, i dont find in google?

kindred valley
sage patio
#

no body ???

viral crag
ivory sleet
#

Yes

#

But I have distanced myself from it significantly

sage patio
ivory sleet
#

I don’t know 1.8 isn’t my thing

viral crag
ivory sleet
#

I haven’t touched it for ages

dire salmon
#

Would be cool a LeetCode for spigot :thonk:

misty current
#

i have found something to do some trolling

#

if you send a game state packet for the final credits, the client freezes on a loading terrain... screen

#

i've waited for a while and it doesn't go away

subtle folio
hexed hatch
#

so you're trying to get pdc from an item

#

but your meta is null

subtle folio
#

yeah

#

its a custom item im using thought

#

that I generated with item meta

hexed hatch
#

can I see where itemMeta is coming from?

subtle folio
#

sure

waxen plinth
#

If you're calling this in an interact event

#

Or I guess in any case where the item could be air

subtle folio
waxen plinth
#

Air has no item meta

#

You should just early return if the item meta is null

subtle folio
#

im holding the proper item dw

#

ill add in more checks once it works 😅

hexed hatch
#

Does it not fail on the setDisplayName or lore setting?

subtle folio
#

nope

#

no errors whenever thats run

hexed hatch
#

that's a little weird

#

Oh

#

Hold up

subtle folio
#

thats what im saying

#

oh?

hexed hatch
#

checking something real quick

#

Nope

subtle folio
#

?

hexed hatch
#

Feel like that should work lol

subtle folio
#

I've been scratching my head for hours

lost matrix
subtle folio
#

equality is the best quality

#

WHY doesnt this thing work

tender shard
#

Player#sendBlockDamage

#

no need for weird packets

sterile token
sage patio
#

Redstone block break particle

tender shard
sage patio
tender shard
#

Player#spawnParticle or World#spawnParticle

tender shard
#

remember your inner static builder class?

sterile token
tender shard
#

I did sth similar today

lost matrix
# sage patio because its 1.8
  1. 1.8 is half a decade old and support was dropped ages ago. Also only a minority uses it.
  2. You can just spawn any particle with spigot
sage patio
#

and bedwars is 1.8

tender shard
#

lol

sage patio
#

in almost of servers

lost matrix
tender shard
#

1.8 servers are 1.8

#

who still decides to host a 1.8 server today is just mentally challenged imho

#

same for people hosting offline mode servers

#

but yeah that's just my opinion

sage patio
#

bedwars server are 1.8

tender shard
#
  1. yes, quite stupid imho, but
  2. they didn't decide to open their server today, they do it since a decade and
  3. they use their own custom fork
sage patio
#

because player likes 1.8 pvp in bedwas

arctic moth
#

i think i made an oopsies

sterile token
ivory sleet
#

you can practically emulate 1.8 in 1.18 to the letter

tender shard
sterile token
arctic moth
lost matrix
tender shard
arctic moth
ivory sleet
#

its just that people's inexperience and oblivion which has lead to the remnants of 1.8

lost matrix
arctic moth
sage patio
arctic moth
tender shard
ivory sleet
tender shard
lost matrix
#

*PS: You should upgrade

tender shard
#
  • Also you should definitely use a supported spigot version
lost matrix
sage patio
#

its fucking 3:40AM in here, and i'm codding on a bullshit plugin

arctic moth
sage patio
#

i'm closing the project

arctic moth
#

"few"

tender shard
#

also no idea why people make their lives hard by using 1.8 today

sage patio
#

look at this XD

tender shard
#

using 1.8 api is like... still going outside to hunt mammoths instead of going to the supermarket to buy meat

ivory sleet
tender shard
#

you have 127 MB of RAM

#

?!

sage patio
#

no

#

but i like torment the server

quaint mantle
#

would someone be keen on helping me setup mongoDB with pebblehost please

iron tundra
#

When I try to get the custom name of a wolf I spawn for some reason it saying it doesn't have a name, I have it set to remove the entity because I am trying to make it easy to test getting the name.

//Spawning section
Wolf w = (Wolf) event.getPlayer().getWorld().spawnEntity(event.getPlayer().getLocation(), EntityType.WOLF);
w.setCustomName(ChatColor.GOLD + "Queen's Guard");

//Aquiring custom name section
if (event.getEntity().getCustomName().equals(ChatColor.GOLD + "Queen's Guard")) {
    event.getEntity().remove();
}
lost matrix
#
  1. Create the whole vector from A to B
  2. clone the vector and make it the length of a "step"
  3. On every tick -> get the current location and add the short step vec
arctic moth
#

it only spawned 16m falling blocks'

#

i dont see why my ram should explode

#

top ten things said before dying

sage patio
lost matrix
iron tundra
#

Ahhhhhhhh

arctic moth
#

uhhh nothing screwy here...

lost matrix
pliant oyster
#

?jd

tender shard
arctic moth
#

omg theres like 1000 items per block farther than my render distance goes

#

lol more like 128

#

but whatever

lost matrix
#

Oh this changes everything:
Do the same steps

#

Do you want to have a smooth rotation towards the target location?

arctic moth
night torrent
pliant oyster
#

How can I send a message to every online player

night torrent
#

like 4

lost matrix
pliant oyster
pliant oyster
#

like sendMessage

cosmic pelican
lost matrix
#

Hm i would look into lerp rotation of vectors. Not a trivial topic.

tender shard
#

you make everything final too

cosmic pelican
#

It's good practice.

tender shard
#

it's so useless but yes, I do it too lol

cosmic pelican
#

Local finals are useless because javac omits them.

weary geyser
#

that's it

lost matrix
cosmic pelican
#

Final's themselves are not useless lol

weary geyser
cosmic pelican
tender shard
cosmic pelican
#

javac omits finals on local variables, but if you make a field final that's a completely different story.

cosmic pelican
#

LOL

#

javac omits finals on local variables

tender shard
lavish hemlock
#

Actually

tender shard
#

that's decompiled

lost matrix
#

Actually i kind of left this principle because it was not accepted where i work. Very strict code style.

lavish hemlock
#

final does have a meaning

tender shard
#

javac keeps final on local vars

weary geyser
lavish hemlock
#

Although it will probably end up being useless in most cases

#

"Effectively final" variables exist

cosmic pelican
tender shard
lost matrix
tender shard
cosmic pelican
lost matrix
lavish hemlock
#

There's a chance your decompiler might add them

cosmic pelican
#

^

lost matrix
tender shard
lavish hemlock
#

Well I don't see how the final gets stored either way

#

Most of the time the compiler doesn't save local variable attributes in the classfile

pliant oyster
#

does anyone know what's wrong

String all = "all";
if(all2 !== all){```
cosmic pelican
#

Here, I'm getting an official Lunar Client developer to pop in here and explain lol

lavish hemlock
#

Since it's debug information

lost matrix
young knoll
#

Use .equals for strings

#

Also java doesn’t have !==

lavish hemlock
#

Can't argue it makes "less sense"

pliant oyster
lavish hemlock
#

I'd argue it makes less sense in the compiler since Java is explicit about most other things

pliant oyster
#

lmao I'm too used to other languages

kindred valley
#

How can i equal this runnable to work for per 1 hour public class PayMoney { BukkitTask runnable = new BukkitRunnable() { int time = 0; @Override public void run() { for (Player v : Bukkit.getOnlinePlayers()) { Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "money give" + v.getName() + " 1500"); } if (time == 3600) { cancel(); } time++; } }.runTaskTimer(Main.getInstance(), 20, 20); }

cosmic pelican
#

@faint sage

sage patio
lost matrix
ivory sleet
#

that'd be weird, given how npes now tell you what was null

lavish hemlock
sage patio
lavish hemlock
#

I don't really pay attention to those attributes

ivory sleet
#

yeah nor do I, some magic goin on

kindred valley
young dome
#

Hi ! Would you tell me if there is a way to know the origin of a packet (I mean which mod sent it or other information) that was sent using forge with a mod? Thanks :}

sage patio
lost matrix
sage patio
#

and sorry, 3600 is is ticks

#

wait

tender shard
#

@cosmic pelican @lavish hemlock I have to correct myself, you were right, decompiler shows those local vars final no matter whether I actually made them final or not in the code

sage patio
#

for 1 hour in ticks

kindred valley
lavish hemlock
#

Yeah I was staring at the JVMS like

#

"The classfile never stores that...?"

kindred valley
lost matrix
tender shard
#

a POTTED_LILY_OF_THE_VALLEY

lavish hemlock
#

ooh

tender shard
#

:3

lavish hemlock
#

that's my second favorite flower in Minecraft

tender shard
#

after wither rose?

lavish hemlock
#

the first being the poppy rose

tender shard
#

oooh

#

wither rose is the best

young knoll
#

Poppy is the official name now

#

Gosh

lavish hemlock
#

yep 😔

young knoll
#

Roses are a bush

lavish hemlock
#

it will forever live on as the Rose for me

tender shard
#

if I ever adopt a pet in RL again, it'll be an iron golem

faint sage
#

i missed the debate

tender shard
#

somehow I haven't found any in my local animal shelter

lavish hemlock
#

the new texture is nice, but the new name is awful

tender shard
#

maybe mojang is preparing to add drugs

young knoll
#

What’s wrong with the name poppy

tender shard
#

so you can craft a poppy to morphine

lavish hemlock
young knoll
#

Neither is black stained glass pane

#

Smh unplayable game

lavish hemlock
#

Still stands that they replaced Roses with Poppies but Roses are superior

#

"Poppy" sounds like a British housemaid

young knoll
#

Poppies are pretty

tender shard
young knoll
#

It does remind me of the remembrance day poem though

#

Which is a bit sad

hexed hatch
#

They honestly need to add back singular roses

tender shard
hexed hatch
#

we should be able to have both poppies and roses

lavish hemlock
lavish hemlock
#

how does it go?

tender shard
#

Von allen Tieren hat der blaue Wal, das allergrößte Genital

#

"Out of all animals, the blue whale has the biggest genitals"

young knoll
#

I mean roses don’t grow in singular form though

tender shard
#

lmao

hexed hatch
#

so profound

young knoll
#

Not that it matters anyway

tender shard
#

it rhymes in german AND enlgish

lavish hemlock
#

beautiful piece of art

tender shard
#

I didnt even know it works in german AND english

lavish hemlock
#

also

#

it makes sense one of the biggest animals has the biggest dingalingus

young knoll
#

It is the biggest animal

hexed hatch
#

is whale cock whock?

lavish hemlock
#

whalecum

tender shard
#

you're whalecum

#

sounds like a florida person saying you're welcome

lavish hemlock
#

nah that's more Texan

#

Floridians are just

tender shard
#

hm no idea

lavish hemlock
#

a lil dead inside

tender shard
#

I am not murican lol

lavish hemlock
#

stereotyping the Americans, I see

#

I shall join in

tender shard
#

it's my favorite hobby

lavish hemlock
#

doritos mountain dew burger king obesity

tender shard
#

walmart

#

oh and

lavish hemlock
#

karens

lost matrix
tender shard
#

electoral college

lost matrix
#

school schootings

hexed hatch
#

floridians are the result of 4 generations of localized meth abuse

lost matrix
#

no free health care

lavish hemlock
#

inbreeding

tender shard
#

nothing wrong with meth abuse though

hexed hatch
#

I agree, they're the next step evolutionarily for humanity

tender shard
cursive herald
#

how do I get the block that the dispenser is facing when the BlockDispenseEvent event fires?

tender shard
lavish hemlock
tender shard
#

then you can do getFacing

#

or similar

hexed hatch
#

this is so wonderful

#

so floridian

tender shard
#

lol

young knoll
#

The alligator is payment

tender shard
cursive herald
young knoll
tender shard
#

then cast it to Directional

#

then you can do Directional#getFacing()

#

it'll return a BlockFace

#

now you know the direction it faces

#
BlockFace direction = ((Directional)block.getBlockData()).getFacing();
cursive herald
#

But then it will enable Legacy Material Support

tender shard
#

erm no?

#

what does legacy materials have to do with this

cursive herald
#
getLogger().info("Pickaxe detected!");
BlockState bs = block.getState();
BlockFace bsFace = ((Directional) bs.getData()).getFacing();
Block bsBlock = block.getRelative(bsFace);
Material bsMaterial = bsBlock.getType();
//if the material is not bedrock then break it
if (bsMaterial != Material.BEDROCK){
  bsBlock.breakNaturally();
}
tender shard
#

getData() is deprecated

#

do not use it

earnest forum
#

block.getData()?

tender shard
#

Block#getData() is deprecated since like... idk, 10 years?

earnest forum
#

has it?

tender shard
#

even in 1.8 it was deprecated

cursive herald
#

if its deprecated why not just remove it

young knoll
#

Because spigot doesn’t like to break backwards compat

earnest forum
#

i mean like

#

Block#getBlockData()

young knoll
#

That’s a different method

tender shard
cursive herald
#

"will"

young knoll
#

It probably won’t

#

But still, it lets you know not to use it

tender shard
#

exactly

#

never use anything deprecated

#

it's only meant to not break existing plugins that haven't been updated yet

young knoll
#

*Never use anything deprecated for being legacy

#

Draft API is deprecated, but it’s fine to use

tender shard
#

oh yeah that's a different thing

earnest forum
#

?

cursive herald
#

thank you

#

everyone

earnest forum
#

is there a difference between Player#sendBlockDamage() and the PacketPlayOutBlockBreakAnimation packet

young knoll
#

Ones API

#

The other is NMS

tender shard
#

haha

#

Block.getData() was already deprecated in 1.6

earnest forum
tender shard
#

remember when all plugins broke in 1.13? people had time since 1.6(!!!!) to update their code

young knoll
#

Functionality wise, no

earnest forum
#

ah alright

#

thanks

young knoll
#

No, when did all plugins break in 1.13

tender shard
#

when 1.13 came out

#

that's why I started doing plugins

#

because all the ones I used were breaking

#

e.g. ClickSort

young knoll
#

Shouldn’t really have broken

tender shard
#

they all still used numeric IDs for materials

young knoll
#

A lot of time was spent on backwards compat there

tender shard
#

1.13 broke soooo many plugins

earnest forum
#

should i install intellij

tender shard
#

if you want to code java stuff, yes

arctic moth
#

any idea why this is happening i dont have BlockEvent in there

earnest forum
#

yea im just tired of having to go to the javadoc website

arctic moth
tender shard
arctic moth
earnest forum
#

blockevent is something that all of those events extend right

arctic moth
#

oh main

#

the registerevents

young knoll
#

Is someone trying to register a block event

#

Because you can’t listen to BlockEvent

arctic moth
#

ik

#

theres no BlockEvent anywhere tho

tender shard
#

show Main line 31 pls

arctic moth
#

this.getServer().getPluginManager().registerEvents(new Listeners(), this);

tender shard
#

show the full Listeners class pls

arctic moth
#

thats unchanged, it only started doing this error after adding a bunch of events

arctic moth
#

its basically a bunch of events running the same code

#

lol

young knoll
#

Can’t listen to piston event

#

That’s abstract

arctic moth
#

which one

#

ohj

#

what do i use instead

young knoll
#

PistonExtend and PistonRetract

#

Please use the javadocs

earnest forum
arctic moth
#

also is there an event that activates when falling blocks land i dont see one in there

#

maybe entitychangeblock?

arctic moth
#

ok

tender shard
#

what the heck is a sculk sensor

young knoll
#

New block from 1.17

#

Not used until 1.19

#

Listens for sounds and gives off a redstone signal

tender shard
#

whoa wtf

#

it's beautiful

#

never seen or heard of it

arctic moth
#

oh this is very normal

#

that might be why...

#

what could be causing this every time the server starts

tender shard
# arctic moth oh this is very normal

if you are looking for a way to crash your server, I have a way more efficient solution:

        Field f = Class.forName("sun.misc.Unsafe").getDeclaredField("theUnsafe");
        f.setAccessible(true);
        Method method = Class.forName("sun.misc.Unsafe").getMethod("putAddress",Long.TYPE, Long.TYPE);
        method.invoke(f.get(null),0,0);

this'll instantly crash your JVM

#

like instantly, it won't take a few seconds or something

#

it'll just instantly die

#

but of course you gotta put it inside try/catch, not that something bad might happen lol

young knoll
#

Gotta catch those exceptions

tender shard
#

or use lombok's sneaky throws

young knoll
arctic moth
#

hehe that happened a few times...

young knoll
#

Get that often on my test server

#

Since I normally just kill it

arctic moth
#

i just kill it cuz it crashes too much

young knoll
#

Shutting down properly takes like

#

A few seconds

#

I ain’t got time for that

arctic moth
#

same

#

i just reload for updating my plugins

#

lol

#

/reload confirm is the best command ever invented

tender shard
#

I have a -reload command on my discord, we need one here too

tender shard
#

but some admins actually think they should use it on their real server

#

and those just deserve to get broken worlds and console errors and lost data

pliant oyster
#

How do I make 2 different arguments for 1 argument in commands, if that makes any sense

arctic moth
#

bruh when u join the server and ur at 1076 y and there are 170k entities

#

and u have no fps

pliant oyster
#

can we vc

#

so I can explain it

tender shard
#

no

pliant oyster
#

and screenshare it

#

alr

#

so basically

#

I need multiple options in a command

#

so like

arctic moth
#

i think its time i deleted my world

#

lol

tender shard
#
/mycommand dothis
/mycommand dosomethingelse

?

pliant oyster
#

no

#

lemmie explain it rq

tender shard
#

ok

arctic moth
pliant oyster
#

In /heal, I could either do /heal <player> or /heal all

arctic moth
#

lol

pliant oyster
#

I want the 2 different options

arctic moth
#

lemme guess tablist?

waxen plinth
wet breach
tender shard
#

okay so in your onCommand, just get args[0], then check if it's all, if yes do your heal all stuff, otherwise get the player?

wet breach
#

I have the thing for you

tender shard
arctic moth
waxen plinth
#

Good idea

arctic moth
#

wont crash but causes funny lag

wet breach
#

let me grab you one of my infamous links

tender shard
#

using Unsafe.putAddress crashes and produce awesome console output

waxen plinth
pliant oyster
wet breach
#

take a look at that, I think that is what you were wanting

#

its open source 🙂

waxen plinth
#
heal player:target {
  hook healPlayer
  all {
    hook healAll
  }
}```
pliant oyster
wet breach
#

I do that so I don't have to worry about case sensitivity

pliant oyster
#

oh

tender shard
# waxen plinth Could also just `System.exit(0)`

look at the beautiful error my method produces:

[02:17:33 INFO]: Preparing start region for dimension minecraft:the_end
[02:17:33 INFO]: Time elapsed: 58 ms
[02:17:33 INFO]: [JukeBoxPlus] Enabling JukeBoxPlus v3.2.4
[02:17:34 INFO]: [JukeBoxPlus] [ACF] Enabled Asynchronous Tab Completion Support!
[02:17:34 INFO]: [Test] Enabling Test v0.9.9
> #
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fff6b341c00, pid=12624, tid=25396
#
# JRE version: Java(TM) SE Runtime Environment (17.0.1+12) (build 17.0.1+12-LTS-39)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.1+12-LTS-39, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0x7a1c00]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\mctest\hs_err_pid12624.log
Compiled method (n/a)   10569 8788     n 0       jdk.internal.misc.Unsafe::putLong (native)
 total in heap  [0x0000020fc99da210,0x0000020fc99da5d0] = 960
 relocation     [0x0000020fc99da368,0x0000020fc99da398] = 48
 main code      [0x0000020fc99da3a0,0x0000020fc99da5d0] = 560
Compiled method (n/a)   10573 8788     n 0       jdk.internal.misc.Unsafe::putLong (native)
 total in heap  [0x0000020fc99da210,0x0000020fc99da5d0] = 960
 relocation     [0x0000020fc99da368,0x0000020fc99da398] = 48
 main code      [0x0000020fc99da3a0,0x0000020fc99da5d0] = 560
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

mfnal@J▒germeister MINGW64 /c/mctest
$

wet breach
#

so if you typed the argument in call caps for example

#

it would still match

waxen plinth
#

Nice

tender shard
pliant oyster
#

ohhh

#

that's all I have to do?

wet breach
tender shard
#

if no, do your regular stuff by getting the player from args[0] and only heal them instead

tender shard
wet breach
#

the link I gave shows them how to do just that

arctic moth
#

if you wanna see something funny make it spam longs with random values from the long limit to the long negative limit every tick

#

n u m b e r s

tender shard
sterile token
arctic moth
cursive herald
#

How do I remove the item from BlockDispenseEvent ?

wet breach
tender shard
#

where do you actually want to remove it from?

#

from the dispenser? or remove the item that actually got dispensed from the world?

cursive herald
#

I want it to be removed from the inv (aka dispenser)

arctic moth
#

interesting world gen

#

its literally a one block tree wtf

tall dragon
#

bushes :D

arctic moth
#

those dont exist tho

tall dragon
#

your pictures say otherwise.

earnest forum
hexed hatch
#

jungle bush

#

spawn in jungles

arctic moth
#

theres no jungle tho

#

its a beach

hexed hatch
#

f3 over that shit

#

the grassy parts

#

the deep green parts

earnest forum
#

sparse jungle

hexed hatch
#

believe you have yourself a sparse jungle edge sliver

#

I'm annoyed that Minecraft lacks tropical islands

tender shard
hexed hatch
#

And mojitos

tender shard
#

and mosquitoes

cosmic pelican
#

Hey, can someone help me out with something small?

I'm trying to get a player to look from Point A to Point B slowly instead of just snapping (which I have the code for) I just need them to look towards it slowly instead.

simple anvil
#

i was trying to make a command that would build a house, how would i do that without doing a setblock command for every block?

cosmic pelican
simple anvil
#

i can? how woul di do that

tall dragon
cosmic pelican
#

I have movement done smoothly, just need to do camera rotation.

#

You can do anything if ya set your mind to it I'm just getting burnt out for today as I've been at it for a couple hours.

hexed hatch
hexed hatch
#

It’s not something I’ve explored a ton but it sounds like it’ll just take a little math