#help-development

1 messages · Page 1704 of 1

young knoll
#

You can cancel outgoing packets with Protocollib

wary harness
#

outgoing

#

is that not incomming package

#

from client

young knoll
#

You can cancel those too

#

Not sure if it would be before viaversion handles it

lost matrix
young knoll
#

No

#

But they do work with it

wary harness
#

viaversion loads before

#

so probably not then

young knoll
#

Is this an issue you have brought up with viaversion

wary harness
lost matrix
wary harness
#

that is what u are saying

lost matrix
#

If the packets reach ViaVersion first then ProtocolLib wont work, yes.

solar sable
#

or maybe a tutorial video?

lost matrix
wary harness
#

so u saying grabing packet my self

#

editing it

#

or blocking

#

it

#

could u point me to some good example xd

lost matrix
spice hornet
solar sable
lost matrix
spice hornet
#

Epic

young knoll
#

It's actually not too complicated

#

Thankfully

quaint mantle
#

hello spigotites, im wondering how to spawn a firework as FireworkEffect.Type.BALL_LARGE ?

young knoll
#

Get it's meta and then add a new FireworkEffect

quaint mantle
#

issueee

young knoll
#

Use FireworkEffect.Builder

spice hornet
#

This will return a FireworkEffect, not just a FireworkEffect.Type

young knoll
#

new FireworkEffect.builder().with(type).build()

#

Something like that

quaint mantle
#

ahhhhahhhbruh

#

im an idiot

dry pike
#

Quick question for you guys, Is it nessicarry to run almost everything async? If there are tons of things going on in the server for example I have lots of NPC's and do tons of logic and ai checks and pathfinding operations, that stuff will be async, but even the small things being async would keep the server pretty much lag free with the exception of normal operations of the server?

Something as simple as this even though it hardly uses resources but is ran across hundreds of npc's every couple seconds.

                    NPCStuckController.this.isStuck = true;
                    ++NPCStuckController.this.beenStuckCount;
                } else {
                    NPCStuckController.this.lastPosition = npc.getEntity().getLocation();
                    NPCStuckController.this.reset();
                }```
young knoll
#

If you can run it async without it being a massive headache then it's probably worth it

dry pike
halcyon mica
#

Can someone explain to me why this is not reliably working when a player is crouching off a block?

#
private BlockPos getNonFloating(Entity entity) {
        BlockPos standingBlock = entity.blockPosition().c(0, -1, 0);
        if(entity.level.getBlockState(standingBlock).getBlock() == Blocks.AIR) {
            System.out.println("Air!");
            AABB bb = entity.getBoundingBox();
            if(isColliding(bb, standingBlock.c(0, 0, 1)))
                return standingBlock.c(0, 0, 1);
            else if(isColliding(bb, standingBlock.c(0, 0, -1)))
                return standingBlock.c(0, 0, -1);
            else if(isColliding(bb, standingBlock.c(1, 0, 0)))
                return standingBlock.c(1, 0, 0);
            else if(isColliding(bb, standingBlock.c(-1, 0, 0)))
                return standingBlock.c(-1, 0, 0);
            else if(isColliding(bb, standingBlock.c(1, 0, 1)))
                return standingBlock.c(1, 0, 1);
            else if(isColliding(bb, standingBlock.c(1, 0, -1)))
                return standingBlock.c(1, 0, -1);
            else if(isColliding(bb, standingBlock.c(-1, 0, 1)))
                return standingBlock.c(-1, 0, 1);
            else if(isColliding(bb, standingBlock.c(-1, 0, -1)))
                return standingBlock.c(-1, 0, -1);

        }
        return entity.blockPosition();
    }

    private boolean isColliding(AABB bb, BlockPos pos) {
        return bb.minX <= pos.getX() + 1 && bb.maxX >= pos.getX() &&
                bb.minZ <= pos.getZ() + 1 && bb.maxZ >= pos.getZ();
    }```
golden turret
#

the interact event is being called twice

quaint mantle
#

one for each hand

golden turret
#

a

#

thanks

oblique flax
#

What would be the best storage option for an economy plugin?

#

Modify the database on every transaction or create a caching system?

ivory sleet
#

Could do both

#

You have the cache, however you could queue the database after every write maybe?

#

and the cache would mainly be for reading then

oblique flax
#

So use both to save data on every transaction and cache to read?

ivory sleet
#

I’d say in short
on connect -> read from database and put dto in cache

on read -> read from cache or query database if no dto was found in cache

on write -> write to dto and query database write

on disconnect -> save dto to database and remove from cache

golden turret
#

or you can use a cache

#

and each 5 minutes send the updates to the database

ivory sleet
#

As long as the database calls are async you can in principle avoid using a sync buffer of some sort and write directly and read as mentioned previously.

oblique flax
#

I'm going to use both as he said

#

Thank you both ❤️

ivory sleet
#

You really dont need that sync buffer

#

as said just save whenever you write to ur dto

#

(dto, data transfer object)

carmine nacelle
#

InventoryOpenEvent may only be trigger synchronously

oblique flax
#

Yeah I got it

carmine nacelle
#

🤔

ivory sleet
#

that message is self explanatory, innit?

carmine nacelle
#

Eh.

#

not really. Im trying to open it inside of a ProtocolLib listener.

ivory sleet
#

Yes

#

makes sense

carmine nacelle
#

so how do I get around it..?

#

never really worked with sync/async much.

ivory sleet
#

Bukkit.getScheduler().runTask(plugin, () -> {
//Open here
});

carmine nacelle
#

Oh.

#

fr?

ivory sleet
#

yeah

carmine nacelle
ivory sleet
dry pike
golden turret
shadow tide
#

This code doesn't ban the player when executedjava if (entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() <= 2) { Plugin.getPlugin().getServer().dispatchCommand(Plugin.getPlugin().getServer().getConsoleSender(), "ban " + entityUUID + "message"); }

young knoll
#

Don't do that

quaint mantle
#

it returns void iirc

dry pike
shadow tide
#

i'm pretty sure lambda variables need to be final

#

or smth like that

quaint mantle
#

hasMoved is the lambda param

golden turret
quaint mantle
golden turret
#

a

shadow tide
#

is there something wrong with it being depricated?

golden turret
#

yes and no

young knoll
#

It means you shouldn't use it

shadow tide
#

y

quaint mantle
#

magic values ig

shadow tide
#

huh

young knoll
#

I think it just wraps the new method

#

But still

golden turret
#

yes: soon it will be deleted
no: you can use now :D

shadow tide
#

yay

young knoll
#

I don't know about soon

shadow tide
#

how do I ban I player, because I find that executing a command from the console inefficient

young knoll
#

?jd

dry pike
#

player.banPlayer("Your a troll!")

ancient plank
#

you're

