#help-archived

1 messages · Page 153 of 1

shut crow
#

so i have my old overworld i want to keep, i got a new nether from the 1.16 vanilla jar. i stopped the server renamed both and started again to generate the new ones renamed back and still am having my 1.15 nether if i use spigot or paper 1.16

crimson sandal
#

does YamlConfiguration.loadFromString() replace what was already loaded into that config?

torn robin
#

probably

#

All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given string.

crimson sandal
#

Ah yeah it does, couldn't find the JavaDoc for it

#

Yeah just found it 😛

fossil shoal
#

How do I get a user's profile picture from spigot?
What I know:
I can get it using the user id, so for example the user id is 31119, the url would be https://www.spigotmc.org/data/avatars/l/31/31119 .jpg (choco was the first person I found xd)
The 31 is floor of user id / 1000 and then there is the user id.
What I don't understand:
The letter "l", how do I determine which letter would be on that position, I saw for some users it was "s"?

torn robin
#

why?

fossil shoal
#

(I didn't mean to embed)

sturdy oar
#

big doggo

fossil shoal
#

Something I am working on @torn robin

torn robin
#

automated access to the spigot site is prohibited iirc

#

i'm pretty sure this would go under that rule

fossil shoal
#

A contributor of spigot suggested something like that for resource pictures on github

pure pasture
#

Is there a way to use normal minecraft tags with spigot? So like I give myself an item with /give and give it the tag "damage:22b" is there a way to read this Tag in spigot?

torn robin
#

what exactly are you trying to do Trixone

#

and @fossil shoal what other letters are possible?

#

i'd look for some pattern

#

it looks like most are l

fossil shoal
#

Let me see, I saw one with s

pure pasture
#

I'm trying to create a System in which you can create custom Weapons just by giving them to yourself and the tags define how much damage it will deal

torn robin
#

if you're worried specifically about damage you can get the item's metadata and cast it to Damageable

#

make sure you import the correct version

#

org.bukkit.inventory.meta

pure pasture
#

No the system doesn't work with vanilla damage it a bit complicated I just don't know how to get the tags of an item

#

If it's works at all

torn robin
#

why are they intermixing?

pure pasture
#

I actually am using this Api but it doesn't seem to work if I give the item an NBT tag through /give

formal arrow
#

Are there any /wild plugins that work with 1.16.1

sturdy oar
#

yes

pure pasture
#

Well gg I think it's some other problem xD

sturdy oar
#

99% of the ones that work with 1.15.2

#

there's no reason for a properly written wild plugin to not work on 1.16

formal arrow
#

What ones bc the one im using doesn't and it works with 1.15.2

torn robin
#

look for another one

#

just google it

formal arrow
#

its the first one on google ok

#

ill try another one

sturdy oar
#

Guys do you know how to "normalize" the name of the sender while sending a message from another thread?

#

I'm sending messages concurrently but they show up with the ForkJoinPool in chat

fossil shoal
#

i'd look for some pattern
Looks like the letters l and s

torn robin
#

@fossil shoal look for like 3 s's

#

look for if there's anything similar to all three

#

@sturdy oar pretty sure that's just a host thing

#

or however you have it setup

#

if you wanted you could change how your plugin logs messages

formal arrow
#

I can't find one that works with 1.16

torn robin
#

i noticed it started doing that for me personally when i started using the internal logger

#

@formal arrow I guess there aren't any that work with 1.16 then

fossil shoal
#

Ohh nvm I think I underatand, l means large, s means small

torn robin
#

nice

weak violet
#

hello

#

I have this problem with my CraftPlayer.java file

torn robin
#

?ask

worldly heathBOT
#

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

weak violet
#

why can't I post photos

ember heart
#

You need to verify yourself

weak violet
#

well can I post imgur links

ember heart
torn robin
#

smexy

#

and yes torni

formal arrow
#

Seems legit

sturdy oar
#

that's how you get lag during ping flood attacks

ember heart
#

Yeah I'm such a moron for spending my time on that

weak violet
#

so I have those problems with my craftplayer.java

#

let me show you the lines where the problem is

crimson sandal
#

the 1.16.1 builds are flying out atm aren't they 😄

torn robin
#

is it a custom craftplayer class?

weak violet
#

only that part is custom

#

that I added

torn robin
#

why is it there?

weak violet
#

well i'm making a prac server and I need to have better knockback

#

so I tried making some changes

torn robin
#

i think a plugin would be better suited no?

weak violet
#

don't think a plugin can do exactly this but now I already have done all this

torn robin
#

wait this is 1.7

weak violet
#

yeah

#

because it's a practice server

torn robin
#

it looks like a maven issue

#

do you have your pom setup correctly?

weak violet
#

yes

torn robin
#

no idea

ember heart
#

Have you been able to export correctly before you started editing the class?

weak violet
#

yes

ember heart
#

successfully*

#

Alright

weak violet
#

if I remove this part of code it works

pure pasture
#

K I figured it out

ember heart
#

The @NotNull annotation?

#

I can't tell lol

#

@weak violet

weak violet
#

yes?

ember heart
#

You're missing the @NotNull annotation

weak violet
#

oh ok

ember heart
#

lmk if it works

weak violet
#

when I added notnull it says now cannot find symbol

#

do I need to import anything?

torn robin
#

i always just remove that

ember heart
#

Yeah it's not in CraftEntity aswell

#

Probably not the issue

#

The NotNull annotation is from sun

fossil shoal
#

I always get it from jetbrains annotations

weak violet
#

@ember heart I fixed 3 errors

#

2 left

#

the hardest ones

#

at the @Override line, it says error: method does not override or implement a method from a supertype

fossil shoal
#

The issue is pretty clear

weak violet
#

this is the only error I need fixed

sturdy oar
#

it's pretty clear

weak violet
#

so I should remove it?

sturdy oar
#

you're trying to override something that is different\not present

#

maybe check typo?

weak violet
#

it compiled

#

nice

#

thanks anyway for the help

ionic sun
tiny dagger
#

you should still

ionic sun
#

is setting the color property the only way?

#

oh good, I don't wanna set color properties

spare wolf
#

I want to make my own plugin

#

What program to use?

#

Notepad++?

#

I want to make a plugin that you can do /gm 0 or /gm 1 and not /gamemode creative

naive goblet
#

Install Eclipse IDE or IntelliJ IDEA

spare wolf
#

Wich one is best

naive goblet
#

Start with Eclipse I guess

spare wolf
#

Eclipse?

naive goblet
#

But it really doesnt matter

#

I use IntelliJ though

spare wolf
#

Is this the good site

#

That I dont download virusses

#

nvm

#

This is in the installer

#

@naive goblet

sturdy oar
#

Eclipse 🤮

spare wolf
#

what

honest tusk
#

Imagine using eclipse in 2020

sturdy oar
#

yeah

spare wolf
#

Sorry

ionic sun
#

PacketPlayOutChat packet = new PacketPlayOutChat(); did they change the API of this class?

spare wolf
#

Please dont be mad at me for using eclipse

ionic sun
#

I want to run a command when a user clicks on a message, I was trying to achieve this by sending a playoutchat packet, https://wiki.vg/Chat

spare wolf
#

@naive goblet what do I need to click next

sturdy oar
#

do whatever you want, if you like 2006 UIs i guess it's fine

spare wolf
#

Sorry conclure said this was best to start with

#

do you know what to click now

sturdy oar
#

Java Developers

#

the first

spare wolf
#

ok

#

Its installing

honest tusk
#

why not use Intellij, it's easier to develop plugins

sturdy oar
#

yeah

#

it even has a plugin by DemonWav

#

that creates archetypes for maven\gradle

spare wolf
#

ok i use that then

ionic sun
#

How can I make a user run a command when they click on text in the chat?

honest tusk
#

There are IDE plugins that can directly help you create plugin projects

ionic sun
#

Seems like I need to send a JSON packet, but all the threads seem outdated

sturdy oar
halcyon snow
#

It's not hard to manually create the plufin project.

spare wolf
#

Yes I am already downloadning it

halcyon snow
#

Plugin

spare wolf
#

I fount it

sturdy oar
#

Community edition is pretty much enough for someone starting

spare wolf
#

argh I dont know why I chose the name CallMeMe I am getting annoyed by it

#

Can I change it

#

or not

sturdy oar
#

Also IntelliJ has an amazing Kotlin support (... since they made it lol)

floral heart
#

You can I think

spare wolf
#

oof

#

Its 1,4gb

sturdy oar
#

64bit

#

add launchers to path

#

and i honestly would also create associations

spare wolf
#

that means?

#

sorry I am a noob at this

sturdy oar
#

that IntelliJ will open every .java file

#

by default

spare wolf
#

yes I clicked that

#

so like this

sturdy oar
#

i guess so

#

you can always change those later anyway

spare wolf
sturdy oar
#

?

spare wolf
#

Just install

#

or click one of them

sturdy oar
#

have you never done an installing lol

spare wolf
#

Yes I do

sturdy oar
#

just install

spare wolf
#

Ohh I understand

#

This is the program files location

#

I think

#

right?>

sturdy oar
#

I don't remember, that install wizard is only for Windows, an operating system I've never used

spare wolf
#

oof

#

What is the advantage of Linux

sturdy oar
#

speed

spare wolf
#

and

sturdy oar
spare wolf
#

I watch LTT all the time

#

This one comes with this

#

the IntelliJ is do ne

#

I will DM you so we dont clutter the server

#

oh I cant

sturdy oar
#

You can't

#

I don't have DMs enabled

#

Because I used to just get spammed with help and stupid stuff

spare wolf
#

oh I understand that

#

Do I click decline or accept

sturdy oar
#

I have no idea

#

Never used eclipse

spare wolf
#

I will click accept then

floral heart
#

Btw, on my server there seems to be a problem regarding mob spawning in nether, do any of you know what it could be? There hardly spawns any hostile mobs at all

spare wolf
#

If there are a lotta players online in different parts of the nether the mobcap will be spread out so there well be less mobs

floral heart
#

Well yes but I'm alone :/

frigid ember
#

@spare wolf TL;DW of that video, its rlly lightweight

harsh anvil
#

if you can get away with using linux, good for you, but i honestly cant be bothered

spare wolf
#

but there are probgrams that arent for linux right

crimson field
#

Structure generating does still not work on the latest build

median tinsel
#

is there some event which can be used to make mobs not pathfind to a player?

#

I am using event.setCancelled(true) on afk players dying to make them immortal, but creepers is still an issue

ionic sun
#

I'm trying to execute a command sync, not sure if I'm doing it right...

median tinsel
#

i tried changing gamemode, but it actually teleports the player ~-0.5 blocks on the y axis

ionic sun
#

I'm getting this error when building, with the code given above, I tried googling but found no results

#

I'm unsure how to resolve this issue

frigid ember
#

@harsh anvil linux is definitely better than windows for a minecraft server, but windows is easier to remember so i stick with that

harsh anvil
#

oh yeah for sure

spare wolf
#

download the build thing again

harsh anvil
#

for servers always use linux

frigid ember
#

I'm hosting a couple servers on Windows and it is far nicer than linux

#

but I might someday switch to using ubuntu server and use a tool like tmux

median tinsel
#

how do you screen with windows?

ionic sun
#

I'm on linux rn, and I'm developing and running servers on it... I don't think it's as hard as it used to be

frigid ember
#

"screen" with windows?

sturdy oar
#

I'm hosting a couple servers on Windows and it is far nicer than linux
@frigid ember 🤮

#

how dare you say that

median tinsel
#

screening is accesing your terminal from somewhere else, in a sense

frigid ember
#

ohhhhh

#

oh i dont bother lol

ionic sun
#

you mean ssh?

frigid ember
#

yeah

#

i use mstsc

median tinsel
#

not exactly

#

ssh makes a new terminal session, but to access your server you must connect to the same terminal

#

there are workarounds, of course

frigid ember
#

with linux, ive never been able to configure anything to start with it

median tinsel
#

but still: how do you screen on windows

frigid ember
#

@sturdy oar it's cool to navigate

ionic sun
#

yeah like using services to run the mc server

median tinsel
#

what do you need to configure on linux, banan?

frigid ember
#

stuff to start with linux...

ionic sun
#

it's not as hard as you think it is

median tinsel
#

i just start my minecraft on a tmux -S /tmp/myserver and then attach to it through tmux -S /tmp/myserver attach ezpz

frigid ember
#

like in windows, you have a startup folder

median tinsel
#

you can even connect from various machines if you're using a socket, which is nice

frigid ember
#

ive tried it before, no luck at all

ionic sun
#

I would setup a service, which starts on boot, so that you don't need to manage it manually

median tinsel
#

if you're up to it, banana, I can help you

#

i change my server too much for a service to be an optimal solution

frigid ember
#

ty but atm im sticking to windows until i need the ram

#

@ionic sun tried

ionic sun
median tinsel
#

how can I send a message to a player from another thread?

harsh anvil
#

you dont

#

schedule it back on the main thread

median tinsel
#

rather: I am doing stuff from a listener, and want to send a message to a player

harsh anvil
#

which listener?

median tinsel
#

oh, so I can schedule it to the main thread even from the subthread?

#

various, tbh

#

right now, PlayerDeathEvent

harsh anvil
#

listeners are on the main thread tho

median tinsel
#

I'm sending death coords to my players

harsh anvil
#

eventlisteners right?

median tinsel
#

yeah

harsh anvil
#

just get the player from the event

median tinsel
#

I was trying to AsyncChatEvent or whatever it was called yesterday, and it wouldn't want to work

#

ponging the player for testing

harsh anvil
#

hmm i forgot how asynchat event works 🤔

median tinsel
#

triggered when a player sends a chat message

#

I tried a simple event.getPlayer().sendMessage("hello to you too") and it wouldn't work :(

harsh anvil
#

well does the event trigger?

#

did you register it

#

thats like the issue tbh

median tinsel
#

yeah, it sent an err message complaining about using sendMessage() from a subthread

harsh anvil
#

can you show the stacktrace

median tinsel
#

uh, I deleted it, but could do it again

sturdy oar
#

There's nothing wrong with sending messages from other threads

#

i currently do that without any issue

harsh anvil
#

well its not guaranteed to be ran async

median tinsel
#

uncomment the .chat(), and the error appears

#

not sendMessage() lol my bad

harsh anvil
#

🤔

median tinsel
#

could it be a paper issue?

sturdy oar
#

the hell is .chat() message

#

chat makes the player talk

harsh anvil
#

read

median tinsel
#

wait, really?

#

so it's not sending a message to the player, but rather from the player?

sturdy oar
#

I'm pretty sure Player#chat makes the player send a message

median tinsel
#

that,,,,,, makes sense

sturdy oar
harsh anvil
#

he said he was using sendMessage tho?

sturdy oar
#

he's... not?

median tinsel
#

"as the player" could help the description

harsh anvil
#

well its commented out either way

median tinsel
#

i did, my memory failed me

#

i commented it out since it failed, but uncomment it to get the err

harsh anvil
#

try with sendMessage

median tinsel
#

cannot access BaseComponent

#

class file for net.md_5.bungee.api.chat.BaseComponent not found

harsh anvil
#

why are you using bungee packages for this smh

median tinsel
#

i honestly don't know where that comes from, I never imported bungee

ionic sun
#

how do I get the plugin from outside the main class?

median tinsel
#
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.entity.Player;```
#

it might be a paper thing, though

harsh anvil
#

@ionic sun dependency injection

ionic sun
#

how do I get a instance of it from outside?

harsh anvil
#

its really as simple as just passing the plugin to the constructor

#

pass it to the constructor of the class you use the scheduler in

ionic sun
#

oh yeah right, how did I forget that

reef folio
#

hey guys, anyone have an idea on how i can add an NBT tag to a chest

#

like my own custom NBT tag

median tinsel
#

what's the best way to add custom variables to players? subclassing or adding them to an arraylist with attached uuid?

harsh anvil
#

@reef folio blocks dont keep their NBT tags when placed

marsh hawk
#

Is it possible to save a Time/Date using FileConfiguration?

#

or will I have to make some parser myself

harsh anvil
#

@median tinsel depends what your goal is

median tinsel
#

you can parse time using java builtins from string

marsh hawk
#

awesome

median tinsel
#

i think they're based on strptime/strftime tbh

#

but not entirely sure

ionic sun
#

how do you send clickable urls, commands, hover etc?

halcyon snow
median tinsel
#

@harsh anvil i have players in different cities, so I want to assign them to different guilds, they might have different races/classes, info about being afk, their usernames on other platforms...

ionic sun
#

isn't that bungeecord only?

harsh anvil
#

bungee api is included in spigot

#

@median tinsel well then you probably want classes that take a player as argument

ionic sun
#

bruh I have visited that page multiple times but quit because I thought it was bungeecord only 😭

harsh anvil
#

and link them to your guilds

ionic sun
#

well that makes life so so much easier

median tinsel
#

player rather than uuid?

harsh anvil
#

well if you remove the reference when they quit its fine

median tinsel
#

but then I will lose the info when they dc, or do some wizardry onconnect

halcyon snow
#

you would save the data somewhere.

harsh anvil
#

^^

halcyon snow
#

json, yaml, sql are some possibilities.

median tinsel
#

but can you save a "player instance" anywhere? won't it change on next connect?

harsh anvil
#

write the data as it changes, but keep the altered version in memory, then remove it when the player dc's

median tinsel
#

i'm just thinking uuid is permanent

harsh anvil
#

write the UUID

halcyon snow
#

you'd link the UUID to the player's data.

harsh anvil
#

but use the player internally

median tinsel
#

ah, but store the player in runtime to avoid performance issues

#

that's fair

harsh anvil
#

yeah dont go reading it from disk every time you need it

#

load in memory when they join or something

#

or when its needed

median tinsel
#

i was gonna search for player with uuid on getServer() but probably smarter to just do that once

halcyon snow
#

you can use Bukkit#getPlayer(uuid) to fetch a player based off their uuid.

harsh anvil
#

i think bukkit caches it for you, but i'm not sure

median tinsel
#

probably easier to just deal with player instances anyway, so I don't need to repeat getPlayer(uuid) each time anyway

#

i don't need uuid for anything other than saving data anyway

weak violet
#

how can I add a new configuration in the spigot.yml file

#

so I don't need to build it over again and put it back into the server and restart it

#

so I can just reload/restart and yeah

formal jacinth
#

.delete() ?

#

then recreate it

#

but it will also reset all your settings

gritty cape
#

So, my friend is having issues connecting to the spigot server I just set-up but I can join it just fine using my local address. I have forwarded port 25565, sent him my IPv4 etc, but I must have missed something. Would someone be willing to help me troubleshoot a bit? I can share screen

#

Nevermind, like always, after asking for help I almost immediately solved it myself

#

I wish you all a good day/night!

proper crescent
#

Heya, i have this problem with NuVotifier, i wanted to go on their discord, but couldn't find it anywhere, can somebody help me here?

#

We can VC to help.

odd knoll
#

Have you checked their troubleshooting guide?

proper crescent
#

yep, nothing worked.

opal heron
#

do you really have to make a code to edit nbt attr or is there a plugin that can modify it?

naive goblet
#

There should be a plugin for it ?

#

Probs something like itemedit

lone fog
#

1.16 has /attribute

lone fog
#

You can’t unless you have a manual way to handle it

#

Spawners don’t store the mob type in item form

frigid ember
#

hey, how do I disable the join message on bungee and spigot?

lone fog
#

Join message?

frigid ember
#

yeah...

lone fog
#

Like player has joined the game?

frigid ember
#

yes...

lone fog
#

I think essentials can do it

frigid ember
#

what about in bungeecord?

soft locust
#

Hi, I'm trying to implement an /invsee command. I make a player A open the inventory of a player B, and force them to update their inventories at each interaction. It works really well for the top inventory, but the bottom inventory is very glitchy, some slots cannot be interacted with, and others, when clicked, put the item on the other player's armor (?_?). I really don't understand wtf is going on, does someone have an idea ?

#

I could also create an inventory and copy the content, but the previous method seems a lot simpler

spiral siren
#

I dont know whether or not this is a spigot issue but im using 1.16.1 and my server shuts down because the disk is malformed

#

org.sqlite.SQLiteException: [SQLITE_CORRUPT] The database disk image is malformed (database disk image is malformed)

#

nvm

#

I read the log

frigid ember
#

@subtle blade Yesterday I asked about "how do I make sign changes appear for all players", and you sent me this:

    @Override
    @EventHandler
    public void onSignChange(SignChangeEvent event) {
        
        BlockState state = event.getBlock().getState();
        if (state instanceof Sign) {
            Sign sign = (Sign) state;
            sign.update();
        }
        Statics.getPlayerMap().get(event.getPlayer().getUniqueId()).onSignChange(event);
    }```
but, its not working. You see anything wrong here?
#

Because its still only updating for the player who interacted with the sign

#

and not for all players

opal bay
#

loop through all online players and send the sign change event

flint vine
#

Dear all! Please help me to find a plugin. I'm searching for last week for solution already. I want to find a plugin that have possibility to create 2 currencies where 1 is a chest-shop currency and second works through mysql and there is a possibility of exchange one-way

frigid ember
#

@opal bay you shouldn't have to do that. Events are sent to all players, and this code is written at the top level. It should still be sent to all players.

flint vine
#

Really!? There is no plugin that do chest-shop and multicurrency?

soft locust
#

@opal bay you shouldn't have to do that. Events are sent to all players, and this code is written at the top level. It should still be sent to all players.
@frigid ember I did something similar once. I think you have to put the update in a BukkitRunnable and run it on the next tick

subtle blade
#

Don’t do it in the sign change event

#

Do it when you want to change the text on the sign

frigid ember
#

I fire this event off tho after its edited nPlayer.getBukkitPlayer().sendSignChange(event.getClickedBlock().getLocation(), args);

#

I suppose that doesn't matter?

#

Just seems weird to me I guess

subtle blade
#

Yes but you don’t have to use send sign change

#

Use the sign state to change it

#

sendSignChange() changes the lines on the sign only for the client of the player on whom you’ve invoking that method

#

Using the Sign state will change it on the server and update nearby players

tiny dagger
#

it got removed

subtle blade
#

e.getView().getName()

tiny dagger
#

check by instance

#

wait wut?

subtle blade
#

Inventory views have names, not inventories

tiny dagger
#

it exists in inventoryview?

#

ohh

soft locust
#

I just did viewer.openInventory(other.getInventory());, but it seems like some slots in my inventory corresponds to the other player's armor slots :/

flint vine
#

Dear all! Please help me to find a plugin. I'm searching for last week for solution already. I want to find a plugin that have possibility to create 2 currencies where 1 is a chest-shop currency and second works through mysql and there is a possibility of exchange one-way
😦

#

I will buy a plugin if you can write it

subtle blade
#

Gab I don’t think that’s exactly supported

#

An exception really should be thrown if a PlayerInventory is passed. Maybe I’ll talk with md about that

soft locust
#

:/

#

I looked out in forums, it seems to have worked with others

#

And i think that's how essentials is doing it

subtle blade
#

I really don’t think Essentials should be taken as a point of reference heh

soft locust
#

😦

subtle blade
#

Why not? You’re in an InventoryEvent correct?

frigid ember
#

Yo, @tiny dagger @subtle blade that sign update event is not working, even after invoking in the method that the interaction is made

subtle blade
#

So what about it isn’t working?

hardy forge
#

I have 25 GB RAM on my SMP

#

is that too much?

subtle blade
#

Far too much

hardy forge
#

someone told me 15 GB

#

is better

subtle blade
#

That too is too much

frigid ember
#

it changes it to the colored text, then changes immediately back to black

subtle blade
#

You can get away with 4, maybe 6 if you have more people

hardy forge
#

Can much RAM

#

lagg the server?

subtle blade
#

Often times yes

#

The garbage collects gets very lazy

hardy forge
#

I have 64 GB ram with good specs

#

But we runt 1.16

#

with like 50 players

subtle blade
#

“Ah we have a lot of RAM left! No need to remove unused stuff!”

hardy forge
#

on all the time

subtle blade
#

So you could probably get away with 8 just fine.

#

Yeah that’s the one. My bad

hardy forge
#

So no need to overun the server with much RAM??

subtle blade
#

No definitely not. You’ll end up performing worse

frigid ember
#

so for some reason when I listen to the PlayerInteractEvent and right click a block, it fires twice

#

but not when i right click air

#

I tried seeing if I had registered it twice anywhere but cant find anything

soft locust
#

you need to have an item in hand to interact with air

#

And for the double firing, I think that's because of the off hand

frigid ember
#

i am doing it with an item

#

it fires once when i right click on air, which is what i want

#

but it fires twice on right clicking a block

#

and i dont have any item in my off hand

soft locust
#

it's maybe because your are interacting with the item and the block at the same time, so you have two interactions i guess

frigid ember
#

actually I think i see what you're saying now, because when i right click with a shovel or something in my off hand it fires

timid basin
#

Does anyone know a way to know if a packet was sent by you when intercepting packets?

#

I'm trying to cancel packets that are generated by minecraft

frigid ember
#

@subtle blade @tiny dagger Sorry for the spam, but man this does not work

#

I added the sign update into the method where the player actually updates the sign

#

Now it sets the color of the sign, and then instantly sets it back to black even for the player interacting with the sign

sturdy oar
#

does -DIknowWhatImDoingISwear need to be the first flag, or it doesn't matter?

#

actually.. does that flag still work?

#

nvm, it was -DIReallyKnowWhatIAmDoingISwear

hollow thorn
#
java.lang.IllegalArgumentException: Symbol does not appear in the shape:73
        at org.apache.commons.lang.Validate.isTrue(Validate.java:93) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
        at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:128) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
        at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:113) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
        at com.javaminecraft.StaffWeapon.onEnable(StaffWeapon.java:149) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) [spigot.jar:git-Spigot-a99063f-c9d7c16]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) [spigot.jar:git-Spigot-a99063f-c9d7c16]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:464) [spigot.jar:git-Spigot-a99063f-c9d7c16]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:378) [spigot.jar:git-Spigot-a99063f-c9d7c16]
        at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:457) [spigot.jar:git-Spigot-a99063f-c9d7c16]
        at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:274) [spigot.jar:git-Spigot-a99063f-c9d7c16]
        at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:784) [spigot.jar:git-Spigot-a99063f-c9d7c16]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]```
frigid ember
#

@hollow thorn you gonna elaborate on that? lol

hollow thorn
#

help

#

my plugin isn't working on launch

sturdy oar
#

so?

hollow thorn
#

i dont know whats wrong

graceful vigil
#

smh

hollow thorn
#

i added a recipe and that crashed the hole lot

#

found issue

frigid ember
#

Is comparing a villagers loaction with one from the config a good idea? When the villager has, #setAI(false), #setAware(false), #setCollidable(false), #setInvulnerable(false)?

#

I have no idea how i can indentify if the entities are the same.

#

hm maybe there are unique values for a entity.

granite hedge
#

are you talking about a custom one?

frigid ember
#

Ah i think i got it. There are EntityIDs

#

I will just compare them

sturdy oar
#

are you trying to merge entities

#

stack

frigid ember
#

Just checking if a villager is the same via a config.

sturdy oar
#

oh ok

frigid ember
#

oh and theres a UUID

#

ok i think i will compare them

hollow thorn
#

still broken

frigid ember
#

We can't help you here. We are not the developers of the plugin. Contact the developer if you can't fix that yourself.

hollow thorn
#

its my plugin

frigid ember
#

Then share the code with us.

#

That causes it.

hollow thorn
frigid ember
#

Oh lord

#

?paste

worldly heathBOT
opal bay
#

First it wouldn't install but I restarted it and its installing now

sturdy oar
#

🧙‍♂️

opal bay
#

ah shit son 80%

mild nebula
#

Hello, im currently using Dependency injection for all my classes that i need my main class in, However theres two utility classes that i currently need to access my main class from (they're static) should i create a private static instance of my main class and a getter? what im doing right now is making a public void initialize method on them, and passing them over to my main class so my main class variable can get instatiated. should i keep doing that or should i make a static variable in my main class?

quartz trench
#

install arch then if it fails you know why

#

or artix 😛

sturdy oar
#

arch not user friendly 👺

quartz trench
#

lol yes it is

#

arch is easier

dusty topaz
#

@mild nebula why do you need your plugin instance in a static method

quartz trench
#

pacman go brrrrrrr

opal bay
#

its installed boy

dusty topaz
#

either way, you have 3 options:

  • singleton / static instance variable
  • javaplugin#getplugin and cast
  • make utility class non static
sturdy oar
#

S I n g l e t o n

dusty topaz
#

whenever anyone here hears singleton i imagine they keel over in disgust

#

DoNt Use SiNGleTon ITs NoT sOliD

mild nebula
#

if i make a singleton should i use that over dependency injection?;p

opal bay
#

me trying to remember password NotLikeThis

dusty topaz
#

people will argue for each and every

#

at the end of the day it usually doesn't matter

quartz trench
#

Just use the singleton where you really can't do dependancy injection imo

dusty topaz
#

i personally always use DI

quartz trench
#

Like static helper methods

#

where you need plugin version

#

or similar

mild nebula
#

i see, that makes sense

dusty topaz
#

i usually just pass in plugin instance to static method

quartz trench
#

That works too

dusty topaz
#

problem solved 🧠

frigid ember
#

just use a singleton for things you will only ever have one instance for...

dusty topaz
#

you can't use that argument here, somebody will call it invalid

quartz trench
#

yeah ofc we're talking about the main class instance

dusty topaz
#

if you google 'singleton spigot' you get some interesting reads

#

🙃

frigid ember
#

I just have an initialization class and have it as a static variable

#

Gets the job done perfectly fine

#

The only thing I don't understand is...

#

why the hell my sign text changes only show up for the interacting player and not all players

#

This shouldn't be hard

#

what

#

I don't understand

dusty topaz
#

code?

mystic forum
#

noob here trying to get the size of an inventory, but getting an error in IDE "Cannot resolve method 'getSize​' in 'Inventory'"

frigid ember
#
        if(manageHouseTransaction(event)) {

            nPlayer = Statics.getPlayerMap().get(event.getPlayer().getUniqueId());
            domain.addPlayer(nPlayer.getBukkitPlayer().getUniqueId());

            String[] args = new String[4];
            args[0] = ChatColor.AQUA.toString() + ChatColor.BOLD.toString() + "House";
            args[1] = nPlayer.getNation().getChatColor() + ChatColor.BOLD.toString() + nPlayer.getNation().getNationName();
            args[2] = ChatColor.AQUA + "Owned By";
            args[3] = ChatColor.GREEN + nPlayer.getBukkitPlayer().getName();
            
            nPlayer.getBukkitPlayer().sendSignChange(event.getClickedBlock().getLocation(), args);
            
            BlockState state = event.getClickedBlock().getState();
            if (state instanceof Sign) {
                Sign sign = (Sign) state;
                sign.update();
            }
            
            nPlayer.setOwnedHouse(this);
            
            return;
        }
mystic forum
#

Is there a secret I'm missing

frigid ember
#

@mystic forum I'm going to guess you don't have spigot as a dependency in your pom?

mystic forum
#

<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>

#

do I need to add spigot in addition to spigot-api?

#

everything else is working fine

#

just trying to .getSize() on and inventory

#

is broken

#

weird

#

it just fixed itself

dusty topaz
#

broken how?

mystic forum
#

disregard me

dusty topaz
#

o

mystic forum
#

retyped it for the 4th time, after trying other methods, and now it just works

#

🤷‍♂️

frigid ember
#

is there a way to "force" a spawn upon someone?

#

ie

#

when they join

#

they get sent to x y z?

dusty topaz
#

on player join, wait a tick, teleport them?

frigid ember
#

@mystic forum it may not have been imported. control + shift + o for quick import

mystic forum
#

Thanks Mak, I'll give that a try if it happens again

frigid ember
#

uh sure

#

why not

#

and how?/

#

@dusty topaz

hollow thorn
#

help

grand wind
#

Hello. I recently launched a spigot 1.16 server on BisectHosting. I used to host one on 1.14. However, when people play on 1.16 spigot server, it seems to crash after a few minutes and restart and then crash again a few minutes later over and over. The only plugins we were using was the Dynmap plugin that said was updated. Even without any plugins, the server would run for a few minutes and crash again so I've had to replace it with a vanilla minecraft server.

Will there be a new build released that will be more stable or have I done something wrong in setting up?

pure pasture
#

How do you get the name of an Inventory in 1.15.2 I always get an Null Pointer Exception when I use e.getView().getTitl()?

sturdy oar
#

I wouldn't recommend 1.16.1 for production

#

You should stick to 1.15.2 for now

pure pasture
#

How do you get the name of an Inventory in 1.15.2 I always get an Null Pointer Exception when I use e.getView().getTitl()?

sturdy oar
#

the error is clear

#

you can't get the title because something is null

pure pasture
#

OH THANK YOU

#

Great

sturdy oar
#

just do null checks and you won't get those exceptions anymore

quartz trench
#

I can't tell if thats ironic

pure pasture
#

Oh I do actually do Null checkd

restive zinc
#

just curious, is there a way to host a bukkit server with mods?

sturdy oar
#

no

#

you need Sponge

pure pasture
#

In the console it says "Title not set" even though it is set xD

quartz trench
#

what are you trying to do

pure pasture
#

Im trying to get the name of an inventory

restive zinc
#

oh right sponge

quartz trench
#

?xy

worldly heathBOT
frigid ember
#

Hey, my server crashed because of generator-settings in my server.properties

#

generator-settings=minecraft\:air;minecraft\:the_void;decoration

#

Wiki told me to escape the characters

quartz trench
#

Is that new 1.16 stuff

#

Because the new 1.16 multiworld stuff is not supported

weak violet
#

my knockback on the server is weird
it works okay but when they hit w and a/d when they get hit, they get no knockback
and are able to escape from it which shouldn't happen

#

here are the parts that I changed

#
                    if (flag2) {
                        if (i > 0) {
                            entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal), SpigotConfig.knockbackExtraVertical, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal));
                            this.motX *= 0.6D;
                            this.motZ *= 0.6D;
                            this.setSprinting(false);
                        }
                        if (entity instanceof EntityPlayer && entity.velocityChanged) {
                            EntityPlayer attackedPlayer = (EntityPlayer) entity;
                            PlayerVelocityEvent event = new PlayerVelocityEvent(attackedPlayer.getBukkitEntity(),
                                                                                attackedPlayer.getBukkitEntity().getVelocity());
                            this.world.getServer().getPluginManager().callEvent(event);
                            if (!event.isCancelled()) {
                                attackedPlayer.playerConnection.sendPacket(new PacketPlayOutEntityVelocity(attackedPlayer));
                            }

                            attackedPlayer.velocityChanged = false;
                            attackedPlayer.motX = victimMotX;
                            attackedPlayer.motY = victimMotY;
                            attackedPlayer.motZ = victimMotZ;
                        }
small bobcat
#

do bees cause a lot of lag?

weak violet
#

I made it so I can change the knockback from the spigot config

mystic forum
#

Dishit, how many bees we talkin'?

small bobcat
#

like 30

#

in 2 chunks

mystic forum
#

Shouldn't be terrible

#

Are you on 1.16?

small bobcat
#

yeah

mystic forum
#

They dropped the wander radius in 1.16 which should cut back on lag a bit

small bobcat
#

oh alright thats good

#

btw is there a way to reduce cpu usage on a server?

mystic forum
#

My limited experience, bees are OK, villagers are the worst offenders

small bobcat
#

ik

frigid ember
#
        ItemStack pg = new ItemStack(Material.WOODEN_HOE);
        ItemMeta meta = pg.getItemMeta();
        
        meta.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Paintgun");
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_UNBREAKABLE);
        List<String> lore = new ArrayList<String>();
        lore.add(ChatColor.ITALIC + "Default paintgun");
        meta.setLore(lore);
        pg.setItemMeta(meta);
        pg.addEnchantment(Enchantment.DURABILITY, 1);
        
        return pg;
    }```
