#help-development

1 messages ยท Page 619 of 1

eternal night
#

True that

pseudo hazel
#

lol

#

I just save a bunch of basic type data xD

#

I didnt know you can make your own type

eternal night
pseudo hazel
#

well I mean I figured since its written vey generically

#

but I never wondered how I would actually make it

tender shard
#

PersistentDataType<?, ChickenWing> CHICKEN_WING_DATA_TYPE

pseudo hazel
#

yeah where chicken wing probably implements some interface

shadow night
#

What

#

That's the most random thing to see when opening a channel

tender shard
#

you must have missed the Carlos conversation yesterday then

shadow night
#

Yeah

#

I'm not so active here since I'm dead

tender shard
#

just search for "carlos" and you'll find hundreds of messages from yesterday

shadow night
#

Got lucky to have a internet connection

#

Thank god there is now public wifi in whatever the word for where people get burried is

orchid gazelle
#

graveyard

tender shard
#

you can declare custom graveyards ingame with /acgraveyard or manually using graveyards.yml

orchid gazelle
#

Lmao alex

tender shard
#

it's true

orchid gazelle
#

Nice

tender shard
shadow night
#

I would say "I'm dying rn", but I'm already dead

tender shard
#

oh it's messed up

#

why does every line end with a hashtag

shadow night
#

Idk shit about plugins, I only make my own lol

orchid gazelle
orchid gazelle
#

What a coincidence that the random letter gen actually made something that makes sense

strange rain
#

no context moment

shadow night
#

Yk, I'm that guy who has never played the vanilla version of the game and never adjusted the modifications himself so I end up knowing like 3 modding apis and not knowing the simplest mod ever

tender shard
#

as byte array ofc

strange rain
#

PersistentDataContainer == KFCBucket confirmed

shadow night
tender shard
#

since CHickenWing implements ConfigurationSerializable, it's just a COnfigurationSeriazableDataType -> DataType.asConfigurationSeriazable(ChickenWing.class)

orchid gazelle
nova notch
#
public static PersistentDataType<Integer, Integer> type(Player player, NamespacedKey key) {
        PersistentDataContainer data = player.getPersistentDataContainer();
        if (data.has(key, PersistentDataType.STRING)) {
            return PersistentDataType.STRING;
        }
        if (data.has(key, PersistentDataType.INTEGER)) {
            return PersistentDataType.INTEGER;
        }
        // and all other types
        return null;
    }```
is it possible to make this able to return any type of persistent data type
shadow night
#

I had experience with forge 1.12.2, 1.16.5; fabric 1.16.5; spigot generally

nova notch
#

what ๐Ÿ’€

tender shard
#

what is that

nova notch
#

im trying man

strange rain
tender shard
orchid gazelle
#

I used forge 1.12.2 and spigot on 1.8, 1.12, 1.18, 1.19 and 1.20

nova notch
#

what code

tender shard
#

your method is supposed to return a PersistentDataType<?,?>, instead of Integer,Itneger

#

otherwise the method is pretty useless

orchid gazelle
#

I only coded plugins on 1.8 and 1.12 until 2 years ago

nova notch
#

ik thats why im trying to make it return any of them

tender shard
#

then declare your method to return a DataType<?,?> instead of a specific one

nova notch
#

ok

orchid gazelle
#

I'd never use PDC without some wrapper lol

#

Didn't you implement it alex?

nova notch
#

first time using question marks in code

orchid gazelle
#

I have never used it because it literally looks senselessly complicated

tender shard
#

its not complicated at all

#

oh you mean what I sent yesterday? well I jut randomly made that up

nova notch
#

he says, with 75 years java experience

orchid gazelle
#

It just looks useless

#

Like, bloat

tender shard
#
public final class PDC {
    public static interface Type<P,C> extends PersistentDataType {}
    
    public static <T> void set(Player player, String key, PersistentDataType<?,T> type, T value) {
        player.getPersistentDataContainer().set(NamespacedKey.fromString(key, myPlugin), type, value);
    }

    public static <T> T get(Player player, String key, PersistentDataType<?,T> type) {
        return player.getPersistentDataContainer().get(NamespacedKey.fromString(key, myPlugin), type);
    }
}
PDC.set(player, "age", PDC.Type.INTEGER, 27);
int age = PDC.get(player, "age", PDC.Type.INTEGER);
orchid gazelle
#

Why don't just use container.put(Type.String, "ajjshs");

orchid gazelle
#

It could be that easy

tender shard
#
  1. Type does not exist, it's called PersistentDataType
  2. it takes in a NamespacedKey, not a string
  3. where's the value?
orchid gazelle
#

I meant that it should be like this

tender shard
#

in my example yuo can only use Type because I declared another interface that extends PersistentDataType, as ahacky workaround to do sth like import aliases

#

because tbh yeah lynx was a bit too verbose with all the PDC names lol

orchid gazelle
#

It could be so easy

#

just like.. implement all Types you need

tender shard
#

i mean, it already has all types that NBT supports, plus additionally a boolean, and for everything else there's ?morepdc

nova notch
#

this is my life now

tender shard
#

Should work

orchid gazelle
#

How many bytes can I save in a pdc?

tender shard
#

As many as you want in theory, i guess

orchid gazelle
#

But it isn't async right

tender shard
#

Its in memory once its loaded

#

Its basically just a map

orchid gazelle
#

So if I load an item that has a pdc, it's in mem and can be read/written async?

tender shard
#

Not sure

#

I mean, the javadocs always claim not to use bukkit api async

orchid gazelle
#

Well I wanna know when it makes sense to use caching, when use a db and when use pdc

sullen marlin
#

PDC for items is from ItemMeta right?

#

That's a clone so you can use your own clone async

tender shard
sullen marlin
#

But get/set meta calls can't be safely async

tender shard
#

Makes sense

pseudo hazel
#

hmm yes I am good with naming my functions dont worry about it ```java
void startPlayerCountTimerIfMinCountReached() {

}```
buoyant viper
silver robin
#

Hey everyone, this might be more of a java question but probably fits this context too. I don't know how to phrase it, but if I create a repeating task like this (in onEnable for example) does the "mainWorld" variable have any risk of getting garbage collected or lost? (the only reason because I'd like to have short code)```java
public void onEnable() {
World mainWorld = Bukkit.getWorld("world");
// repeating task
Bukkit.getScheduler().runTaskTimer(this, () -> {
thisCodeIncludes(mainWorld);
}, delay, period);
}

flint coyote
#

It's still in use so I don't think so. More people would run into issues with it then

#