quaint mantle
#

Y'roue*

golden turret
#

ur

proud basin
#

yur

lavish hemlock
#

u

golden turret
#

_ _

quaint mantle
#

||
||

gray saffron
#

Ello

shadow tide
#

does this return the max health? java entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()

quaint mantle
#

nah it returns mcdonalds

shadow tide
#

lol

#

just answer me

gray saffron
#

Hey I am using 1.16.5 version of mc but covid 19 plugin is doesn't working for me...

shadow tide
#

lol

#

thats offensive its programmers

#

lol

#

I think @gray saffron 's question should go in the dev's official server, not here lol

gray saffron
#

Where is it?

shadow tide
#

who is the developer of the covid 19 plugin?

ancient plank
#

plugins are not mods 👍

gray saffron
shadow tide
#

when using java Plugin.getPlugin().getServer().getBanList(null).addBan();what do I put in getBanList() and how do I use a UUID for addBan()?

quaint mantle
#

read the docs

shadow tide
#

I did, they don't answer either of those questions

ancient plank
#

read harder

shadow tide
#

lol

lavish hemlock
#

either BanList.Type.IP or BanList.Type.NAME

#

the former is for banned IP addresses, the latter is banned names

shadow tide
#

how

#

lol

#

sorry

#

@lavish hemlock

#

only got 15min

late stone
#

Is it possible to run plugins in a single player world? Cause my PC doesn't work at its best when I'm running a server with minecraft open and Intellij running in the background

young knoll
#

No

young knoll
carmine nacelle
#
holos:
  Test:
    location: world, -337.9180889181425, 72.0, -446.26819453769014
    owner: e42b60b0-c35a-462f-a2b4-b1a9980f399e
    lines:
    - '&cTest 1'
    - '&cTest 2'
    - '&cTest 3'
    - '&cTest 4'

If I wanted to, is there an easy way to change "Test", or should I change my config format to a list, and move "Test" to a variable

young knoll
#

I think you can use getSection to get the entire test section

#

And then .set with your new key

carmine nacelle
#

Wouldn't it just write a new one instead of overwriting this one though?

young knoll
#

You can set that one to null

sharp kelp
#

Which event value to check in playerinteractevent to get when player drinks water from the default minecraft water bottle?

drowsy helm
#

use PlayerConsumeItemEvent

sharp kelp
#

Oh okay

#
public static ItemStack WaterBottle() {
  ItemStack item = new ItemStack(Material.GLASS_BOTTLE, 1);
  ItemMeta meta = item.getItemMeta();
  meta.setDisplayName("§7Flint Axe");
  meta.setCustomModelData(1);
  item.setItemMeta(meta);
  return item;
}
#

How to set the value of bottle to water

#

Like in a give command in game

#

we can set minecraft:glass_bottle{potion:water} or something like that if I remember correct

#

How to do same for the itemstack

young knoll
#

PotionMeta iirc

#

Although Material.POTION probably defaults to a water bottle

worldly ingot
#

Was just going to say that, yeah

#

It defaults to a water bottle

sharp kelp
#

Like we use ItemMeta Is PotionMeta there too?

young knoll
#

mhm

sharp kelp
#

@young knoll Is this how one adds potion meta?
PotionMeta pmeta = (PotionMeta) item.getItemMeta();

young knoll
#

mhm

sharp kelp
#

mhm is yes?

#

coll

#

pmeta.setBasePotionData();

#

How can one use this?

#

wait nvm I forgot about google

quaint mantle
#
public static List<Block> getSphere(Location loc, boolean hollow, int radius, int height){
        List<Block> blocks = new ArrayList<Block>();
        
        int bx = loc.getBlockX();
        int by = loc.getBlockY();
        int bz = loc.getBlockZ();

        for(int x = bx - radius; x <= bx + radius; x++){
            for(int y = by - height; y <= by + height; y++){
                for(int z = bz - radius; z <= bz + radius; z++){
                    double distance = ((bx-x) * (bx-x) + ((bz-z) * (bz-z)) + ((by-y) * (by-y)));                    
                    if(distance < height * radius && !(hollow && distance < ((height - 1) * (radius - 1)))) blocks.add(new Location(loc.getWorld(), x, y, z).getBlock());
                }
            }
        }
        return blocks;
    }
#

im terrible at math

#

m pretty bad especially at fcomplicated things like this

#

i got this code off of some spoonfeed spigot thread

#

modifeid it a tiny bit, not quite sure what im doing wrong.....

#

i added "int height" to it, and it didnt really seem to effect anything that is going wrong

#

so here's a screenshot of what happens if i generate a sphere of radius 15, height 5

#

so as you can see, im 99% sure it has something to do with the if(distance < height * radius && !(hollow && distance < ((height - 1) * (radius - 1)))) code

#

im just not sure what to modify 💀

#

please ping in a reply, if needed i might even make this a thread tbh

sharp kelp
#

Cant find anyway on google either... nor any bukkit or spigot docs for a guide...

quaint mantle
#

I'm using async to pull data from the database

#

to pull cached data from the hashmap is it necessary to use async too?

young knoll
#

Map access is very fast

#

So no

sharp kelp
#

I need tutorial or help on how to set type of potion

#

Like I want to set the potion type to water

quaint mantle
tacit drift
#

wait what

#

nvm

#

It gets the height from the middle?

#

and calculates it up and down?

quaint mantle
#

idk

#

i didnt make the code

#

i just editted it

#

the original code only had radius

tacit drift
#

Seems like it is doing that

#

lolz

quaint mantle
#

sso are you going to provide any help

#

or just comment about code wthat isnt mine

#

and seemingly (maybe) disrespect it.... without any explanation?

tacit drift
#

I made an observation only

quaint mantle
#

ok

#

so

#

please only try to help

marble rivet
#

I made a bungeecord command and whenever i try to forcefully make a player run it using player.performCommand(), it just says unknown command

quaint mantle
#

please read that

marble rivet
#

the command works if i type it manually

quaint mantle
#

duh

carmine nacelle
#

Hey, so what would be the best way to flip an armorstand's head across the x axis? basically need it flipped 180 degrees so the nametag will be more in the center of the body, as opposed to above it

#

with protocollib ^

#

I know I could also just send a packet to rotate the head but id prefer to do it with the watcher
edit: I tried using this

metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(16, WrappedDataWatcher.Registry.get(Rotation.class)), Rotation.FLIPPED);

and it's giving me an error that there was no serializer found for Rotation.class, which WOULD work if I knew what serializer to use possibly, according to this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Rotation.html

sharp kelp
quaint mantle
#

t

#