#

is there a reason why when I add the paintball to a player's inventory using a command it doesnt work

torn robin
#

You’re not giving it anywhere in the code?

mystic forum
#

Dishit, that is way too broad of a question. There are some general pointers for reducing server lag all over the place, and plugins to help with that

frigid ember
#

I left that part out oops

#
        if (!(sender instanceof Player)) {
            return false;
        }
        Player p = (Player) sender;
        
        if (label.equalsIgnoreCase("paintgun")) {
            p.getInventory().addItem(getDefaultPaintgun());
            return true;
        }
        return false;
    }```
#

thats my oncommand

small bobcat
#

Thanks @mystic forum

torn robin
#

@frigid ember make sure the command is being run

small bobcat
#

and one more thing is it possible to make villagers less laggy. I am using villager optimizer anything else on the market?

mystic forum
#

@small bobcat two things: first, try SAML. It requires tuning to be a little more user-friendly, but it can nerf/freeze mobs. Unfortunately, you're kinda on your own for finding the settings/mob groups/etc for your server that you like

frigid ember
#

@torn robin i sent a message to the player when the command was originally run and it did run

#

not sure whats happening

mystic forum
#

second, (I may get hate for suggesting this here, not sure about the policy), PaperMC has some villager optimizations built in - you can get it / find out more on their site

small bobcat
#

we tried saml but like you said it freezes the villager and we can't move them into carts and etc.

#

alright i will check paper

mystic forum
#

@small bobcat SAML can be set to unfreeze villagers when you interact with them, so if you're trying to move them, just interact first, then move

#

but it all needs to be tuned

small bobcat
#

oh really by dumb brain never went through the config

mystic forum
#

SAML has infinite possibilities for how you define groups/when to freeze/when to unfreeze/etc. Default settings can be jarring (lots of freezing, slow to unfreeze)

#

unfortunately, there's not really a guide for "best" settings because it's all very specific to each situation (what are your farms like? what level of tolerance do you have for entity freezing? etc.)

#

so you've just gotta play around

small bobcat
#

oh ok

#

thanks

mystic forum
#

make a copy of the default settings, in case you accidentally break something

small bobcat
#

alright

weak violet
#

my knockback on the server is weird
it works okay but when they hit w and a/d when they get hit, they get no knockback
and are able to escape from it which shouldn't happen

#

here are the parts that I changed

                    if (flag2) {
                        if (i > 0) {
                            entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal), SpigotConfig.knockbackExtraVertical, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal));
                            this.motX *= 0.6D;
                            this.motZ *= 0.6D;
                            this.setSprinting(false);
                        }
                        if (entity instanceof EntityPlayer && entity.velocityChanged) {
                            EntityPlayer attackedPlayer = (EntityPlayer) entity;
                            PlayerVelocityEvent event = new PlayerVelocityEvent(attackedPlayer.getBukkitEntity(),
                                                                                attackedPlayer.getBukkitEntity().getVelocity());
                            this.world.getServer().getPluginManager().callEvent(event);
                            if (!event.isCancelled()) {
                                attackedPlayer.playerConnection.sendPacket(new PacketPlayOutEntityVelocity(attackedPlayer));
                            }

                            attackedPlayer.velocityChanged = false;
                            attackedPlayer.motX = victimMotX;
                            attackedPlayer.motY = victimMotY;
                            attackedPlayer.motZ = victimMotZ;
                        }
frigid ember
#

is there a way to "force" a spawn upon someone?
ie
when they join
they get sent to x y z?

#

Hey, how to get all chunks GENERATED of a world ?
no just chunks generateds

#

Teleport them on the on join event is there a way to "force" a spawn upon someone?

ie
when they join
they get sent to x y z?
@frigid ember

light geyser
#

Hello, switched to spigot api 1.16 today, noticed that InventoryType.GRINDSTONE no longer exists, what has this been replaced with?

opal bay
#

onjoinevent, create a new location and then teleport them to that location

#

or essentialsspawn has that

frigid ember
#

i mean in terms of
what plugins there are

opal bay
#

essentials spawn

unreal jackal
#

is there a plugin which allows or has a way to spawn a mob e.g wolf with the name of the person that spawned it? i tried mcstacker that sells a wolf spawn egg and have the wolf spawn with the player name but %player% etc of the placeholders dont work... please @ me if you know

frigid ember
#

Ping me for reply

#

link? @opal bay

#

looking it up but everything's from 2015

light geyser
#

Where did HeightMap go in bukkit?

#

also regarding SpigotAPI 1.16^^

opal heron
#

Is there a way to add certain permissions per set?

#

Ex. When you wear a full set of iron, you get fly permission, when you remove it, the perm also gets removed

naive goblet
#

Yeah

opal heron
#

I can't find the plugin since the google is only suggesting me armor effects.

naive goblet
#

Oh a plugin?

opal heron
#

Depends

naive goblet
#

Not sure about that one

#

You can definitely code that though

opal heron
#

if its possible i want to know

#

Does it work when i renamed a set?

true anvil
#

Yeah if you code it

naive goblet
#

If you code it like that

opal heron
#

Oh so i can do multiple diamond sets with different perms?

naive goblet
#

Perm?

opal heron
#

I haven't tried coding yet but i guess tutorial can help me

naive goblet
#

Why’d need that

opal heron
#

Fly perms

naive goblet
#

Just check for the set if you can code it ys

#

Oh

opal heron
#

you see, i created some armor called Dragon Sets

#

and i want those sets to have flying perms.

true anvil
#

Just when worn?

opal heron
#

Yes

#

if its not possible i guess i can just do high jump and speed boost

naive goblet
#

Afaik that’s possible with code and without perm

true anvil
#

Yeah you can just check if the player has a peice of armor on with that name and then put them in fly

naive goblet
#

Not that easy

true anvil
#

I feel like it is i did this before but it wasnt for a permission

naive goblet
#

What if another plugin clears the armor codewise etc?

#

Wouldn’t trigger an event afaik

opal heron
#

Hm, im only using MyItem plugin

#

which adds lores, attributes and rename the item

true anvil
#

Aslong as it has the name you could check for the name

#

or lore

naive goblet
#

Well no itemedit plugins would be able to achieve this I guess as it’s not their purpose

#

christo you don’t event need ItemMeta, could use NBT as well

true anvil
#

Yeah you could, I usually just do itemmeta bc its a little easier, but ig like you said that could get changed

weak violet
#

should I enable tcpnodelay on a 1.7.10 pvp server?

opal heron
#

I guess im staying with high jump and speed effects

naive goblet
#

k

#

@weak violet I guess but I mean 1.7.10??? Why

weak violet
#

because the pvp is smoother

naive goblet
#

How?

opal heron
#

Oh yeah another question, how do i edit the blue attributes

weak violet
#

also I have a problem with the knockback

naive goblet
#

Blue attribute?

weak violet
#

from the patches I applied

naive goblet
#

Just upgrade lol

opal heron
#

MyItems does that but the attributes only works when its in the lore

weak violet
#

it happened only when I applied the patches

naive goblet
#

Wym ixxa

weak violet
#

so it might be something wrong with that

opal heron
#

So lets say

Diamond sword
Damage: 200

naive goblet
#

Well I wouldn’t use 1.7.10 to start with, 1.8 should be minimum

opal heron
#

if i remove the 200 damage lore the attr also vanish

naive goblet
#

Wym

#

attr?

opal heron
#

The attributes only works when its in the "lore" not on the actual blue attributes

naive goblet
#

Can you send ss of what you mean?

#

Sorry but it’s confusing af for me

opal heron
#

You see the lore "Damage"?

#

that overrides the blue attribute or the actual attribute

#

if i remove that, the attributes also vanish and turns it into the normal one

#

the plugin made it like that which is kinda not cool

urban sundial
#

If I kill all the mobs in a multiverse world, will it kill the mobs in every world or just the world I am in?

opal heron
#

Now my plan is, to just edit the blue one

#

Just the world youre in

forest thorn
#

apparently 1.8 clients have a 0.4 wide hitbox

#

instead of a 0.3 wide hitbox

#

but f3 b shows a 0.3 wide hitbox

urban sundial
#

@opal heron How do I kill just the mobs?

opal heron
#

What do you mean by that?

urban sundial
#

I want to run a command to kill the mobs in my MV world

#

It's a flat world

opal heron
#

Every mobs in that place?

urban sundial
#

yes

opal heron
#

Hm, i dont know a command that does that

#

but ClearLag can do that

#

but wouldnt mobs spawn again if you kill all of them?

frigid ember
#

Anyone know of a way that through Java I can get a file and turn that file into a downloadable link?

quick harbor
#

Hey guys, do you know an alternative to EntityPlaceEvent? (it is deprecated)

opal heron
#

i think its org.bukkit.entity.event

quick harbor
#

Yeah but if there is an alternative event. Because it took me some time to find that one but I saw its deprecated and it doesnt recommend what we should actually use

#

Deprecated.
draft API

#

Maybe its because its under development? Or what does the draft mean?

rare prairie
#

Use BlockPlaceEvent

#

Draft mean, it will be removed in future releases

light geyser
#

Hello, switched to spigot api 1.16 today, noticed that InventoryType.GRINDSTONE no longer exists, what has this been replaced with?

urban sundial
quick harbor
#

Draft mean, it will be removed in future releases
Ty for that info

#

Use BlockPlaceEvent
It doesnt do what I want

#

BlockPlaceEvent isnt called when a player places an entity (or "creates")

#

In my case, I want an event to be called when for example, a player places an end_crystal in an obsidian block (and EntityPlaceEvent performs that perfectly)

rare prairie
light geyser
#

Thats weird, getting this though GRINDSTONE cannot be resolved or is not a field

#

on if(event.getInventory().getType().equals(InventoryType.GRINDSTONE)) {

rare prairie
#

@quick harbor then use CreatureSpawnEvent

#

@light geyser you sure that you imported correctly the InventoryType?

#

And also check your project libraries, if you use maven build now

naive goblet
#

Don’t check the enum elements with Object#equals

light geyser
#

imported org.bukkit.event.inventory.InventoryType;

naive goblet
#

Use ==

light geyser
#

Will change that too

rare prairie
#

It's more fastest

tame drum
#

idk if im allowed but i lost my backup codes on pc so i cant get in my account cuz of new phone and it didnt save my 2fa info

naive goblet
#

more fastest?

subtle blade
#

Draft mean, it will be removed in future releases

Maybe its because its under development? Or what does the draft mean?

@quick harbor @rare prairie Draft means it's subject to change

rare prairie
#

Yep, because Object#equals is also compares the type of instance

subtle blade
#

It's not likely that it will and even if it does, it's likely to remain anyways and just delegate to the new API (as was the case with the persistent data containers in 1.13 -> 1.14)

#

Generally you're fine to ignore deprecation warnings from draft api

naive goblet
#

Wth yes?

quick harbor
#

Generally you're fine to ignore deprecation warnings from draft api
Nice!!! Thank you so much

#

I just couldnt find a replacement for that event and took me ages to find it haha

naive goblet
#

Though we don’t need a value check which is what .equals() mainly is for

subtle blade
#

I've never heard of EntityPlaceEvent tbh

quick harbor
#

Me neither, and I was getting crazy because no event was being called when you placed armor stands or ender crystals

subtle blade
#

Oh I see. armor stands, boats, minecarts, and end crystals

quick harbor
#

Yeah

tame drum
#

can anyone help me with my problem?

quick harbor
#

And I also needed to know which player placed them haha. Nice event

naive goblet
#

Whats the problem?

light geyser
#

@rare prairie Would you maybe know another possible solution to my issue?

#

(The Grindstone one)

rare prairie
#

Did you built your project libraries?

light geyser
#

as in, gradlew build or?

rare prairie
#

Yep

naive goblet
#

Dutch send your build.gradle

light geyser
#

yep have done

subtle blade
#

That event was added in 1.13.2, xtomyserrax

light geyser
#
plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '5.0.0'    
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

version '1.1-BETA'

repositories {
    jcenter()
    mavenCentral()
    
    maven {
        url "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
    }
    
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
    
    maven {
        url "https://maven.enginehub.org/repo/"
    }
    
    maven {
        name 'papermc'
        url 'https://papermc.io/repo/repository/maven-public/'
    }
}

dependencies {

    //Spigot API
    compileOnly 'org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT'
    
    //Apache Commons
    compile group: 'commons-io', name: 'commons-io', version: '2.6'
    
    //WorldEdit API
    compileOnly group: 'com.sk89q.worldedit', name: 'worldedit-bukkit', version: '7.1.0'
    
    //PaperLib
    compile "io.papermc:paperlib:1.0.4"
}

shadowJar {
    relocate 'io.papermc.lib', 'nl.thedutchmc.uhcplus.paperlib'
}
subtle blade
#

It's likely not going anywhere

naive goblet
#

Or wait, does the inventory type exist in compile time but not in runtime?

light geyser
#

Hope its OK to post these codeblocks in here

subtle blade
#

If they're as long as that, pastebins are preferred

#

?paste

worldly heathBOT
light geyser
#

OK, will swap it out then

naive goblet
#

Or wait, does the inventory type exist in compile time but not in runtime?
@naive goblet @light geyser

quick harbor
#

It's likely not going anywhere
Nice then, thank you a lot Choco. Also for that tip about drafts

subtle blade
#

It's fine for now, no worries

#

Yeah np

light geyser
#

@naive goblet Eclipse tells me it doesnt exist, did not try compiling with it, will do now

naive goblet
#

I mean like it doesn’t exist at all?

#

Or just in runtime?

light geyser
#

Ill try compiling it, see if that works

naive goblet
#

Just check if you can use it in your ide lol

light geyser
#

Yep compiling is OK, seems just a Javadoc issue theb?

subtle blade
#

Make sure your server is up to date

naive goblet
#

InventoryType.YOURTYPE

light geyser
#

yeah that it doesnt like

#

GRINDSTONE cannot be resolved or is not a field

naive goblet
#

Oh it doesn’t exist in the api?

light geyser
#

apparently

naive goblet
#

And you’re up to date?

light geyser
#

using the latest one from the spigot repo, I think?

naive goblet
#

That’s weird

subtle blade
#

Was added in 1.14-pre5

naive goblet
#

Have you tried reloading your gradle project

light geyser
#

yep

#

redownloaded the wrapper too

rare prairie
#

Try to delete .m2 folder from Users folder and rebuild

naive goblet
#

Doesn’t matter

#

He isn’t using the local one anyways

#

Did you restart your ide as well?

#

And are you in the right project?

light geyser
#

Yep to both

naive goblet
#

Uh well this is getting weird

#

And you’re not in the wrong class also?

light geyser
#

nope, correct class too

orchid musk
#

Hey guys - I have a strange issue that started with 1.16.1..things mobs/arrows lags out and skips around. No resource issues on a dedicated server and never saw this with the 1.15.2 builds

naive goblet
#

What if you close the class and reopen it

frigid ember
#

is it at all possible to create entirely new textures in minecraft if you get all players to download the pack or something?

naive goblet
#

I think so

light geyser
#

Re opening class does not work. Will Try restarting IDE once more

naive goblet
#

Hmm yes

#

And if you use 1.15.2 the type exist?

light geyser
#

Yep, used it just fine with the 1.15.2 api

#

Not trying to promote my stream here, but you can see it on there too how it is behaving

naive goblet
#

Well this is getting weird

#

Have you installed buildtools 1.16.1

light geyser
#

Ive run buildtools yep, just for the server jar though

lapis plinth
naive goblet
#

Then use dependency org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT

#

And the mavenLocal repo

light geyser
#

that would just be mavenLocal() ?

naive goblet
#

See if it exists then

#

@lapis plinth just creating a json file can be done with a File instance

tame drum
#

thanks to my new phone it didnt save my spigotmc 2FA login so i have no way to get in my account Sentaku

lapis plinth
#

Can you give me an example? Im really new to files in general

naive goblet
#

new File(plugin.getDataFolder(), “file.json”)
Then File#createNewFile()

#

I believe

lapis plinth
#

kk

naive goblet
#

Also only create if File#exists() is false

lapis plinth
#

This is more of a storage thing rather than config

naive goblet
#

Could also try create its parents as well

#

Yeah

#

Idm

#

?

lapis plinth
#

wot

#

idm = it doesnt matter i assume?

naive goblet
#

Yes

lapis plinth
#

kk

light geyser
#

Does it matter where I run build tools? or is that irrelevant? for mavenLocal

naive goblet
#
File file = new File(“./file.json”);
if (!file.exists()) {
  file.getParentFile().mkdirs();
  try {
    file.createNewFile();
  } catch (Throwable e) {
    e.printStackTrace();
  }
}```
#