If you wanna be sure, try to call System.gc() in your scheduler (don't run that every tick for this test) and see if you run into problems

wary harness
#

there is no Inventory.remove which can remove itemstack regardles of stack amount?

#

or am I mistaking

young knoll
#

removeItem

young knoll
wary harness
#

but looks like that is not possible

#

basicly making shop neeed to remove all of custom itemstack

young knoll
#

All?

wary harness
#

and then subtrackt them and return amount which has left

nova notch
#

how do i store an array in PDC theres no type for it

young knoll
#

PhantomRefrence still confuses me

#

Its like a weak reference but you can detect when it gets cleared?

young knoll
nova notch
#

man are you serious

undone axleBOT
nova notch
#

ok good

ivory sleet
#

actually just use weak maybe

#

i am prob overthinking lol

shy forge
#

OfflinePlayer instances not matching for same player

quaint mantle
nova notch
#

of course its made by that alex guy, dudes an actual genius

tranquil prairie
#

?paste

undone axleBOT
tranquil prairie
#

Im making a case opening plugin but for some reason in this example the diamond never lands on the middle slots and it feels like the closer to center the slot is the rarer the chances are for the diamond to land on it. https://paste.md-5.net/eviliqakuh.cs

hybrid spoke
rough drift
tender shard
#

what is that supposed to match? it'll basically anything that contains a 5 and later on a 4

waxen plinth
#

based based based

#

also based

quaint mantle
onyx fjord
#

It's memory safe understandable

#

Did I mention it's memory safe

proud sapphire
#

how can i get the custom biome name at a location in 1.20.1?

limpid oasis
#

can i get help here about errors in console?

onyx fjord
#

You wanna use jetbrains runtime on your server as java

#

Or whatever it's called

#

It improved hot swapping

#

Improves

proud sapphire
tender shard
#

np

wise mesa
#

You may want to consider renaming the project to avoid confusion with the tokio runtime

young knoll
#

Maybe they should rename their project

wise mesa
#

When people hear โ€œTokyo rustโ€ they think of tokio

#

If course not saying you have to

young knoll
wise mesa
#

Just an outside perspective

zenith gate
#

What does this mean? I cant find anything on google...

waxen plinth
#

just delete the semicolon, wait a second and add it back

#

I think that's just an ide bug that'll go away when it refreshes it

sullen marlin
#

Concerning

waxen plinth
#

what ide is that

zenith gate
#

I am using Fleet

waxen plinth
#

I KNEW IT

zenith gate
#

its new in preview

waxen plinth
#

I RECOGNIZED THE POPUP

zenith gate
#

i love fleet tho

waxen plinth
#

yeah it does that a lot

#

either restart smart mode

zenith gate
#

first tinme it happening it to me

waxen plinth
#

or add a syntax error and then remove it

zenith gate
#

ahhh okay

waxen plinth
#

no I used fleet for rust and it happened literally constantly

#

I wonder if it's better by now

zenith gate
#

setting maven up for this was a pain in the ass. it wouldnt want to save where my maven install was lol

waxen plinth
#

nope, still broken ๐Ÿ’€

zenith gate
#

lol

waxen plinth
#

I reported this exact bug months ago and they marked it as fixed

young knoll
#

Tf is a fleet

waxen plinth
#

still happens

#

jetbrains vscode

young knoll
#

I see

zenith gate
#

i like it a lot. very light weight. easier for my macbook lmao.

waxen plinth
#

I've since switched to helix

#

I prefer helix now

zenith gate
#

helix?

waxen plinth
#

fleet would be very nice if it actually worked properly

zenith gate
#

dont think ive heard of that one.

waxen plinth
#

it's an all-in-one vimlike

#

with lsp support and very good defaults

zenith gate
#

ahhh okay. i could never grasp vim. i tried. i see all the good it has. but the keymaps. to hard for me to remember lol.

waxen plinth
#

did you use the tutor

#

helix has one too, helix --tutor

zenith gate
waxen plinth
#

lol

unreal quartz
#

I use vsc with the neovim extension

#

Configuring neovim with lua pisses me off irrationally (and using vimscript is even worse)

zenith gate
#

i only use vscode for JS and python, sometimes C# lol

waxen plinth
#

helix doesn't actually have plugin support right now

zenith gate
#

neither does fleet ๐Ÿ˜ฆ

waxen plinth
#

but it has lsp support and it comes with everything you need out of the box

#

I like to use it with zellij

#

I have one pane for helix, one for a terminal and one for bacon (basically an errors/warnings panel)

zenith gate
#

yo you got bacon?

waxen plinth
#

and this is perfect, it's exactly what I want and nothing more, nothing less

#

yeah bacon's sick

#

you know bacon..?

zenith gate
#

i know of it. seen it around youtube a few times.

waxen plinth
#

interesting

#

do you watch rust youtubers or something

#

like no boilerplate

#

or let's get rusty

#

lol

zenith gate
#

and the prime time

trail coral
zenith gate
#

he my go to guy

waxen plinth
#

ah there we go

waxen plinth
trail coral
#

it makes me look like a hacker in the hollywood movies

#

i dont like it

tranquil prairie
#

Im making a case opening plugin but for some reason in this example the diamond never lands on the middle slots and it feels like the closer to center the slot is the rarer the chances are for the diamond to land on it. https://paste.md-5.net/eviliqakuh.cs

waxen plinth
#

hold on

zenith gate
trail coral
#

ik but

#

its too "tech-y"

#

its big boy shit

zenith gate
#

i agree lol. i like the simplistic.

waxen plinth
#

now this is hackercore

trail coral
#

i feel like i would never need to use an editor like that and ill just be using it cuz its "better" not bcuz i actually like it

zenith gate
trail coral
#

this is C right?

waxen plinth
#

my guy that is the dumbest reason to not use it lol

hybrid spoke
waxen plinth
#

no that's rust

trail coral
#

fuck

waxen plinth
waxen plinth
#

and if you don't think it's for you, that's fine

unreal quartz
waxen plinth
#

but you should probably base it on its actual utility to you

#

and not social value

zenith gate
#

Yeah for most people. no one really needs to leave vscode. its all about the utilities of other ides is when you switch.

trail coral
waxen plinth
#

like who tf uses an editor for the clout ๐Ÿ˜ญ

trail coral
zenith gate
#

some people in the vim community have their opinions lmao

trail coral
#

use it just so they can say they use it

waxen plinth
#

yeah of courrse they flex it

#

but that doesn't mean they're just using it for the clout

trail coral
#

a lot of people switch just for that

waxen plinth
#

just to flex

zenith gate
#

which is true. Neovim is insane.

waxen plinth
#

that's so stupid

trail coral
#

bro

#

are you every single programmer?

waxen plinth
#

but it's not just hype

#

there's good reasons for it

#

at least a few of these keybinds are game changers

#

like alt + o has to be one of my favorites

trail coral
#

what does it do

zenith gate
#

plus Neovim can be set up to never use your mouse correct?

#

everything keymapped ?

trail coral
#

yes

#

thats the beauty of it

unreal quartz
#

By default you cannot use your mouse unless your terminal supports it

waxen plinth
#

it highlights the parent ast node

#

each image here is 1 more time hitting alt + o

zenith gate
#

yeah thats nice.

waxen plinth
#

so, often

#

you'll want to select part of an expression

#

parenthesise it

#

and then prefix it with something to make that a function call

#

that's a common editor operation

#

this makes that super easy

#

I hit alt + o until I've selected what I want

#

then I type ms( which surrounds the selection in parentheses

#

then I hit i and type the prefix

zenith gate
#

i just use cmd + shift and arrow keys to highlight what i need.

trail coral
#

how long have u been using it

waxen plinth
#

yeah that's another good way

#

the keybinds for regular editors are no joke either

#

and you can do a lot with home + end too

#

that used to be my bread and butter before I switched to helix

waxen plinth
trail coral
#

is it good?

waxen plinth
#

yeah I really like it

#

it's surprisingly easy to adjust with the tutor too

#

it does a good job of teaching you the basics

#

helix --tutor

limpid oasis
#
[00:18:55 WARN]: Unexpected character (e) at position 6861.
[00:18:55 WARN]:        at org.json.simple.parser.Yylex.yylex(Yylex.java:610)
[00:18:55 WARN]:        at org.json.simple.parser.JSONParser.nextToken(JSONParser.java:269)
[00:18:55 WARN]:        at org.json.simple.parser.JSONParser.parse(JSONParser.java:118)
[00:18:55 WARN]:        at org.json.simple.parser.JSONParser.parse(JSONParser.java:92)
[00:18:55 WARN]:        at me.f64.playtime.Main.writePlayer(Main.java:164)
[00:18:55 WARN]:        at me.f64.playtime.Main.lambda$savePlayer$3(Main.java:150)
[00:18:55 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59)
[00:18:55 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
[00:18:55 WARN]:        at org.github.paperspigot.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:23)
[00:18:55 WARN]:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[00:18:55 WARN]:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[00:18:55 WARN]:        at java.lang.Thread.run(Thread.java:748)

how i can fix this?

waxen plinth
#

the default configuration is so good that I only have 3 settings changed at all

trail coral
#

eh im kinda taking a break off of programming rn

waxen plinth
#

try looking at position 6861 in the string

trail coral
#

maybe ill try it

limpid oasis
#

where

#

xd

waxen plinth
#

position 6861

#

6861 characters into the string

#

click on the start and hit the right arrow 6861 times

young knoll
#

Yeah start counting

zenith gate
#

lmao

limpid oasis
waxen plinth
#

best pitch I can give for helix and vimlike editors in general

trail coral
#

bros actually gonna do it

zenith gate
#

the real way to fix problems

waxen plinth
#

is that it turns coding into a movement game

limpid oasis
#

no fr i need help

waxen plinth
#

and fr go to position 6861

waxen plinth
#

is this a plugin you made

trail coral
#

dude

waxen plinth
#

this channel is for helping plugin developers, not giving support for plugins

limpid oasis
trail coral
zenith gate
limpid oasis
#

ok come to help server ๐Ÿ™‚

waxen plinth
#

so this is the wrong channel to ask unless you are the developer of the plugin

hazy parrot
#

Open it in notepad++ and find character 68xy lol

limpid oasis
#

sorry

limpid oasis
trail coral
#

whats that mean

unreal quartz
# trail coral maybe ill try it

There's probably a vim plugin for your favourite editor if you want to get used to the movement if you don't want to leave the comfort of your current editor

hazy parrot
unreal quartz
#

Tho some are lacking

trail coral
hazy parrot
#

Serbian

trail coral
#

its read like Webia eight?

#

WW idk how to explain it

hazy parrot
#

What

waxen plinth
#

helix does work differently from vim in a few key ways though

limpid oasis
unreal quartz
trail coral
#

wtvr its read like that in russian

waxen plinth
trail coral
#

i just absolutely FIESTED and its 4:30 am idk why im not going to slee

#

i need help

zenith gate
trail coral
#

im so relaxed and sleepy but i dont actually go to sleep wtf is wrong with me

zenith gate
#

turn your wifi off

zenith gate
#

vault is primarlily used with ecnonmy right? same with like an auctionhouse and stuff?

vital sandal
#

Do you guys have any solution for ghost items in GUI?

zenith gate
vital sandal
#

with high enough ping people abled to get ghost items

#

and with creative mode

zenith gate
#

ohhh...

vital sandal
#

if player click that item it become real

zenith gate
#

even if its cancelled ?

vital sandal
#

yes

sullen marlin
#

with creative mode they can get everything anyway

vital sandal
#

and even with sometask like cancelation grindstone

zenith gate
#

or no way around it?

vital sandal
#

player with quick enough hand they are abled to do it

sullen marlin
#

I mean you can look at InventoryCreativeEvent

pseudo hazel
#

simple, dont give them creative

vital sandal
#

I just assume it giving potential bugs

sullen marlin
#

creative mode is broken from a security perspective and mojang has never fixed it

flint coyote
sullen marlin
#

client can do pretty much anything it likes in creative

vital sandal
quaint mantle
#

We run survival on 1.20.1 and we've tried both paper and spigot but the servers keep crashing but produce no crash log, what should we do?
This also happens with our lobby servers running paper on 1.8.8, they don't create crashlogs either.

I said this before in help server, this has become such a big issue the owner has switched to unturned. I don't know what we can do anymore, the owner has been constantly researching and nothing has been discovered.

zenith gate
#

Well anyways still #help-server , but besides that, no one can really know whats going on, there is no context, and no logs, idk how i am supposed to know whats going on. start debugging. remove plugins 1 by 1, or only host 1 server and try it. you got to isolate the error.

#

if it is a plugin, report it to the dev. if not, then something else wrong lol.

golden turret
#

how do i get the anvil block from the AnvilInventory?

#

just found the getLocation

unborn sable
#

Is there a way I can add NBT data to an item instead of manually setting it when used and storing the data in a Persistent Data Container? I have heard that I can use NMS but do not know how to import it. I have BuildTools in a folder in my Downloads and I have the dependency listed in the pom.xml file. I got the error Missing artifact org.spigotmc:spigot:jar:1.20.1-R0.1-SNAPSHOT when adding the dependency to the xml.

zenith gate
#

do you have spigot in your dependency?

#

and repo

unborn sable
#

Yes

river oracle
#

also use moj maps

#

?nms

unborn sable
#

What do I do with it though

#

Itโ€™s in a different directory too

rigid otter
#

Hello, which one is faster performance between registering a single event listener and registering a class implementing Listener?

#

Beyond this, I see BungeeCord doesn't provide single event listener registering.

flint coyote
#

For 99% of use cases it does not matter at all. Or do you wanna register und unregister dozens of listeners every second?

rigid otter
#

Oh OK, just asking because sometimes I want to register via single-event-listener model.

raw epoch
#

Hello !
I've somes troubles with my build.gradle i just added a compileOnly path and it broken an other one ๐Ÿคทโ€โ™‚๏ธ (PacketWrapper) i've follow the docs of this depencies and it make no sence that i've got a error xd

here is my stack and my build.gradle

Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Could not find com.comphenix.packetwrapper:packetWrapper:1.20-2.2.1.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/comphenix/packetwrapper/packetWrapper/1.20-2.2.1/packetWrapper-1.20-2.2.1.pom
       - file:/C:/Users/Wast/.m2/repository/com/comphenix/packetwrapper/packetWrapper/1.20-2.2.1/packetWrapper-1.20-2.2.1.pom
       - https://arcanearts.jfrog.io/artifactory/archives/com/comphenix/packetwrapper/packetWrapper/1.20-2.2.1/packetWrapper-1.20-2.2.1.pom
       - https://repo.ranull.com/maven/external/com/comphenix/packetwrapper/packetWrapper/1.20-2.2.1/packetWrapper-1.20-2.2.1.pom
     Required by:
         project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
plugins {
    id 'com.github.johnrengelman.shadow' version '7.1.2'
    id 'java'
}

group = 'fr.citeevent'
version = '1.0-SNAPSHOT'

apply plugin: 'java'
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
jar.getArchiveFileName().set("${project.name}.jar")
libsDirName = "${jarOutput}"

shadowJar {
    from('src/main/java') {
        include "fr/citeevent/artemiscite/database/storage.sql"
    }
}

repositories {
    mavenCentral()
    mavenLocal ()
    maven { url "https://arcanearts.jfrog.io/artifactory/archives" }
    maven {
        url = 'https://jitpack.io'
        url = 'https://oss.sonatype.org/content/repositories/snapshots'
        url = 'https://oss.sonatype.org/content/repositories/central'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
        url = 'https://repo.dmulloy2.net/repository/public/'
        url = 'https://repo.lukasa.lt/repository/maven-public/'
        url = 'https://repo.ranull.com/maven/external/'
    }
}

dependencies {
    implementation 'org.jetbrains:annotations:24.0.1'

    //BDD
    implementation group: 'com.zaxxer', name: 'HikariCP', version: '4.0.3'
    implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.0.8'

    //Plib
    compileOnly 'com.comphenix.protocol:ProtocolLib:5.0.0'
    implementation 'com.comphenix.packetwrapper:packetWrapper:1.20-2.2.1'

    //NPC
    compileOnly group: 'dev.sergiferry', name: 'playernpc', version: '2023.4'

    // Spigot
    compileOnly 'org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT'

    //Holo
    compileOnly 'me.filoghost.holographicdisplays:holographicdisplays-api:3.0.0'

    // Lombok
    compileOnly 'org.projectlombok:lombok:1.18.26'
    annotationProcessor 'org.projectlombok:lombok:1.18.26'
}

sourceSets {
    configurations.compileOnly.setCanBeResolved(true)
}

def targetJavaVersion = 17
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}

artifacts {
    archives shadowJar
}
#

if someone can help me ๐Ÿ™

quaint mantle
#

What packet do I need to send to ack a block break?

fervent robin
#

If you just want the block break effect then PacketPlayOutWorldEvent

tranquil prairie
#

In the vid it shows the items falling in random directions which is what #dropItemNaturally does but im using #dropItem

rigid otter
#

Hello, does ExplosionPrime event detects all explosions?

rigid otter
#

Because minecart with tnt bypass this event, that's why I'm asking here.

wet breach
#

There is EntityExplodeEvent and BlockExplodeEvent

#

and some others

echo basalt
#

World#createExplosion doesn't trigger it

#

Iirc

upper hazel
#

who can say how much the plugin costs for the event that spawns in rtp coordintates the territory inside which they earn money every second

zenith gate
#

ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta itemMeta = item.getItemMeta();
if (item.getType() == Material.AIR) {
  sender.sendMessage(ChatColor.RED + "You must be holding an item to put up for sale.");
return true;
}


// Create the auction ticket item
ItemStack ticket = new ItemStack(Material.PAPER);
ItemMeta ticketMeta = ticket.getItemMeta();

// Set the display name and lore of the auction ticket
String displayName = ChatColor.GOLD + player.getName() + " - Auction Ticket";
List<String> lore = new ArrayList<>();
lore.add(ChatColor.GREEN + "Up for purchase - " + item.getItemMeta().getDisplayName());
lore.add(ChatColor.GREEN + "Price - " + ChatColor.GOLD + price);
ticketMeta.setDisplayName(displayName);
ticketMeta.setLore(lore);
ticket.setItemMeta(ticketMeta);


I don't know why and get zero errors, but I am trying to set the lore with the display name of the item the player is holding. It never sets. its just blank.

undone axleBOT
echo basalt
#

?pdc

zenith gate
#

the item gets replaced with the ticket. I want the name of the former item to be on it. because then later on the item will be in another inventory for the auction

upper hazel
#

not get

sharp kayak
#

How do I properly change the chat format of players? Using e.setFormat() is working but it says [Not Secure] in console.

eternal night
#

I mean, it isn't secure if you change the format

#

so that is to be expected

sharp kayak
#

So how do i do it? cancel event and broadcast the message?

eternal night
#

just accept it ?

#

ยฏ_(ใƒ„)_/ยฏ

sharp kayak
#

oh

eternal night
#

its not bad ๐Ÿ˜…

#

just means the method was modified

quaint mantle
#

how can I send the particles and sound to a player when given a block (the particles and sound of them breaking a block)

vast ledge
#

there should be an nms packet

#

if not you can try sending particles

quaint mantle
#

I'm not exactly sure what sound to play and what particles and where ect more details about them

#

I have BuildTools open to see how minecraft handles normal block breaks but i cant find it

echo basalt
#

There are packets for that kind of stuff

sullen marlin
quaint mantle
#

I will retest the block destruction packet since I had the percent at 10 instead of 100

Edit: Did not work

echo basalt
#

mhm sounds are part of the block properties

#

I wonder if those are epxosed

lilac dagger
#

@quaint mantle playEffect Effect.STEP or something like that

#

you don't need packets for that

vast raven
#

Why it keeps saying "New flags cannot be registered at this time"

#

I even scheduled 10s after the enable

eternal night
#

Given that that isn't a spigot error message, what are you doing specifically ?

#

can you share some code

vast raven
#

registering a WG flag

eternal night
#

according to this, you need to define that onLoad

#

not onEnable

hearty moat
#

Could anyone tell me how do I change lore's text formatting? Using ChatColor throws "Operator '+' cannot be applied to 'org.bukkit.ChatColor', 'java.util.List<java.lang.String>'"

private ItemStack getItem(ItemStack item, String name, String ... lore) {
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(ChatColor.DARK_PURPLE + name);
        meta.setLore(Arrays.asList(lore));

        item.setItemMeta(meta);
        return item;
    }
hazy parrot
#

You want every line of meta to have same color?

#

You are currently trying to add chat color and list, which doesn't work

hearty moat
hearty moat
hazy parrot
echo basalt
#

Or instead of streaming

hearty moat
#

So this is my formatting, although the text doesn't format according to the tags, it just shows the tags as plain text

inv.setItem(10, getItem((new ItemStack(Material.COMPASS)), "&5&lWarps", "&dAbre el menรบ de warps", "&dUsa los warps para ir a distintos sitios"));
echo basalt
#
List<String> list = new ArrayList<>();

for(String line : lore) {
  list.add(...);
}

...
#

mhm that's a crunchy way of doing menus

#

You should probably consider some sort of config-based system

hearty moat
echo basalt
#

I'd start by making an "item builder"

#

Something like this

#

You can then just load the items from the config by just getting the section and calling ItemBuilder#fromSection and doing magic with it

hearty moat
#

Okay thank you

echo basalt
#

Ideally you'd also make a menu system that can load entire menus from a config

#

But that takes time and skill ๐Ÿ˜›

#

But y'know if you want some inspiration

#

Menus aren't that complex

cobalt thorn
torpid idol
#

i have a quick question

#

how can i send when a player got tempmute to not only send the message that he has been muted only to him

onyx fjord
torpid idol
#

so the message can be send in chat for everybody

onyx fjord
#

broadcast

echo basalt
#

yeah a bit

onyx fjord
#

I mean just gui and pagination can be done in 1 class

torpid idol
#

how can i send when a player got tempmute to not only send the message that he has been muted only to him
but the message should be send in chat for everybbody to see

#

?

onyx fjord
#

I do something similar to crafting recipes

echo basalt
#

uhh

#

uhh

#

this is a bit nested

grizzled oasis
#

simple thing how you can parse "1mm 2w 1m" example of a placeholder

echo basalt
#

except you'd need to change the split logic

#

as I just use this for things like 15 seconds

grizzled oasis
#

lol

echo basalt
#

Or you can go full baller

#

and do regex

grizzled oasis
#

Nah dude i have PTSD for regex after last time

echo basalt
#

With a basic \d+(\w+)

onyx fjord
#

Dividing + modulo

#

For each unit

#

And then append

echo basalt
#

wah

onyx fjord
#

I hate regex

#

Even tho I had a whole course about it

echo basalt
#

I did a 1 hour tutorial and it's enough to do basic regex

#

anything more complex and chatgpt does it for me

onyx fjord
#

I wouldn't use it where you can avoid it

echo basalt
#

throwback to when I was "helping out" with a simplistic private static final Pattern REGEX = Pattern.compile("if\\s*(!)?\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*(<|>|=)?\\s*([a-zA-Z0-9_]+)?\\s*then");

grizzled oasis
upper hazel
#

RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class); == null why??