@carmine nacelle
Just an unnecessary ping, but the trouble that we got yesterday, actually because of the check world 😂 Everything working fine, but somehow the check world don't work, so they can't put the key and value into the treemap. This is the needed code for it to work lol:

        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations").getKeys(false)) {
            sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
        }
        e.setRespawnLocation(locationsData.getCustomConfig().getLocation("locations." + sorteddistance.values().toArray()[0].toString()));
        sorteddistance.clear();```
Anyways, *now i need a way to check the world without make this whole code dead.*
quaint mantle
#

Wait, i think i have another way

#

instead of using the locations section for all the loc

carmine nacelle
#

Well, why doesnt the world check work? That should be super simple.

quaint mantle
#

i will use the world name as the section

carmine nacelle
#

I guess you could but it doesnt matter.

#

can work either way.

quaint mantle
#

i try like 3 code

#

but nothing work

#

😹

carmine nacelle
#
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations").getKeys(false)) {
            sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
        }

print the values of locationName to console.

quaint mantle
#

?

#

wat do u mean? i already did that

#

to ensure everything works fine

carmine nacelle
#

do it again

#

so i can see

quaint mantle
carmine nacelle
#

its not hard

quaint mantle
#
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations").getKeys(false)) {
                sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
        }
        System.out.println(sorteddistance.values().toArray()[0].toString());
        sorteddistance.clear();```
carmine nacelle
#

No

#

print it inside the for loop.

#

literally put

quaint mantle
#

oh ok

carmine nacelle
#

System.out.println(locationName);

quaint mantle
#
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations").getKeys(false)) {
            sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
            System.out.println(locationName);
        }```
carmine nacelle
#

put the print before the other just in case the other line errors it will still print

#

print before the sorteddistance (should be sortedDistance btw)

quaint mantle
#

lol

#

[INFO] .... Firminus issued server command: /setspawn Firminus2

[INFO] .... Firminus issued server command: /kill

[INFO] .... Firminus fell out of the world

[INFO] .... [Firminus: Killed Firminus]
[INFO] .... Firminus
[INFO] .... Firminus2```
carmine nacelle
#

ok so it's printing that part correctly

#

so..what is the name of the world you're in

quaint mantle
#

world

#

👌

carmine nacelle
#

sooo...you're trying to check if world = Ferminus

#

🤔

quaint mantle
#

nope. btw i gtg eat lol

carmine nacelle
#

of course they're not gonna match, its 2 different strings

#

console errors would be cool

lean gull
#
    public static TextComponent textWithHover(String text, List<String> hoverText) {
        TextComponent textWithHoverVariable = new TextComponent(text);
        textWithHoverVariable.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(hoverText)));
        return textWithHoverVariable;
    }```
https://i.imgur.com/VFAuXE8.png
#

help please

sullen marlin
#

Missing hover.content.Text import

#

Also use ConponentBuilder, much easier

lean gull
#

what that

sullen marlin
#

An easier class for making messages

lean gull
sullen marlin
#

Anyway you're just missing an import

#

Yes

lean gull
#

alr thx i'll use dat then

#

it doesn't say how to make hoverable messages

sullen marlin
#

Your original code is fine

#

Just add the correct import

#

Your ide should suggest it

lean gull
#

but you just said to use conponentbuilder

#

only the util one but then the hoverText has a red line below it

quaint mantle
#

world is the name of the world

carmine nacelle
#

hey md_5, I dont wanna @ you but if you happen to see this, how could I flip my armorstand's head with ProtocolLib?

metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(16, WrappedDataWatcher.Registry.getVectorSerializer()), new Vector(0, -180, 0));

can't figure it out

sullen marlin
#

List is java.util

#

You might want to learn more java if you're struggling with a List

lean gull
#

the list should work fine, it's just not working in the setHoverEvent

quaint mantle
lean gull
#

also i don't see that import you said

quaint mantle
#

i use p.getWorld().getName()

sullen marlin
#

It's not working cause it's not imported

carmine nacelle
#

@quaint mantle Print the result of world

lean gull
#

where is it even supposed to be imported

sullen marlin
#

The import is in your screenshot

#

In the class

lean gull
#

h u h

#

there's no import button

carmine nacelle
#

@lean gull The third List (java.util) is the one you'd want.

sullen marlin
#

Your last screenshot had import suggestions

lean gull
#

it did not

#

wait no nvm

carmine nacelle
#

yes it did lol

lean gull
#

i was thinking about the last last one

carmine nacelle
#

hover over it or press Alt + Enter to print it back up

quaint mantle
#
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations").getKeys(false)) {
            System.out.println(p.getWorld().getName());
            System.out.println(locationsData.getCustomConfig().getString("locations." + locationName + ".world"));
            sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
        }
        sorteddistance.clear();```
solid cargo
#

alt+enter best friend!

sullen marlin
#

@carmine nacelle idk because my answer would be to use the API

lean gull
#

so i need to import java.util right

carmine nacelle
carmine nacelle
lean gull
carmine nacelle
lean gull
#

the one from the first screenshot

carmine nacelle
#

oh

#

im slow

sullen marlin
carmine nacelle
#

ok what are the results of the print

carmine nacelle
quaint mantle
solar sable
quaint mantle
# carmine nacelle ok what are the results of the print

man...

[INFO] .... Firminus issued server command: /setspawn Firminus
[INFO] .... Firminus issued server command: /setspawn Firminus2
[INFO] .... Firminus issued server command: /kill
[INFO] .... Firminus fell out of the world
[INFO] .... [Firminus: Killed Firminus]
[INFO] .... null
[INFO] .... world
[INFO] .... null
[INFO] .... world
[INFO] .... null```
#

why null huh

sullen marlin
#

Well do you actually have any code to update the scoreboard

carmine nacelle
solar sable
#

please explain it in the forum please, i am new to this

#

or here is fine

quaint mantle
#
  Firminus:
    ==: org.bukkit.Location
    world: world```
i think this is locations.Firminus.world
carmine nacelle
#

You're serializing locations, then trying to get the string from it

quaint mantle
#

uhhh

carmine nacelle
#

just get the location from the config, then call #getWorld()#getName()

quaint mantle
#

oh ok pog

#

lol

sullen marlin
#

At the very least you need to call showScoreboard on a timer

solar sable
#

can you give me example?

carmine nacelle
#

@quaint mantle ```java
Location location = cadiaCore.hologramConfig.getHoloConfig().getLocation("locations" + "." + locationName); // Gets the location
String worldName = location.getWorld().getName();

Something like that 😄
carmine nacelle
#

make null checks and stuff ofc

quaint mantle
#
            System.out.println(p.getWorld().getName());
            System.out.println(locationsData.getCustomConfig().getLocation("locations." + locationName).getWorld().getName());```
lean gull
#

can someone help please

sullen marlin
#

Look up the scheduler API for how to use timers

quaint mantle
#

@sullen marlin can you add me as a friend as a flex 💪🏽 ❤️