Dutch it should be irrelevant

light geyser
#

sweet, redoing BuildTools now, will let you know if its fixed afterwards

naive goblet
#

Yeah I assume you don’t run buildtools in some weird directory

light geyser
#

On my A drive, basically next to my workspace dir 🙂

tame drum
#

i really hope i dont have to make new account lol cuz i had alot of plugins on my original account 😩

rare prairie
#

Conclure, don't use Throwable in these situations, just use IOException by default generated, because Throwable catch all exceptions and errors, like LinkageError | SystemException

naive goblet
#

Huh

#

It was a pseudo code lol and for the record I’d be happy to catch all possible exceptions

#

Come with something relevant if you’re going to nitpick

sour perch
#

big oof

rare prairie
#

Ok, but if that method does not contain that exception throws? Then it makes no sense

naive goblet
#

Wdym

#

What’s your point?

rare prairie
#

@tame drum login with your desktop computer change your account password, and login with your mobile

#

Brah, Don't use Throwable

tame drum
#

@rare prairie okay ill try that

naive goblet
#

@rare prairie why not lol

#

Give me an actual solid argument why it shouldn’t be used

light geyser
#

BUildTools>Extracting the Git stuff got really slow 🤔 jeez

sturdy oar
#

why generalizing with Throwable, when the only throwable you need to catch is IOException