upper hazel
#

I connected the vault api 1.7.1 plugin, but for some reason the plugin does not find it, although it exists

#

in mavent all correct

#

?paste

undone axleBOT
upper hazel
eternal night
#

share your pom

echo basalt
#

It could be that your plugin enabled before the economy was registered

#

try doing those checks a tick after plugin startup (use the scheduler!)

upper hazel
#

how fix

echo basalt
upper hazel
#

?paste

undone axleBOT
upper hazel
eternal night
#

Yea maven not all correct

upper hazel
#

a

eternal night
#

you are missing the provided scope on both worldguard-bukkit and vaultAPI

upper hazel
#

what is it for

eternal night
#

to tell maven that the classes of that dependency will be provided by your runtime

#

and maven does not have to include them in your output artefact

upper hazel
#

still not working

eternal night
#

you recompiled and updated the jar ye ?

#

you have a dependency on Vault in your plugin.yml as well ?

upper hazel
#

yes

grizzled oasis
#

something im saving the date when the multipliers will finish but in timeunit and if how can i check them, so if the server stops i can start a Runnable and check them

shadow night
#

Is there some persistent data container that can be stored worldwide? Like, there's pdc for chunks, for entities, items, is there pdc for worlds tho?

shadow night
#

Well, that's not pdc