#

i still prefer the println for quick debug

carmine nacelle
#

I always use broadcast

#

personal pref.

solar sable
#

why do i feel like i know the name md_5 hmmm

carmine nacelle
#

or logger

tacit drift
#

Orange Slime Guy 🤪

carmine nacelle
solar sable
#

thats why his name is familiar lo

quaint mantle
solar sable
#

lol*

tacit drift
#

maybe you heard about md5

carmine nacelle
#

I hear he makes good hash

#

😅

tacit drift
#

🤪 🤪 🤪

solar sable
#

well i still need an example of the code and i think md_5 is either doing the code or something else

carmine nacelle
#

he's a busy guy

solar sable
#

true

carmine nacelle
#

im surprised hes active in here, lowkey kinda fangirling ngl

solar sable
quaint mantle
carmine nacelle
quaint mantle
carmine nacelle
#

sick

#

gg

quaint mantle
#

hmmmm

#

gg man

solid cargo
#

wow

#

gg

quaint mantle
#

thanks for helping lol

solar sable
#

gg

carmine nacelle
#

np

solar sable
#

nice job

solid cargo
#

insporational

quaint mantle
#

it took me 4d 😂

lean gull
#

please someone i require help

quaint mantle
#

for some 6 codes

solid cargo
solar sable
carmine nacelle
#

make sure to run checks to make sure the world isn't null before trying to get data from it

lean gull
#

me three

solid cargo
quaint mantle
#

the things that surpised me alot that adding another section of locations work

lean gull
#

nein!

carmine nacelle
#

yeah, crazy

quaint mantle
#

lol

quaint mantle
lean gull
#

twanty oen

carmine nacelle
#

you can't loop through something that doesn't have a key

solar sable
#

guys anyone can help?

carmine nacelle
#

you didnt have a key

solar sable
lean gull
#

we will rock u moosic
we need! we need help please! help please!

#

yes we need, we need, help please!

solar sable
#

iderpy chill lmao

lean gull
#

k sory

carmine nacelle
#

ok well ill try to.

#

@solar sable whats ur issue

solar sable
#

this is my issue rn

carmine nacelle
#

why is your showScoreboard() static REEE

lean gull
#

use spaces on striketrhough

#

instead of dashes

solar sable
#

hm?

solar sable
lean gull
#

~~ ~~ vs ----

carmine nacelle
#

It's not going to update because you aren't calling for it to be updated.

solar sable
#

oh

#

well how to call to update?

carmine nacelle
#

you are creating it, assigning it then never updating it.

#

?scheduling

undone axleBOT
lean gull
#

you didn't write this did you

carmine nacelle
#

that ^

solar sable
#

okay then

carmine nacelle
#

ok @lean gull and ur issue is..

solar sable
#

how to add it?

carmine nacelle
#

what's the issue

lean gull
#

look at screenshot

quaint mantle
#

Okay man, the spawn at nearest location has done! Now gotta work to the soul points...

solar sable
#

like what is the thing that i need to add

carmine nacelle
#

do the suggestion it says

solar sable
#

which one

#

theres so manyu

carmine nacelle
#

@lean gull

solar sable
#

many*

lean gull
#

it gives a string.valueof

carmine nacelle
#

Yeah

lean gull
#

are u sure it'll work with a list?

carmine nacelle
#

The string value of a list?

#

It'll print, yeah but it'll print a bunch of nonsense that you can't really work with.

lean gull
#

soo what do i do

solar sable
#

@carmine nacelle