sour perch
#

Catching Throwable is super bad

naive goblet
#

I’m on mobile and can’t remember what exceptions it throws

#

SirYwell that’s not an argument

frigid ember
#

Throwable includes Error

sturdy oar
#

IOException extends Exception, which extends Throwable

naive goblet
#

But yeah it would only be necessary to catch IOE

light geyser
#

So curious, is there any way to force apply an enchantment to an item?

sour perch
frigid ember
#

Catch Exception if you want to generalize

rare prairie
subtle blade
#

Catch Exception if you want to generalize
please don't

sturdy oar
#

ahah imagine doing error handling, C programming gang here

frigid ember
#

What is the name of 'glazed terracotta' on spigot?

tame drum
#

@rare prairie it didn't work 2Fa still there:/

naive goblet
#

montlikadani that’s not specific but I get the point

rare prairie
#

This happens if you writing fast

naive goblet
#

@subtle blade if you have a method with a lot of exceptions being thrown just catch them all with Exception instead of Exc1 | Exc2 etc?

subtle blade
#

Or write proper methods that don't throw a dozen exceptions

naive goblet
#

Not my fault other methods throws a bunch of them

subtle blade
#

Catch Exception is one of the more unreadable things you can do

sour perch
#

Catching Exception is still bad practice but not as critical as catching Throwable