sullen canyon
#

base64 brrother

placid moss
#

config files

icy bone
#

Is there someone who got the time and want to help me out with this one?
I am trying to make simple code that prints a messsage to the player if its standing still on the same block for 3 seconds. (is has to be same block and not same coords, I want the player to be able to walk a little bit inside the block)
If created this:

    public void onPlayerMove(PlayerMoveEvent e) throws IOException {

        Player player = e.getPlayer();

        BukkitRunnable moveTask = new BukkitRunnable() {
            @Override
            public void run() {
                player.sendMessage("You've  been standing still for 3 seconds. [" + e.getPlayer().getLocation().getBlockX() + " / " + e.getPlayer().getLocation().getBlockY() + "]");
            }
        }; moveTask.runTaskLater(plugin, 60L);

        if(e.getTo().getBlockX() != e.getFrom().getBlockX() || e.getTo().getBlockY() != e.getFrom().getBlockY() || e.getTo().getBlockZ() != e.getFrom().getBlockZ())
        {
            moveTask.cancel();
        }```
but for some reason this task keeps spamming when Im running. Does someone know why, because im not seeing it yet
#

The goal is that the player recieves once message the moment it standing still for 3 seconds

pseudo hazel
#

player move happens a lot

icy bone
#

Thats true

pseudo hazel
#

but you create a task every time it happens

icy bone
#

Yeah and im canceling that task if the player is moving

pseudo hazel
#

thats an insane amount of tasks

icy bone
#

That is true

pseudo hazel
#

you can move without changing blocks though

icy bone
#

Yeah like look around

pseudo hazel
#

like minecraft does not have grid based movement

#

or just move an inch

icy bone
#

Yeah but there is no event that triggers when changing block location

#

So i can either use this event or create a bukkit runable

pseudo hazel
#

whats the goal of this anyways

icy bone
#

Im creating a PropHunt and im using a display block to move around, but if the player is standing still for 3 seconds, i want to remove the display block and place a real block on that location

#

Already got the display block and setting the block, now only this detection system

pseudo hazel
#

and also its better to just not create a task if you know ur gonna cancel it instead of cancelling it instantly

#

okay then dont use block positions to check if a player has moved

icy bone
#

I see, what is a better solution or tactic to handle this problem, got any advice?

pseudo hazel
#

if a player didnt move, this even wont fire

icy bone
#

Yeah i do want the player to be able to look around

#

and if it moves a slight pixel but still stands on the same block to not count it has movement

tender shard
#

world implements PersistentDataHolder

tender shard
pseudo hazel
upper hazel
#

same problem

icy bone
#

Agree, it need one task per playe that just resets its time when someone moved

pseudo hazel
#

yes

tender shard
pseudo hazel
#

so you need to store those tasks outside of just the handler method

icy bone
#

Yeah like a seperate class?

pseudo hazel
#

like in map

icy bone
#

So HashMap the task and to create a map with a plaer and task

pseudo hazel
#

yes

#

well with player id but same thing

#

and then when the game starts, add every participant and start the tasks

icy bone
#

oh is storing player worse the id?

upper hazel
pseudo hazel
#

yes

tender shard
icy bone
#

Is that because of data size?

pseudo hazel
#

the Player object is not always valid, the uuid will always be valid as it is tied to an account

#

that too

icy bone
#

Ahh

pseudo hazel
#

a uuid is way smaller than the whole player

icy bone
#

Ill change that because i got some maps that stores players

tender shard
#

a player object is invalid if they rejoin

icy bone
#

Sounds good

tender shard
#

(or if they just leave without rejoining)

pseudo hazel
#

but yeah from there it should be easy

#

in the movement event check if they moved over a block, then reset the movement task

upper hazel
# tender shard what's the issue?

plugin not can find vault plugin for work. more precisely judging by the logs
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class); == null

pseudo hazel
#

which may be a bit server intensive but you would just have to try it out

#

maybe a better way entirely is to have 1 timer task and just store timestamps in the map

tender shard
icy bone
#

You gave me some new idea, ill try that and if im stuck ill comeback

tender shard
#

as I said, you don't have any economy plugin installed

upper hazel
#

Vault

tender shard
#

vault is not an economy plugin

upper hazel
#

wha

tender shard
#

you need an economy plugin

#

something that provides currency, /balance, etc

upper hazel
#

wth

#

what i need dowold

tender shard
#

any economy plugin that supports vault

#

EssentialsX for example

upper hazel
#

so then for what need vault if he not give valute

#

valute

tender shard
#

what?

pseudo hazel
#

vault makes sure you can interact with the economy of other plugins

tender shard
#

vault is an API so you can use different economy plugins so you don't have to write a module for every existing economy plugin

#

instead of writing a hook for EsesntialsX, and iConomy, and WhatEverEconomyPlugin, you just hook into vault

#

that's what it's for

#

vault itself doesn't do anything

upper hazel
#

vault not create dollars for use?

tender shard
#

correct

upper hazel
#

i not can give dollar player?

tender shard
#

you not can give dollar player

upper hazel
#

public void addMoney(Player player, double amount) {
if(amount < 1) return;
if(!api.hasAccount(player)){
Bukkit.getLogger().info(ChatColor.RED +"[LostZone] ะธะณั€ะพะบ ะฝะต ะธะผะตะตั‚ ะฐะบะบะฐัƒะฝั‚ะฐ ะฒ vault");
return;
}
api.depositPlayer(player, amount);
}

#

this work so

#

why

tender shard
#

if you claim that it works, then why do you claim here that it doesn't work

upper hazel
#

i mean this shold work

#

i see tutorial

tender shard
#

sure, it would work if you'd install an economy plugin

#

like EssentialsX

upper hazel
#

vault is like a conductor chtoli?

#

i no need use maven for another economy plugin? just dowold

upper hazel
tender shard
#

just install EssentialsX dude

#

no idea what a "conductor chtoli" is

upper hazel
#

i no need add in maven EssentialsX api for work?

#

just dowold

echo basalt
#

Just put the plugin in there

#

If you're not interfacing with or shading something there's no point in putting it in maven

tender shard
#

why did you even add vault to your dependencies if you have no clue what it is nor what it does lol

mossy dock
#
{
    "parent": "item/handheld",
    "textures": {
        "layer0": "items/shield"
    },
    "overrides": [
        {"predicate": {"custom_model_data":50000}, "model": "item/rings/fire_ring"},
        {"predicate": {"custom_model_data":50001}, "model": "item/rings/water_ring"},
        {"predicate": {"custom_model_data":50002}, "model": "item/rings/air_ring"},
        {"predicate": {"custom_model_data":50003}, "model": "item/rings/earth_ring"}
    ]
}

Any idea why the default shield isn't shjown?

deft thistle
#

why isnt the plugin finding the command

(paper-plugin.yml)
commands:
  puck:
    description: "Spawns the puck"
main class
  private void registerCommands() {
        this.getCommand("puck").setExecutor(new PuckCommand(this));
    }
(console error)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "pt.bonnie20402.hockey.Hockey.getCommand(String)" is null
        at pt.bonnie20402.hockey.Hockey.registerCommands(Hockey.java:22) ~[Hockey-1.0-SNAPSHOT.jar:?]
eternal oxide
#

paper

deft thistle
#

?

eternal oxide
#

this is Spigot so use a plugin.yml

deft thistle
#

I renamed it to plugin.yml

#

doesn't work either

#

do I just switch from paper to spigot in pom

eternal oxide
#

yes

#

build using maven not artifacts. (if Intelij) Right side of screen Maven tab, lifecycles -> package.

deft thistle
#

ok

#

mvn pakcage then

eternal oxide
#

yes

eternal night
#

as a heads up, paper-plugin.yml is still very experimental

#

you can just use plugin.yml on paper as well

deft thistle
#

I changed to spigot, done mvn package command, still same error, tbh I have no ideia why

public final class Hockey extends JavaPlugin {

    @Override
    public void onEnable() {
        createOjbects();
        registerCommands();

        this.getLogger().info("Hockey has been enabled!");

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
    private void registerCommands() {
        this.getCommand("puck").setExecutor(new PuckCommand(this));
    }
    private void createOjbects() { }
}

the plugin.yml

name: Hockey
version: '1.0'
main: pt.bonnie20402.hockey.Hockey
api-version: '1.19'
commands:
  puck:
    description: 'spawn a god damn puck'

I feel like it's such a small error but idk what's wrong

eternal night
#

I mean

#

did you update the jar ? in the servers plugin dir

#

mvn package will output to the target dir

deft thistle
#

yes I did, I even removed all the jars before compiling

#

and I reloaded maven so it downloaded all the stuff it needed to

eternal oxide
#

open your jar with any archive tool and make sure it contains the correct plugin.yml

chilly hearth
#

e

#

ok spoonfeeding a side

silent steeple
#

U can use jdec online to check the plug-in.yml

deft thistle
#

it still has paper-plugin too idk why but here is it

eternal oxide
#

you took jar from wrong location then

#

or you keep the paper yml in your project

deft thistle
#

bruh

#

i deleted ppaper-plugin

#

and it worked

#

๐Ÿคฏ ๐Ÿ”ซ

chilly hearth
#
  Entity entity = Bukkit.getWorld("world").spawnEntity(p.getLocation() , EntityType.WITHER_SKELETON);
        entity.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither");
        entity.setCustomNameVisible(true);
        entity.
#

i cant set the health

#

or equipment

#

or even get the inventory

#

of the entity

echo basalt
#

cast to WitherSkeleton

chilly hearth
#

let me ttry

#

OMG

#

THX

paper venture
#

if im not mistaken you should have at least casted it to LivingEntity

ivory sleet
#

^

chilly hearth
#

((WitherSkeleton) entity).setHealth(5000); wont this work ?

ivory sleet
#

it would

paper venture
#

it should

chilly hearth
#

fantastic

ivory sleet
#

I mean I would just have it so that the variable is of the type WitherSkeleton from the very beginning

paper venture
#

and call it witherSkeleton respectively

chilly hearth
#

btw

#

there is a probleme

#
public class customitem implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        if(commandSender instanceof Player);
        Player p =(Player) commandSender;```
#

i cant get the other args oncommand statement

ivory sleet
#

strings

chilly hearth
#

if i add it manually it gives me errors

ivory sleet
#

its an array

#

the variable strings is an array

#

and that array contains all arguments

paper venture
#

btw why do you have semicolon after if statement

chilly hearth
#

so i just use strings for arguments ?

chilly hearth
paper venture
#

i recommend you to learn java just a little bit

eternal oxide
#

; is wrong

chilly hearth
paper venture
#

i see

#

you should use {} instead

#

if (...) {
Player p....;
}

eternal oxide
#

or better early return

chilly hearth
#

but that doenst gives me any errors

echo basalt
#

?conventions

echo basalt
#

Has to do with conventions

#

And code style

#

Try to follow Google Style

chilly hearth
#

;-;

echo basalt
#

As that's usually the norm

paper venture
#

also in newer versions of java you can do this

if (commandSender instance of Player player) {
player.setHealth(10);
}

ivory sleet
#

airforce, in java we have special syntax/grammar just like other programming languages, or normal languages such as english, french and so on, why u use {} and [] is because we decided to go with that grammatical syntax, just like why we use dots at the end of sentences.

now [] denotes an array, and { ... code here ... } denotes a scope

chilly hearth
#

JUST LIKE HTML

#

YEE

#

AND CSS

paper venture
ivory sleet
#

yeah airforce good analogy

chilly hearth
#

: )