scheduler.runTaskAsynchronously(...);
``` is this the one?
carmine nacelle
solar sable
#

and where i put it?

carmine nacelle
#

In this episode, I show you how to create and schedule tasks with Spigot Plugins. #Spigot #MinecraftPluginDevelopment

Reference: https://bukkit.gamepedia.com/Scheduler_Programming

Stay Updated!! 👁
Discord: https://rebrand.ly/discordlink
Twitter: https://twitter.com/kodysimp
More Videos coming soon.
Leave a comment for any future video suggest...

▶ Play video
#

this guy has great tutorial videos.

carmine nacelle
# lean gull soo what do i do

Hover and click on all the messages you want! Learn how to code and use TextComponent and more :)

------ Links ------

Download Eclipse: https://www.eclipse.org/downloads/packages/release/2019-03/r/eclipse-ide-java-developers

Download Spigot: https://getbukkit.org/download/spigot

Build Spigot: https://www.spigotmc.org/wiki/buildtools/

Starti...

▶ Play video
lean gull
#

im quite sure this is where i got this from

carmine nacelle
#

he uses ComponentBuilders, which you arent

#

If it is where you got it from, you didn't watch the entire video

lean gull
#

idk where i got this from then ig idk

#

anyways what do i do

carmine nacelle
#

watch the video

solar sable
#

@carmine nacelle is that where i am supposed to add the bukkitrunnable?

carmine nacelle
solar sable
#

so inside the scoreboard code?

carmine nacelle
#

make a void called like..updateScoreboard(Player player)

solar sable
#

ijay

#

okay*

lean gull
carmine nacelle
#

you can't just skip through the video and expect to understand it

#

watch the whole video, he does a great job explaining

solar sable
#

@carmine nacelle like this?

lean gull
#

ok please just stop helping, thanks

carmine nacelle
lean gull
#

can anybody else help?

carmine nacelle
#

?learnjava

undone axleBOT
lean gull
#

what did i just say

carmine nacelle
#

😂

lean gull
#

unfunny

#

stop helping

carmine nacelle
#

anyone wanna spoonfeed iDerpy..? anyone..?

lean gull
#

don't wanna be spoonfed

#

i'm just sayin all you've done so far is very basic

#

and it didn't help

carmine nacelle
#

I literally linked you an in-depth video on how to accomplish what you are trying to do.

#

lol

#

but ok

lean gull
#

i can search on youtube too

#

such good help

carmine nacelle
#

apparently not..but alrighty :p

lean gull
#

and also, ya wrong, it does not help me accomplish what i'm trying to do

#

i just told you i looked at the code and you can clearly see he only has one line in the hover event

carmine nacelle
#

Why do you need more than 1 line

lean gull
#

why are you asking dumb questions

#

clown emoji, such ironic

quaint mantle
#

Hey vivian i wonder if comparing world object or string is faster

solid cargo
#

hey guys!

quaint mantle
#

@carmine nacelle

carmine nacelle
#

welcome to the clown band

quaint mantle
# carmine nacelle welcome to the clown band

Xin chào bạn, tôi là nhà tuyển dụng của tập đoàn giải trí Rạp xiếc Trung Ương Group. Trong quá trình tìm kiếm và đào tạo những người hài hước của chúng tôi (đi săn chất xám và nhân tài) tôi nhận thấy bạn là người có khiếu hài hước, tập đoàn chúng tôi thật sự cần một chú hề đúng nghĩa, tôi đã thấy bạn vừa mở mồm là mọi người đã cười ầm lên, không cần phải biểu diễn. Đặc biệt đối với chúng tôi thì những vị trí lãnh đạo rạp xiếc cấp cao phải tìm người "có tâm, có tầm" Một môi trương cua nhung thien tai he, xung quanh ban la nhung nhan vat: cha đe cua tieng cuoi, nha khoa hoc he, chua he đia phuong, bait đo te, chua te rap xiet Moi truong lam viec nang đong, hai huoc

https://i.ibb.co/k5MVfWC/image.png

solid cargo
#

years ago, i was chinese

quaint mantle
#

Hello everyone, I'm an employer of Clown Band entertainment corporation. In the process of finding and training our humor people (hunting new talent), I found out that you have a great sense of humor, our corporation needs a true clown. I have seen you only need to open your mouth to make people laugh, don't even need to perform anything. Especially with us, to find right the senior circus leadership position, we need a clown that "have a mind and a vision". A great place for the genius clown, surrounding you is: the dad of the laugh, the clown science, baiter god,...

https://i.ibb.co/k5MVfWC/image.png

idle cove
#

what is the event for player moving item to another storage (chest, shulker, furnace, etc

carmine nacelle
idle cove
#

Ok

#

thanks

wispy plume
#

Hey, how can I make armour stand holograms clickable thru?

chrome beacon
#

Try the marker tag

wispy plume
#

I’ll try, ty

carmine nacelle
#

@chrome beacon heyyy, so any idea how to flip the armorstand's head with ProtocolLib?

chrome beacon
#

The Entity head rotation packet maybe

#

Or some how send the nbt

carmine nacelle
#
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(16, WrappedDataWatcher.Registry.getVectorSerializer()), new Vector(0, -180, 0));
#

I'm trying to do it with the datawatcher

chrome beacon
#

Ah

#

Use the EntityMeta data packet

chrome beacon
chrome beacon
carmine nacelle
# chrome beacon Use the EntityMeta data packet

I'm trying to :p

    public void setupHolo(Player player, Hologram hologram) {
        for(int curHoloLine = 0; curHoloLine < hologram.getHoloLines().size(); curHoloLine++) {
            PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);

            Optional<?> opt = Optional.of(WrappedChatComponent.fromChatMessage(hologram.getHoloLines().get(curHoloLine))[0].getHandle());

            WrappedDataWatcher metadata = new WrappedDataWatcher();
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)), opt);
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x01 | 0x08));
            metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(16, WrappedDataWatcher.Registry.getVectorSerializer()), new Vector(0, -180, 0)); // Line in quesetion

            packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());

            packet.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));

            try {
                protocolManager.sendServerPacket(player, packet);
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }
        }
    }
neon nymph
#

Is this for block breaking tools or fighting?

#

Is the issue only when the tool has no unbreaking?

chrome beacon
idle cove
#

what does .getI18NDisplayName do? I cant find it in the spigot docs.

carmine nacelle
#

I'm already using ProtocolLib for all of my other things :/ ill make a thread, thx

chrome beacon
#

You need to set the Itemeta back again

neon nymph
#

What's your goal here, is it to have some custom durability reduction thingy?

#

Nice

chrome beacon
neon nymph
#

You might also wanna put a break; in your case 2 there

idle cove
#

oh ok

#

does inventoryclickevent also check for shift clicks?

neon nymph
#

Do a check for clicktype

#

ClickType has both shift left and right

idle cove
#

i just want it do do for either

chrome beacon
sharp kelp
# chrome beacon You've already been awnsered

No. the answer coll gave is not what I ment... coll gave me the answer to How to set custom effects to a custom potion itemstack but I wanted answer for how to set potion type in a potionmeta

neon nymph
#

Not sure if htere's a general SHIFT_CLICK enum, but if theres none, just use an or condition

idle cove
#

I tried InventoryDragEvent but did not know how to get the item as with InventoryClickEvent it can just do .getCurrentItem()

chrome beacon
#

Actually never mind

#

Use setBasePotionData

#

@sharp kelp ^^

neon nymph
#
ItemStack potion = new ItemStack(Material.POTION);
PotionMeta pmeta = (PotionMeta) potion.getItemMeta();
pmeta.setBasePotionData(new PotionData(PotionType.FIRE_RESISTANCE));
potion.setItemMeta(pmeta);

Is this it? Did not try it for myself

chrome beacon
#

Yeah that's it

#

Never worked with Potions before almost missed the setBasePotionData in javadocs

sharp kelp
#

YES

#

I was trying to find how to set the type

#

I thought it was POTION which was not working but its PotionType

#

thanks so much

neon nymph
#

javadocs is your friend

idle cove
#

When i build and use the plugin it keeps saying this :
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.getDisplayName()" because the return value of "org.bukkit.inventory.ItemStack.getItemMeta()" How can i fix this, I dont even know why it is null.

neon nymph
#

tool.setItemMeta(meta);

#

Oh then yeah, since you made the changes in that meta

#

Why do you even have the ItemMeta meta in there tho lol

#

Nice, I have that habit too. Really gotta tidy up my codes

steady smelt
#

Anyone know about right click detection and raycasting?
I have not made anything but want to make:
every stick make particles on right click for 10 blocks
(I am new to spigot, came from datapacks)

#

any examples? (ping me)

opal juniper
#

PlayerInteractEvent == for detecting the click

There are methods under world and Player iirc for ray casting

carmine nacelle
opal juniper
#

sure ig lol

carmine nacelle
#

sick

opal juniper
#

how to compile spigot server with custom patches?

chrome beacon
#

Spigot or Paper

opal juniper
#

spigot - paper is easy

#

idk how to do spigot tho

chrome beacon
opal juniper
#

epic

#

thanks

idle cove
#

How would i stop the player from moving a specific item by checking for the display name of the item to another storage (chest, shulker, etc) but still allow them to move it in their inventory?

#

I know it is InvetoryClickEvent

#

And i know how to cancel it

#

but

#

the problem is when i check for the displayname

#

it keeps saying the itemmeta is null

carmine nacelle
#

check if it has item meta before checking the item meta.

idle cove
#

It does

carmine nacelle
#

check if it has a displayname before checking the displayname

#

im saying in code

#

make sure you arent checking what the meta IS before checking if it even HAS it

idle cove
#

yeah

#

ik

#

it does

carmine nacelle
#

ok, then you wont get nulls

idle cove
#

but i am

carmine nacelle
#

code?

idle cove
#

ok

neon nymph
idle cove
#

oh no

#

i have this item

#

it gives the player a set

#

for 15 sdeconds

#

that part works

#

but i dont want them to move it into a chest

#

and keep it

#

i can stop them from dropping

#

but the moving into a chest or smt is the problem

carmine nacelle
#

still waiting for the code where you check the meta

idle cove
#

breh

neon nymph
#

Oh, then you could do some magic with the getTopInventory and getBottomInventory from the InventoryView class

idle cove
#

i just closed it by accident

#

one second

#

lemme send code

#

ignore the Objects.RequireNotnull part

#

without that i still get the same error

carmine nacelle
#

what line is the error on

#

you aren't checking if it has item meta

quaint mantle
#

im trying to prevent players for enchanting, disenchanting and ..... custom items, but this is not working and it is cancelling the event when i try to move the item when it is in the disenchanting or... slot

carmine nacelle
#

#currentItem().HASITEMMETA

idle cove
#

do i have to even though i know it definatly does have an itemmeta?

carmine nacelle
#

Does an empty inventory slot have item meta?

idle cove
#

oh

#

right

#

that makes sense

#

ok thanks

carmine nacelle
#

and

#

is an empty inventory slot an item?

#

need null checks

quaint mantle
carmine nacelle
#

if the item is null, return

#

if the material is air, return

#

if it doesnt have item meta, return

#

if it has item meta, but not a displayname, return

quaint mantle
idle cove
#

k thank you

vernal pier
#

Is it safe to send packets async or do I need to put in a runTask(

carmine nacelle
#

np

quaint mantle
#

i guess packets ARE async

vernal pier
#

Ok thanks

neon nymph
carmine nacelle
#

No..

quaint mantle
#

how can I make sure that if an event is executed twice, it is executed 1 time? there is a code, but it only works 1 time

#

private int everyOther = 0;

@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
    if (everyOther % 2 == 0) {
        everyOther++;
neon nymph
#

Or maybe not all of it

carmine nacelle
#

just because the item isn't null doesnt mean it has item meta and a displayname.

neon nymph
#

But don't every itemstack have an itemmeta?

carmine nacelle
#

no

#

metadata maybe, not itemmeta

neon nymph
#

Oh

#

What are instances where an itemstack returns its getItemMeta() as null?

#

if (event.getCurrentItem() == null || !event.getCurrentItem().getItemMeta().hasDisplayName()) return; This works fine for me

carmine nacelle
#

yea that works fine

#

just better to be safe, hasItemMeta must exist for a reason, so.

#

I guess ItemMeta cant be null on anything except a null item/air

#

its just unspecific

neon nymph
#

Well, true. Never hurts to be too careful

carmine nacelle
#

and cant get values from unspecific data

idle cove
#

thank you vivian

carmine nacelle
#

np

idle cove
#

the only problem now is that they cant move it in their inventory

carmine nacelle
#

why not

idle cove
#

i just want them to not move it in a chest or other storages like that

carmine nacelle
#

well

#

see if the clicked inventory is the top or bottom inventory

#

cancel/not accordingly

#

top is always gonna be a chest or whatever, bottom is player inventory

idle cove
#

ok thahks

carmine nacelle
#

np

vernal pier
#

Is there a way to set a command’s usage to a component

carmine nacelle
#

a who what

vernal pier
#

You know adventure text components

carmine nacelle
#

like you want it to show how to use the command when hovering over something in chat..? or

vernal pier
#

command.setUsage( requires a string

#

I want to put in a component though

#

Is that not possible

chrome beacon
#

You would have to send your own message

carmine nacelle
#

@chrome beacon Do you know if it's possible to use a Switch with something like...

                switch(clickedItem.getItemMeta().getDisplayName()){
                    case ChatColor.YELLOW + "Test":
                        break;
                }
#

Any way to bypass the "Constant expression required"?

#

switch > if if if if if if

vernal pier
#

If I want to put in Color codes do I just use the ChatColor strings

quaint mantle
#

if i want to make a hologram plugin, when should i send the armor stand packet to the player ?

carmine nacelle
quaint mantle
carmine nacelle
#

I sent it once it's created, then i send it to the player when they join, and to all players online at onEnable

#

and I send it once its updated through my gui and many other times

#

my system is pretty complex

quaint mantle
#

ok so when a player switches the world, should i send the holo again ?

carmine nacelle
#

im not sure if switching worlds unloads them or not.

#

they're packets, not actual entities so its not like they despawn.

quaint mantle
#

i will try i guess

#

and i have another question

#

the y coordinate

#

how much should i decrease for each hologram

carmine nacelle
#

0.25 is what I use

#

looks like this

chrome beacon
carmine nacelle
chrome beacon
#

Add it directly to the string

#

Instead of using chat color constant

carmine nacelle
#

er...

#

you mean with &?

chrome beacon
#

That or the other symbole

carmine nacelle
#

The § is bad practice

chrome beacon
#

Depends on how youre getting the string

chrome beacon
carmine nacelle
#

Yeah, but it can cause issues supposedly

opal juniper
#

uh

#

i’m not sure about that mate

#

lol

carmine nacelle
#

Literally every post on Spigot where the person is using the symbol, they get told to use ChatColor instead.

opal juniper
#

yes because it provides cross version support, it is more readable etc etc

#

not because it will actually cause issues afaik

carmine nacelle
opal juniper
#

looks like what i said

carmine nacelle
#

missed one

maiden briar
#

Am I still be able to edit the scoreboard after I did player.setScoreboard(this.scoreboard); ?

carmine nacelle
maiden briar
#

So I can only do player.getScoreboard() and then edit it further??

carmine nacelle
#

correct

maiden briar
#

Resetting will cause flicker

#

Ok thx

carmine nacelle
#

well, yeah thats the main issue with scoreboards

#

theres ways to make them not flicker

#

ive never really used them but there's ways you could probably find on the forums

maiden briar
#

Yes I know

#

They do it with team prefixes

#

But I still have to use the method mentioned above

carmine nacelle
#

whatever works for u man

maiden briar
#

I will test it out

carmine nacelle
#

gl

maiden briar
#

Thx

steady rapids
#

can anyone give me a method to save and one to load objects from a file?

#

i have an array of Sign objects that need to be saved and loaded

#

actually, the save part is working, what I need is to load them back

lost matrix
steady rapids
#
        for (RecipeSign sign : signs) {
            this.getConfig().set(sign.getName(), sign);
        }
    }
```i
public void loadSigns(){
    for (String s : this.getConfig().getConfigurationSection().getKeys(false)){

    }
}
eternal oxide
#