naive goblet
#

Depends

tame drum
#

I juat reset my password and it still needs 2fa code rip

naive goblet
#

True

frigid ember
#

^

subtle blade
#

You're also going to end up having logic errors you can't track down. If your code isn't working because your catch block is supressing an undeclared exception, you're in for a world of hurt

#

Do not catch Exception

sour perch
#

^

naive goblet
#

Only reason why you’d avoid catching Exception is if you want to handle different exceptions differently

sturdy oar
#

ehm no?

sour perch
#

not really

tame drum
#

So I can't re add 2fa info on my Google authentication cuz it needs key 🙃

subtle blade
#

I literally gave you 2 very good reasons not to catch Exception

#

Logic errors and readbility

rare prairie
#

I only use when using reflections

naive goblet
#

I can see the point of the first one but I wouldn’t certainly say it gives less readability but it depends I guess

sour perch
#

even then you can catch ReflectiveOperationException

naive goblet
#

^

tame drum
#

@rare prairie what can i do...?

frigid ember
#

honestly i'd rather not catch exception

light geyser
#

Ive got a feeling its not normal for buildtools to be stuck here for at least 10 mins

rare prairie
#

@tame drum I don't know, ask spigot web devs

lapis plinth
#

@naive goblet and how would I fetch string data inside of the .json file?