paper venture
#

and if it causes errors you can easily find where the bug is

chilly hearth
#

i see

#

cant we get entity inventory ?

young knoll
#

Depends on the entity

chilly hearth
#

even after casting inventory i cant get its inventory

chilly hearth
#

wither skeleton

young knoll
#

They donโ€™t have an inventory

#

They do however have getEquipment

chilly hearth
#

yes i used that

chilly hearth
paper venture
#

only entities that implement InventoryHolder interface can have inventory

chilly hearth
#

ok

#

e.addEnchant(Enchantment.) cant get sharpness in that

paper venture
#

can you send full code?

chilly hearth
#

is it DAMAGE ALL ?

#
ItemStack Dia = new ItemStack(Material.DIAMOND_AXE);
            ItemMeta e = Dia.getItemMeta();
            e.addEnchant(Enchantment.DAMAGE_ALL , 30 , true);```
#

is it DAMAGE_ALL ?

young knoll
#

Yes

chilly hearth
#

and by keeping it true i can bypass the limit right ?

paper venture
#

yes

chilly hearth
#

alr

paper venture
#

by the way you shouldnt place extra space before comma

#

e.addEnchant(Enchantment.DAMAGE_ALL, 30, true);

#

this is how it should be

chilly hearth
#

alr

paper venture
#

if you use intellij idea use ctlr alt l

#

it auto reformats code

chilly hearth
#

done thanks

paper venture
#

and ctrl alt o to remove unused imports

chilly hearth
#

one more thing

#

last time

deft thistle
#

how do I remove endermite particles?

chilly hearth
#
entity.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither");```
#