RecipeSign?

steady rapids
#

    //list of 10 items: 1-9 are the recipes, 10 is the crafting result
    private List<Item> items = new ArrayList<>();

    private String name;

    private int posX;
    private int posY;
    private int posZ;

    public RecipeSign(int posX, int posY, int posZ) {
        this.posX = posX;
        this.posY = posY;
        this.posZ = posZ;
    }

    public List<Item> getItems() {
        return items;
    }

    public void setItems(List<Item> items) {
        this.items = items;
    }

    public int getPosX() {
        return posX;
    }

    public void setPosX(int posX) {
        this.posX = posX;
    }

    public int getPosY() {
        return posY;
    }

    public void setPosY(int posY) {
        this.posY = posY;
    }

    public int getPosZ() {
        return posZ;
    }

    public void setPosZ(int posZ) {
        this.posZ = posZ;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
lost matrix
wispy monolith
#

well, i want every message sent by a player to have a clickable text, how to do it?

lost matrix
steady rapids
wispy monolith
wispy monolith
#

that is sad

carmine nacelle
#

hes gonna be 7frown7 now

lost matrix
eternal oxide
#

7financiallyResponsible7

opal juniper
#

just no boosts

lost matrix
opal juniper
#

lol

wispy monolith
opal juniper
#

i got the free epic games nitro and then i got addicted to the higher file size & emojis

lost matrix
#

I have to react with this generic crap now...

opal juniper
#

ig you can leave a tonne of servers as well lol

#

cause you dont need them for emojis

wispy monolith
lost matrix
opal juniper
#

classic is a scam imo

#

wait

#

you can still use emojis everywhere then?

lost matrix
opal juniper
#

🤔

#

thats weird cause afaik there is no "Use external Emoji" permission node for nitro normal/classic

wispy monolith
#

u need to imagin the emoji

opal juniper
wispy monolith
#
  • what is the event to listen to Player sending a message in chat
opal juniper
#

PlayerChatEvent / AsyncPlayerChatEvent

wispy monolith
#

PlayerChatEvent?

opal juniper
#

use the async one unless you really dont want to

#

/ there is a reason not to

wispy monolith
#

what is it?

opal juniper
#

One is async, one isnt

#

lol

wispy monolith
#

what is ment by async?

opal juniper
#

Uh, its short for asynchronous, basically where things are done concurrently rather than blocking the main thread

#

im probably not the one to explain it lol

#

google is your friend

wispy monolith
#
  • a while a go i was making a command for a bungee server but when i make the player send /server using the plugin it shwos the unknown command error
#

why does this line shows this error

textCompanent.setClickEvent(ClickEvent.Action.RUN_COMMAND, "<command>");

the error:

'setClickEvent(net.md_5.bungee.api.chat.ClickEvent)' in 'net.md_5.bungee.api.chat.BaseComponent' cannot be applied to '(net.md_5.bungee.api.chat.ClickEvent.Action, java.lang.String)'
lost matrix
halcyon mica
#

Can you not cancel BlockRedstone events?

wispy monolith
#

oh i forgot the new

lost matrix
halcyon mica
#

Would that not power the block still?

lost matrix
#

Not sure.

halcyon mica
#

And also kill the redstone signal when it goes through the block

lost matrix
slim kernel
#

I know how to set a lore to a item but how can I make the words in the Lore be in separate lines?

lost matrix
quaint mantle
#

!paste

#

-paste

lost matrix
#

?paste

undone axleBOT
halcyon mica
lost matrix
halcyon mica
#

I want to disable noteblock interactions

#

You suggested setting the new current to 0

#

Which would disable any further redstone action through that block

lost matrix
#

You can cancel this event

halcyon mica
#

What about changing the note

opal juniper
#

rtfm

halcyon mica
#

That is not what I asked

#

changing the note via right click still updates the blockstate even when no note is played

lost matrix
#

PlayerInteractEvent is probably also worth visiting.

halcyon mica
#

PlayerInteractEvent seems to only target entities

#

BlockPhysicsEvent only when a block is modified by turning it into a falling block to, well, simulate physics

opal juniper
#

I have used it for clicking blocks & air before

lost matrix
halcyon mica
#

Hang on, no

#

Idea was having a stroke

#

It showed me the class outline for PlayerInteractEntityEvent while hovering over PlayerInteractEvent

lost matrix
#

F

halcyon mica
#

So how can I make it so that the block acts like a regular block

#

i.e. placing a torch on it works without crouching etc

lost matrix
#

Registering a packet listener that listens for outgoing chunk packets and modifies them could be one approach.
But this sounds like it should have a full fake block framework where you can define a server side and a client side
BlockState separately.

halcyon mica
#

Hm

#

Cancelling the interact event also cancels placing blocks on it while crouching

lost matrix
halcyon mica
#

Great suggestion, now the player can fuck with the blockstate while crouching

lost matrix
halcyon mica
#

Oh, I already solved that issue long ago

shadow tide
#

I didn't even realize buildtools makes a maven version of spigot, I should really switch now lol (I'm just using eclipse, not even gradle)