subtle blade
#

Catching ROE is much different than catching Exception. ROE was added for that very purpose - so you didn't have to catch 4 exceptions for reflective operations

tame drum
#

Hmm okay I can try is it ok to ask them on here?

naive goblet
#

How are you doing it currently?

#

Sentaku I mean essentially try contact an admin?

tame drum
#

I have no way on spigotmc I cant post or message directly there cuz of 2fa locked me out

#

Thats why i had to come here to try find solution

lapis plinth
#

How are you doing it currently?
@naive goblet I'm not doing it at all currently, thats y i need help with it xD

naive goblet
#

True Choco but I still think sometimes catching Exception is doable in the right context

odd knoll
#

@lapis plinth from that JsonObject you can get("property").getAsString()

lapis plinth
#

oi hi zak

odd knoll
#

Hey.

naive goblet
#

Doesn’t spigot have a json lib?

odd knoll
#

Got bored of talking to JetBrains devs.

naive goblet
#

Lol

tiny pebble
#

is there an event such as PlayerItemHolding that checks for when a player is holding a certain item?

tame drum
#

I notice that Choco is the admin on forum maybe I can ask chocolate on here to try disable 2fa so I can login then reactivate so my stupid Google authentication can save it again?

#

Choco*

naive goblet
#

Tag him ?