will that say in bold ?

paper venture
#

it should

#

but why do you use + "" + there

young knoll
#

You canโ€™t use + with two chatColors

paper venture
#

you can use ChatColor.BLUE.toString() + ChatColor.BOLD

young knoll
#

However you can toString one

smoky anchor
deft thistle
#

:/

#

Thank you

#

just setting particles to minimal seems to do the trick.

chilly hearth
#
            Entity entity = Bukkit.getWorld("world").spawnEntity(p.getLocation(), EntityType.WITHER_SKELETON);
            entity.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither");
            entity.setCustomNameVisible(true);
            ((WitherSkeleton) entity).setHealth(5000);
        ((WitherSkeleton) entity).getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
        ((WitherSkeleton) entity).getEquipment().setItemInMainHand(new ItemStack(Dia));
#

its not working ;-;

#

i mean the name works

#

but not the casting

stray nacelle
#

uh

#

i forgot how to code on bukkit

#

but i remember

Bukkit.getWorld("you").spawn(Zombie.class, i_think_this_is_location);
chilly hearth
#

its

#

Bukkit.getworld("world").spawnentity

stray nacelle
#

it's return object as class u typed

chilly hearth
#

the casting isnt working

stray nacelle
#

like

// will return Zombie
Zombie ent = Bukkit.getWorld("you").spawn(Zombie.class, i_think_this_is_location);
chilly hearth
#