dull whale
#

I have an array of multiple data types, ive been using object[] so far but I wanna switch to that wrapper thing, and I pretty much dont know anything about it. Can someone help me out on making one or send me a thread about it? because I couldnt find for some reason

shadow tide
#

what wrapper thing (give more detail)

lost matrix
shadow tide
#

well he wants to switch to a wrapper thing

#

but idk what that is because he won't give more detail

shadow tide
#

well, objects...

#

he won't give more info

eternal oxide
#

I've only seen him say that one paragraph

#

did he speak earlier?

shadow tide
#

no

dull whale
#

sorry guys I looked up on google one final time and I think ive found what I was looking for

shadow tide
#

and what is that?

dull whale
#

array of my custom class

shadow tide
#

uhh, I think that had something to do with json

#

maybe

ivory sleet
#

If you just wanna wrap your array to a List use Arrays::asList Ig

lost matrix
ivory sleet
#

Oh I tried switching to another one and then it just disappeared

#

Where’s your pretty pink tho? thonk

lost matrix
#

😦

lost matrix
ivory sleet
#

Yeah lol

lost matrix
#

Ah. Ok.

#

Gimme

ivory sleet
#

I don’t have the cat gun one 😩

shadow tide
#

like mine?

ivory sleet
#

👀

steady rapids
lost matrix
ivory sleet
#

Oh lol, if I only had permission I’d have done that long time ago

lost matrix
eternal oxide
#

Not unless you do all teh recipe processing yourself

#

or attach to an actual crafting bench

steady rapids
steady rapids
lost matrix
steady rapids
#

yeah I just had to switchto InventoryType.WORKBENCH instead of InventoryType.CRAFTING xd

slim kernel
lost matrix
raw iron
#

Can help at general? Thanks

eager knoll
#