#

he has his rank for reason (:

lone fog
#

There is an event for that

#

Let me look it up

naive goblet
#

@tiny pebble I think else you might have to listen to packets

tame drum
#

@subtle blade may i request your help on fixing my account so I can login and re-enable 2fa so my Google authentication can save it cuz when I transfer data from old phone for some reason it didn't save spigotmc code

lapis plinth
#

@naive goblet would I have to define the path?

lone fog
#

PlayerItemHeldEvent

naive goblet
#

Path of?

lapis plinth
#

like plugins/pluginname/

naive goblet
#

nope

lapis plinth
#

path of where the json file should go

#

kk

naive goblet
#

Obtain the plugins folder with JavaPlugin#getDataFolder()

#

And seperate dirs with /

lapis plinth
#

kk

lone fog
#

Please use File.separator

naive goblet
#

It’s not necessary but it’s better

lapis plinth
#

private final Path path = Paths.get("plugins/ValueCore/Data/"); Is this also fine? or do I haev to use Javaplugin#getDataFolder

tiny pebble
#

@lone fog That seemed to refer to the last item being held. I wanted it to duplicate the diamond sword in my hand while i held it, and after I switched from it then it duplicated it (put in offhand)

#

just testing tbh but cant find the method

lone fog
#

Use event.getNewSlot

naive goblet
#

File file = new File(pluginInstance.getDataFolder(), “config.json”);

#

Coll it doesn’t really matter at all

opal bay
#

should I use json for my config files? 🤔

naive goblet
#

Yes pls

opal bay
#

ok thank u

#

I shall use json now

naive goblet
#

ThugBirb ^

opal bay
lapis plinth
#

:kek:

opal bay
tiny pebble
#

getNewSlot() calls for an integer... still not it

lone fog
#

Yes

#

And then you get the item in that slot

tiny pebble
#

should be the slot in which the player is holding the item, not a specific slot? whichever one the player is holding

naive goblet
#

Tanku what are you really trying todo