the spawn things works

#

but the casting deosnt work

#

like its health

#

and quipment

stray nacelle
#

uh

young knoll
#

That setHealth will throw an error

#

Since itโ€™s over max health

chilly hearth
young knoll
#

Probably because of said error

chilly hearth
#

plus cant we set it above the max health ?

young knoll
#

No

stray nacelle
#
WitherSkeleton ent = Bukkit.getWorld("world").spawn(WitherSkeleton.class, p.getLocation());
ent.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither");
ent.setCustomNameVisible(true);
ent.setMaxHealth(2048)d
ent.setHealth(2048);
ent.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
ent.getEquipment().setItemInMainHand(new ItemStack(Dia));
young knoll
#

You need to raise the max health

stray nacelle
#

or add some golden apple health ( i forgor its name)

young knoll
#

Use the non deprecated way of setting max health

#

Aka attributes

stray nacelle
#

r

#

i too lazy

shadow night
#

you too lazy for what?

chilly hearth
#

xd

stray nacelle
#

to edit message

chilly hearth
#

lol

#

let me try ur way @stray nacelle

stray nacelle
#

da

#

no

#

don't do that ๐Ÿ’€

#

i forgot how to code plugins on bukkit

chilly hearth
#

nah

#

i am doing it

stray nacelle
#

ok

chilly hearth
#

backspace : )

young knoll
#

Set it to null

chilly hearth
#

xd

#

use null

chilly hearth
#

ikr

#

i feel of my chair

#

fell*

#

done before any one corrects me : )

#
       ItemStack Dia = new ItemStack(Material.DIAMOND_AXE);
            ItemMeta e = Dia.getItemMeta();
            e.addEnchant(Enchantment.DAMAGE_ALL,30 ,true);



            p.getInventory().addItem(new ItemStack(Material.DIAMOND_CHESTPLATE));
            p.getInventory().addItem(item);

        WitherSkeleton ent = Bukkit.getWorld("world").spawn(p.getLocation() ,WitherSkeleton.class);
        ent.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither");
        ent.setCustomNameVisible(true);
        ent.setMaxHealth(2048);
        ent.setHealth(2048);
        ent.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
        ent.getEquipment().setItemInMainHand(new ItemStack(Dia));
        return true;
        }```
#

cant get that enchantment on the axe ;-;l

young knoll
#

You never setItemMeta

chilly hearth
#

heh ?

stray nacelle
#

y

young knoll
#

You need to use setItemMeta after modifying item meta

stray nacelle
#

Dia.setItemMeta(e)

chilly hearth
#

forgot that

eternal oxide
#

camelCase for variable names

chilly hearth
#

camalcase is () right

chrome beacon
eternal oxide
#

no, its the case used for objects

young knoll
#

lowerCamelCase to be exact

eternal oxide
#

variableName, ClassName, CONSTANTS

chilly hearth
#

i dont get it

eternal oxide
#

ALL variables start with a lower case letter

#

so your Dia should be dia

chilly hearth
#

its not working

young knoll
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

chilly hearth
#

imean the metadata

paper venture
#

send code

shadow night
chilly hearth
#
    ItemStack dia = new ItemStack(Material.DIAMOND_AXE);
            ItemMeta e = dia.getItemMeta();
            e.addEnchant(Enchantment.DAMAGE_ALL,30 ,true);
            dia.setItemMeta(e);



            p.getInventory().addItem(new ItemStack(Material.DIAMOND_CHESTPLATE));
            p.getInventory().addItem(item);

        WitherSkeleton ent = Bukkit.getWorld("world").spawn(p.getLocation() ,WitherSkeleton.class);
        ent.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither");
        ent.setCustomNameVisible(true);
        ent.setMaxHealth(2048);
        ent.setHealth(2048);
        ent.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
        ent.getEquipment().setItemInMainHand(new ItemStack(dia));
        return true;
        }```
#

i think the enchantment worked

stray nacelle
#

where not workin

chilly hearth
#

but its not sharpness 5

#

ig

#