public void addShopItem(int slot, ItemStack item, int cost, boolean points) {
how do i add a name and lore argument to the list of arguments? whats the syntax

quaint mantle
#

how to sleep dynamite smoothly? so that it does not move
p.getWorld().spawnEntity(l, EntityType.PRIMED_TNT);

lost matrix
eager knoll
#

how so

lost matrix
eager knoll
#

public void addShopItem(int slot, ItemStack item, int cost, boolean points, String name, List lore) {
also ur saying i can just do this?

lost matrix
quaint mantle
lost matrix
minor garnet
lost matrix
rain igloo
#

so I was told to ask here even tho it's spigot specific and I am having a general java issue
so I am trying to use the command prompt on windows to compile a HelloWorldPlugin.class file and a plugin.yml into a HelloWorldPlugin.jar file, but the command doesn't work
it's jar -cf HelloWorldPlugin.jar HelloWorldPlugin.class plugin.yml and windows tells me that either the command is misspelled or doesn't exist.
it does exist, I have confirmed that, jar.exe is in JDK's bin folder, and I also didn't misspell it
yes I did manually set the environment variable to the correct path
yes I did try reinstalling JDK
yes I did restart my pc
and I also asked on the r/javahelp (or was it r/helpjava?... idk) subreddit, like 15 hours ago but still no useful response
nothing seems to fix it
and yes I am aware I can use an IDE like Eclipse to compile my files into .jar files, but I first wanna learn how to use the console for that
so like... does anyone have an idea what might be going wrong?... and how to fix it?

eternal oxide
#

?paste

undone axleBOT
eternal oxide
lost matrix
#

Usually you would use the java compiler 'javac' to compile java code like this.
But i have never manually compiled like that and i also have never seen anyone do it like this.
I would just stick to using your IDE for that kind of work.

ancient plank
#

I've only used javac when making basic code without dependencies/resources tbh, it just becomes a hassle when you try to do anything more complex 🤔

rain igloo
# lost matrix Usually you would use the java compiler 'javac' to compile java code like this. ...

well the thing is the command is the correct one
with javac I can make a .class file out of a .java file
but jar compiles into a jar file
and the "I'd jsut stick to an IDE" argument doesn't work, as I already said i do know that they can do it easier, if I would want to make it that easy, then I would
and I will later
but for now not
sry if that seems aggressive but.,. the arguement jus sucks imo

rain igloo
lost matrix
ancient plank
#

I wont say what I was going to say

rain igloo
lost matrix
rain igloo
#

okay and what is vim?...
sry I literally started with java yesterday

#

but still, I'm only looking for a fix to my problem, not a workaround

lost matrix
rain igloo
#

nah, I used Sublime Text, but I could use notepad
why?

lost matrix
#

That was a rethorical question.
I would highly recommend just using a proper java IDE and compiling with it.
Anyways. Does your terminal recognise the jar command at all? What happens if you just type jar in it?

slim kernel
#

Is there a better way to know how many UUIDs I got in my ArrayList than looping through it and doing int++ everytime it gets through?

slim kernel
#

what haha

ancient plank
#

what did I just read

lost matrix
#

Yes. Just use ArrayList#size()

slim kernel
#

omg

#

how couldnt I saw that thank you

quaint mantle
rain igloo
# lost matrix That was a rethorical question. I would highly recommend just using a proper jav...

I would highly recommend just using a proper java IDE and compiling with it.
sry but like... stop saying that, it doesn't matter to me if you recommend it, since if I would want to do taht, then I would. and as I already said, I will later. just rn that is not what I want
-_-
Does your terminal recognise the jar command at all? What happens if you just type jar in it?
says the same thing, that it either doesn't exist or is misspelled

eternal oxide
lost matrix
quaint mantle
rain igloo
#

it tells me:

java version "17" 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
lost matrix
#

Should look something like C:\Program Files (x86)\Java\jdk[some_version_here]\bin

eager knoll
rain igloo
lost matrix
#

Or better. Add the JAVA_HOME variable value: C:\Program Files (x86)\Java\jdk[some_version_here]
Then add %JAVA_HOME%\bin to your PATH variable.

ancient plank
#

List<String>

lost matrix
rain igloo
rain igloo
#

(gtg eat, will respond soon)

lost matrix
eternal oxide
#

lol

#

its correct

slim kernel
eternal oxide
#

It didn't want to squeeze between those blocks

ancient plank
#

I love how it went around the grass

#

and between

worldly ingot
#

I think your algorithm just proved you right

slim kernel
#

Does the Bukkit.getPlayer() Method return null if the Player doesnt exist AND if he isnt online?

eternal oxide
#

yes

slim kernel
#

okay thank you

subtle folio
#

you can just create a if statement to check if they aren’t null

tardy flame
#

So you can check if player isn't null and else you can cast it to OfflinePlayer

slim kernel
tardy flame
slim kernel
#

It could be just a random string

rain igloo
# lost matrix 1)

okay did this (and the other one) now
previously I had them in the user variables, I prolly understood some instruxctions wron
but I also only had jdk's bin folder path there
so now I did what you said, so let me try that rq

#

IT WORKED!!!
Thank you sooooooo much <3

#

and since I noticed you're german...
Dankesehr, hast mir echt geholfen ^^

ancient plank
#

7smile7 is vry pog

rain igloo
#

agreed!

halcyon mica
#

So I am trying to just emulate block placing myself

#
        ItemStack itemStack = e.getItem();
        Block block = e.getClickedBlock().getRelative(e.getBlockFace());

        block.setType(itemStack.getType());
        BlockData data = block.getBlockData();
        if(data instanceof Rotatable)
            ((Rotatable) data).setRotation(e.getBlockFace().getOppositeFace());
        if(data instanceof Directional)
            ((Directional)data).setFacingDirection(e.getBlockFace());
        block.setBlockData(data, true);

        if(e.getPlayer().getGameMode() != GameMode.CREATIVE)
            itemStack.setAmount(itemStack.getAmount() - 1);```
#

But the block data is never actually applied

#

Any idea why?

eternal oxide
#

Did you import teh correct Directional?

halcyon mica
#

yes

stone sinew
eternal oxide
#

No, you are getting the BlockData from the block. So nothign is going to change

#

You changed the type, then got BlockData from it

#

so you are literally setting the exact same BlockData you just read

heavy void
#

What is better? UTF-8 or UTF-16?

eternal oxide
#

depends in where its used

#

generally 8

worldly ingot
#

8 will suffice in the majority of cases, yeah

heavy void
#

Spigot, Paper, Atom, Thermos

#

What is better for them?

eternal oxide
#

still depends on where

#

as in flie type, sql database?

heavy void
#

Plugin for Java 8 Spigot 1.8.8

eternal oxide
#

then 8

heavy void
#

Plugin for Java 8 Thermos 1.7.10 too?

eternal oxide
#

If you are talking about file encoding then yes

heavy void
#

thanks

acoustic pendant
#

Hello, i have this code but with op i can't execute the command, how can i solve it?