like sharpness 30 is enough to 1 shot me

#

without armour

#

and its sharp5 ig

stray nacelle
#

add enchantments in itemmeta

chilly hearth
#

i did

stray nacelle
#
ItemStack dia = new ItemStack(Material.DIAMOND_AXE);
ItemMeta e = dia.getItemMeta();
e.addEnchantment(Enchantment.DAMAGE_ALL, 30);
dia.setItemMeta(e);
chilly hearth
#

i remove that true ?

stray nacelle
#
e.addEnchantment(Enchantment.DAMAGE_ALL, 30);
#

i forgot how to use it

chilly hearth
#

so remove the true ?

chilly hearth
#

NOt working

#

mate

umbral ridge
#

What's a better way to check if a certain player is within the certain region (a square)?

  • use a runnable that periodically checks for each online player location, etc..
  • use PlayerMoveEvent?
#

performance wise?

chilly hearth
#
   ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE , 2 , 2));``` how to make duration infinite
#

infinate*

#

do i set it to 0 ?

remote swallow
#

what version

chilly hearth
#

1.18.1

remote swallow
#

Integer.MAX_VALUE

chilly hearth
#

heh

#

HEH

#

HEEEEEEHHHHHH

ivory sleet
chilly hearth
umbral ridge
ivory sleet
#

no

umbral ridge
#

I've never actually used it

#

only event priority

ivory sleet
#

but if it is cancelled before ur method is called, ur method wont be called

#

thus avoiding unneccessary invocations

umbral ridge
#

Alright, perfect, thank you

pseudo hazel
#

does it print anything at all?

#

if not make sure you actually registered the command

chilly hearth
#
 ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE ,Integer.MAX_VALUE,Integer.MAX_VALUE));``` it didnt gave the wither the effect ;-;
paper venture
#

what is this

chrome beacon
#

That will easily be bypassed

ivory sleet
#

yeah some1 can create their own paste

chrome beacon
#

Also if you use that you can't post the plugin on spigotmc

ivory sleet
#

and woops, bypassed

pseudo hazel
#

if you actually want to use licensing, maybe some other authorization method should be used

raw epoch
paper venture
#

this license check looks weird

#

idk

#

scan will never close if firstLine contains true

#

moreover his url var is incorrect

#

no .com after pastebin

umbral ridge
#

is Player#hasPlayedBefore() reliable?

#

is it consistent between offline-mode and online-mode server

calm robin
#

i have these methods to hide and reveal players, my issue is that if the invisible player changes animations like swinging or eating they become revealed again when i dont want them to

#

i assume this is some sort of packet doing this, how can i fix that problem

echo basalt
#

Something tells me you have funky code interfering with you

#

Add some debug lines to make sure no other listeners are at fault

chilly hearth
#

someone help me

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

chilly hearth
#

?learnjava

undone axleBOT
chilly hearth
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous names and nicknames of a member.
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

chilly hearth
umbral ridge
chilly hearth
#

that will solve the problem ?

kind hatch
#

You're using the wrong effect.

#

PotionEffectType#WITHER

chilly hearth
#

wdym

#

i wana give him strenght

#

not wither

kind hatch
#

it didnt gave the wither the effect ;-;

umbral ridge
#

How would you figure out if player is facing towards the block to which he was denied to go to, on PlayerMoveEvent?

kind hatch
#

???

chilly hearth
kind hatch
#

The wither uses projectiles to deal damage. I don't think those are affected by potion effects.

zenith gate
#

Anyone have a decent InventoryManager api? all im finding are out of date ones that support 1.13.

umbral ridge
echo basalt
zenith gate
echo basalt
echo basalt
#

You'll have to build pagination and all on top

zenith gate
#

Okay, that's fine. I can work that out. thanks.

echo basalt
#

Or use something like IF or triumphgui

#

In my case I just use my own utils for literally everything

zenith gate
#

I like to use my own as well. Its just I cannot think on inventories, and also saving the data to files. its all just making my brain scramble lol.

eternal oxide
#

break the task down to smaller pieces

zenith gate
#

Attempt 2 will be that ๐Ÿ™‚

upper hazel
#

how to optimize this code

#

server stop then code try find location

eternal oxide
#

no need to check if the world is null as you already check location

upper hazel
#

good now the code is 1 millisecond faster
)

icy bone
#

Before you can teleport someone to another world, you need to create that world (Bukkit.getserver().createWorld()) but is there a way to see if it is already created, or does multiple creation dont matter?

eternal oxide
#

use ints not doubles as you don't need double precision

#

use center.getBlockX() instead of getX()

#

etc

upper hazel
#

ok i do

eternal oxide
#

also instead of check every block with an x/y/z loop you should create either a region or a BoundingBox and check overlaps

waxen plinth
#

so you should only have to check if it's already loaded

icy bone
#

Ahh so no problem in creating it multiple times

#

Thank you

quaint mantle
lilac dagger
#

yes

chilly hearth
#

a

#

how to trigger an event when an command is ran in another class

quaint mantle
#

What am I supposed to put for data in Player#playEffect?

eternal oxide
#

it varies

inland saffron
#

Can someone help me please? For some reason no npc plugins are working on my server

#

I have tried 5 different plugins now.

eternal oxide
quaint mantle
eternal oxide
#

it varies depending on the effect

quaint mantle
#

would it be the block data id if I am playing the effect for breaking a block?

eternal oxide
#

probably yes

#

eg STEP_SOUND public static final Effect STEP_SOUND Sound of a block breaking. Needs block ID as additional info.

clear panther
#

Hello guys how to make armorstand always teleport to a mob

#

or a boss

clear panther
#

uh

#

like hologram

#

on mob's head

carmine mica
#

make it a passenger

lilac dagger
#

yes

#

get the blockface from yaw

#

wait hmm

umbral ridge
#

So I'll tell you more about this

lilac dagger
#

use Vector direction

#

and check the angle

umbral ridge
#

I have a region, in which players can break/place blocks, etc.. and I want to prevent the player from entering it, I have all I need, I implemented all of it, now i'm trying to figure out how to deny him from entering, by bouncing him back, sort of

#

bouncing him back FROM the block he was denied to go to

#

eg. they could enter the region backwards, so... they would bounce back..

lilac dagger
#

well if you have a region then why not check if he's inside?

umbral ridge
#

I can do that, but I want to use the bouncing back thing

lilac dagger
#

try to optimize the regions by chunks

umbral ridge
#

on PlayerMoveEvent

young knoll
#

Bouncing them with a vector that goes towards the from location should work

umbral ridge
lilac dagger
#

substract to and from

young knoll
#

Unless they try to enter from the top, in which case you get a trampoline

lilac dagger
#

and then normalise

umbral ridge
lilac dagger
#

and then multiply it by whatever

#

and set it to the player

umbral ridge
#

Let me try this

lilac dagger
#

or get the middle of the region

#

as a point

umbral ridge
#

But actually coding it is hard

lilac dagger
#

why?

#

the middle of a region is easy

umbral ridge
#

I've got two locations, 1 is the top on y axis, and the 2nd location is the lower y axis

#

that's how i calculate the square

lilac dagger
#

and what stops you from getting the middle?