#help-development

1 messages · Page 831 of 1

rare rover
#

Custom biomes

umbral ridge
#

so no resourcepacks or mods? just plugin?

rare rover
#

Yep

#

Just an API rn

#

Just gotta fix some things and get multi-versioned nms working

#

Cuz rn only works for 1.20.2

#

Fully vanilla

umbral ridge
#

Nice

slender elbow
#

datapacks are an amazing thing

distant wave
#

how can i convert ChatColor to Color?

chrome beacon
#

bukkit or bungee chatcolor

distant wave
#

org.bukkit.Color

chrome beacon
#

that didn't answer the question

distant wave
#

oh yeah

#

mb i read it wrong

#

org.bukkit.ChatColor

#

(want to set leather armor color based on chatcolor but it requires bukkit color)

chrome beacon
#

You can convert bukkit ChatColor to Bungee ChatColor to Java Color to Bukkit Color

distant wave
proud badge
#

what would be a method to obtain the blocks that the block dropped in the blockbreakevent?

chrome beacon
#

BlockDropItemEvent

proud badge
#

Oh can I not get it from the blockbreakevent?

young knoll
#

Kinda

#

You can use Block.getDrops

proud badge
#

ok thx

chrome beacon
#

The BlockDropItemEvent is usually better if it works with what you're trying to do

proud badge
#

I think I did something wrong

smoky oak
#

it gives u either a list or a array

proud badge
#

ah nvm its block but now I need a collection

smoky oak
#

a list is a collection

umbral ridge
quaint mantle
rough drift
# smoky oak

Use a LinkedHashMap over a normal HashMap every time where insertion is somewhat rare

#

It is much faster at iteration/access

smoky oak
rough drift
#

¯_(ツ)_/¯

#

I am talking larger maps

#

but generally if you need to loop over it use a Linked version of any collection

#

Also LinkedLists are faster for insertion because they don't need to resize

worldly ingot
#

Oh, I kept reading "iteration" and was really confused why you thought they were faster

#

Yeah, faster for insertion lol

rough drift
#

LinkedHashMap/LinkedHashSet is faster for iteration over a normal HashMap/HashSet

worldly ingot
#

Yeah

rough drift
#

around 50% faster

worldly ingot
#

Out of context, thought you were comparing against ArrayLists, hence my confusion :p

rough drift
#

fair enough

sterile flicker
#

How to get player message from AsyncChatEvent?

smoky oak
#

the event should just have a method for that

#

?jd-s

undone axleBOT
smoky oak
sterile flicker
smoky oak
#

wdym it doesnt exist

#

code pls

#

?paste

undone axleBOT
sterile flicker
smoky oak
#

?whereami

smoky oak
#

if youre on paper all bets are off

#

try their server

astral pilot
#
head.getValues(false)

Why am i getting an empty map from this

#

in the yml i have this value

head:
  LEATHER_HELMET: "{display:{color:3949738}}"
chrome beacon
#

Show the entire code

#

?paste

undone axleBOT
steel swan
#

little question, if i wanted to place a structure in the world at specific coordonates, 3 questions
1- how do i save the structure? like if i built it in single player how do i sace it
2- once the file is placed, how do i access the structure (the file is in the server files)
3- how do i place the structure

umbral ridge
steel swan
chrome beacon
#

You can just load it as a datapack then

astral pilot
chrome beacon
#

I guess we can't help you then

steel swan
chrome beacon
#

If you won't give us any information, there's nothing we can do

chrome beacon
astral pilot
#

heres the yml

astral pilot
#

uh so why is it returning an empty map

steel swan
worldly ingot
#

Yeah, just populate those fields correctly and yes it will place it in the world

#

Think of Structure#place() like a structure block in-game

steel swan
#

it doesnt recognize Structure#place()

zealous osprey
#

init structure with "null"?

steel swan
steel swan
chrome beacon
steel swan
chrome beacon
#

IJ probably doesn't find a method called place without any arguments

#

since it doesn't exist

steel swan
#

tried with arguments , still the same

chrome beacon
#

what import are you using

eternal oxide
#

You have the wrong import as shown by your need to cast

steel swan
#

it was a wrong import

worldly ingot
#

There are like three Structure types

steel swan
#

what do int palette and float integrity do?

eternal oxide
#

0 and 1.0

worldly ingot
#

docs are useful for that kind of stuff

palette - The palette index of the structure to use, starting at 0, or -1 to pick a random palette.
integrity - Determines how damaged the building should look by randomly skipping blocks to place. This value can range from 0 to 1. With 0 removing all blocks and 1 spawning the structure in pristine condition.

steel swan
#

so would this do?

#

the world cannot be null as it is generated just above

#

oh and, if my file is here how would i get it?

distant wave
#

is there any way to filter events that happened in certain bounding boxes? i know i could just add if check before every handler but that would make it pretty bloated

chrome beacon
#

can't really check that without checking it so

#

you'll just need to check it

distant wave
#

well i know i wanted to know if theres some preevent checker where i could place this if check

chrome beacon
#

Just use an if statement

#

or implement your own layer between the event handler and your listener code

smoky oak
chrome beacon
quaint mantle
#

I am getting "java.io.EOFException" at this line:

Bukkit.getStructureManager().registerStructure(MoonHouseStructureKey, Bukkit.getStructureManager().loadStructure(getResource("moon_house.nbt")));

Because of "loadStructure()". Moon_house.nbt is a valid file

chrome beacon
#

Moon_house.nbt != moon_house.nbt

#

Double check that

quaint mantle
#

its real name is moon_house.nbt

#

i just mistyped that in the msg

chrome beacon
#

also do see what getResource returns

quaint mantle
#

already checked that

chrome beacon
#

Send the entire stack trace

#

?paste

undone axleBOT
quaint mantle
chrome beacon
#

is that all?

quaint mantle
#

yea

chrome beacon
#

I feel like there should be more than that

#

double check

cyan void
#

how can i do what the comment says i have spent all day trying to figure this out but nothing works...


import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;

public class PlayerInteractListener implements Listener {
    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        if (event.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
            Player player = event.getPlayer();
            Block block = event.getClickedBlock();
            
            /* wait 2 seconds if player is still holding the left 
            click button break the block and give the player 1 diamond */
        }
    }
}
quaint mantle
quaint mantle
cyan void
chrome beacon
#

?scheduling

undone axleBOT
cyan void
#

btw

#

i gave the player infinate mining fatuge

#

will those events still work @chrome beacon

quaint mantle
chrome beacon
cyan void
#

kk

#

thak you so much

#

uhhh

#

a big ask

#

but do u want to make an rpg with me

#

lol

quaint mantle
#

maybe i shouldnt store it as a resource?

chrome beacon
cyan void
#

wait so @chrome beacon would i detect when a block is damaged then put the player in a variable then if they let go remove them from it and then when the timer runs out just do whatever

chrome beacon
#

yeah

cyan void
#

going a bit insane

chrome beacon
#

It's a massive project

cyan void
#

but its fine

cyan void
chrome beacon
#

yeah

#

but try not to keep a direct reference to the player

#

store the uuid and make sure to remove it when a player leaves the server

quaint mantle
cyan void
#

that is what i ment

#

fuck java

#

honestly idk what else i would use

#

i just have java

#

hate*

chrome beacon
#

What's wrong with Java?

quaint mantle
cyan void
chrome beacon
#

eh makes things easy to read and follow

cyan void
#

my code is spegetti

#

i only cair about writing it lol

chrome beacon
#

That'll come back to haunt you later

quaint mantle
cyan void
quaint mantle
#

rewrite it then

#

dont make it spaghetti

cyan void
#

BUT IM ITALIAN

quaint mantle
cyan void
#

kk

#

ima try make a file

#

that is not spageti

#

@chrome beacon

#

mt ide says the abort event dosent exsist

#

uh oh

#

my*

chrome beacon
#

What version are you making the plugin for

chrome beacon
#

That event didn't exist 9 years ago

cyan void
#

what dident

chrome beacon
#

You'll need to use packets or smth

#

Why are you making an RPG for 1.8 💀

cyan void
#

uhhh

#

2gb of ram?

#

is that a good answer?

chrome beacon
#

You can run modern versions on that

#

assuming a tiny player base ofc

cyan void
#

how do i use packets

#

protocol libright

chrome beacon
#

yeah

cyan void
#

help me

#

that shit so confusing

chrome beacon
#

eh I really don't feel like messing with versions that old

cyan void
#

why not

chrome beacon
#

no point

cyan void
#

wait what version do i need for the abort event

chrome beacon
#

🤷‍♂️

cyan void
#

1.18.

#

1

chrome beacon
#

Just go with 1.20.2 or .4 as target

#

Old versions are no longer being maintained

cyan void
#

how about 1.19.2

chrome beacon
#

Same

river oracle
# cyan void 1.18.

I get you like the enter key, but you should atleast keep minecraft versions on the same line

remote swallow
#

just pray simple doesnt see this

cyan void
remote swallow
#

someone with a wife

cyan void
#

ok

#

well

#

ima go update my plugin, wish me luck

#

@chrome beacon just a quick question, u said it was a big project, how long do u recon this is going to take me for the first like 1.0 update

chrome beacon
#

Depends on what you want to include

fallow gyro
#

Just to check, is it okay to give out UUIDs of players within my plugin (eg allow players to get the UUIDs of others they're online with)? I'm not 100% sure how they work.

chrome beacon
#

Yes UUIDs are public information

distant wave
#

is hitting a player counted as interaction?

fallow gyro
#

Alright, cheers 👍

chrome beacon
uncut folio
#

is there a way to get all the nearby entities in a sphere instead of a square?

#

seems like location.getWorld().getNearbyEntities() doesn't have an option for spheres

distant wave
chrome beacon
#

yes

distant wave
#

okay

chrome beacon
#

or at least I think so

distant wave
#

well it would make sense

chrome beacon
cyan void
#

how do i make my plugin not a legacy plugin now it has the yellow star next to it in /pl

uncut folio
#

i'll go try it

chrome beacon
#

to 1.20

cyan void
#

but im using 1.19.4

#

uhh

chrome beacon
#

._.

cyan void
#

i think i did do that

chrome beacon
#

Then set it to 1.19

#

You really should use 1.20 though

cyan void
#

why

#

what did it add that i am going to need

chrome beacon
#

so you get bug fixes and support

cyan void
#

ok so now my plugin is rad and dosent work

#

wtf

#

this is how it should be correct:

api-version: 1.19.4
version: '${project.version}'
main: uk.co.agwoo.zelrpg.ZelRPG
authors: [ agwoo ]

commands:
  gamemode:
    permission: ZelRPG.command.gamemode
    aliases:
      - gm
    description: "Changes your gamemode."
  gms:
    permission: ZelRPG.command.gamemode.survival
    description: "Changes your gamemode to survival."
  gmc:
    permission: ZelRPG.command.gamemode.creative
    description: "Changes your gamemode to creative."
  gma:
    permission: ZelRPG.command.gamemode.adventure
    description: "Changes your gamemode to adventure."
  gmsp:
    permission: ZelRPG.command.gamemode.spectator
    description: "Changes your gamemode to spectator."
  give:
    permission: ZelRPG.command.give
    description: "Gives you items."```
eternal oxide
#

1.19 not 1.19.4

cyan void
#

ok

cyan void
twin venture
#

Hi , iam making a big plugin and it have 2 moudle :

  • lobby
  • game

and i don't want to have 2 files of the same thing for example in lobby i would need to make :
kits.yml

and in the game module

i also need to have kits.yml

is there a better way ?

i was thinking about saving kits into mysql .

reef flower
#

Hi i want to use WorldGuard dependency in my plugin but when i try to compile, maven says to me : cannot access com.sk89q.worldguard.WorldGuard

chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

That's not your pom

reef flower
#

Oh mb !

#

i send u my pom

chrome beacon
#

You need WorldGuard bukkit

reef flower
#

I try with too

#

im on worldguard bukkit but i tryed with core

#

but it didnt fix

chrome beacon
#

What's the error?

#

also show that pom

reef flower
#

cannot access com.sk89q.worldguard.WorldGuard

chrome beacon
#

How are you compiling your jar

reef flower
reef flower
uncut folio
#

i have a quick question about Bukkit.getScheduler().scheduleSyncRepeatingTask()
so it has 4 arguments: a plugin, a runnable and 2 longs
what are those 2 longs for exactly?

reef flower
chrome beacon
#

?scheduling

undone axleBOT
chrome beacon
#

?jd-s

undone axleBOT
upper hazel
#

i can change player attak speed and range ?

chrome beacon
upper hazel
chrome beacon
#

No I mean not yet

#

It's in the latest snapshot

upper hazel
#

but in creative range can be change

chrome beacon
#

Yeah that's hardcoded

#

in to the client

reef flower
chrome beacon
reef flower
#

not work...

upper hazel
#

Isn't everything that is felt by another player programmed on the server? After all, the other player will take damage

chrome beacon
#

Well parts are on the client

#

and other stuff is on server

cyan void
#

i need more help

#

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockDamageAbortEvent;
import uk.co.agwoo.zelrpg.ZelRPG;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

public class BlockDamageListener implements Listener {

    private Set<UUID> damagingPlayers = new HashSet<>();

    @EventHandler
    public void onBlockDamage(BlockDamageEvent event) {
        // Add the player's UUID to the list
        damagingPlayers.add(event.getPlayer().getUniqueId());

        int delayTicks = 20;
        Bukkit.getScheduler().runTaskLater(ZelRPG.getInstance(), () -> {
            // Check if the player's UUID is still in the list after the delay
            if (damagingPlayers.contains(event.getPlayer().getUniqueId())) {
                // Break the block
                event.getBlock().breakNaturally();
            }
            // Remove the player's UUID from the list
            damagingPlayers.remove(event.getPlayer().getUniqueId());
        }, delayTicks);
    }

    @EventHandler
    public void onBlockDamageAbort(BlockDamageAbortEvent event) {
        // Remove the player's UUID from the list if they stop damaging the block
        damagingPlayers.remove(event.getPlayer().getUniqueId());
    }
}
#

so basicly

#

if u hold it down

#

it dose break

#

but if u dont let go

#

and look at a block

#

then let og after

#

let go*

#

it breaks

chrome beacon
#

Well you are breaking the block

cyan void
#

but only before the first one breaks

chrome beacon
#

so ofc that happens

reef flower
#

BRUHH not i cannot access org.bukkit.block.data.BlockData

#

my idea suck

cyan void
#

i dont think u understand

#

mind u nore do i

#

nor*

chrome beacon
reef flower
#

im using 7.0.1

distant wave
#

if an arrow has touched a block how can i get the block before it touched?

chrome beacon
cyan void
#

7.0.1

#

never heard of that one

reef flower
#

yes but for WorldEdit / Guard

chrome beacon
#

Yeah but WorldEdit / Guard doesn't change what Minecraft version you're writing code for

reef flower
#

but the problem come from my idea

chrome beacon
#

so that class won't be available

reef flower
cyan void
#

can someone help me

reef flower
#

thats what says maven when i try to compile

chrome beacon
#

Yeah

reef flower
chrome beacon
#

That class doesn't exist in 1.8

distant wave
cyan void
reef flower
chrome beacon
#

?

eternal oxide
#

you want the block in front of the block that gets hit?

reef flower
#

And the location of the arrow cant help u ? i mean if you world.getBlockAt(locationOfTheArrow)

distant wave
#

yes

eternal oxide
#

getHitBlock().getRelative(getHitBlockFace())

cyan void
#

so basicaly i have this code:


import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockDamageAbortEvent;
import uk.co.agwoo.zelrpg.ZelRPG;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

public class BlockDamageListener implements Listener {

    private Set<UUID> damagingPlayers = new HashSet<>();

    @EventHandler
    public void onBlockDamage(BlockDamageEvent event) {
        // Add the player's UUID to the list
        damagingPlayers.add(event.getPlayer().getUniqueId());

        int delayTicks = 20;
        Bukkit.getScheduler().runTaskLater(ZelRPG.getInstance(), () -> {
            // Check if the player's UUID is still in the list after the delay
            if (damagingPlayers.contains(event.getPlayer().getUniqueId())) {
                // Break the block
                event.getBlock().breakNaturally();
            }
            // Remove the player's UUID from the list
            damagingPlayers.remove(event.getPlayer().getUniqueId());
        }, delayTicks);
    }

    @EventHandler
    public void onBlockDamageAbort(BlockDamageAbortEvent event) {
        // Remove the player's UUID from the list if they stop damaging the block
        damagingPlayers.remove(event.getPlayer().getUniqueId());
    }
}

but if your mining a block then look at another one strange this happen

#

i need to fix it

chrome beacon
#

yeah

#

you'd need to cancel the old task

cyan void
#

HOWWWW

#

caps

chrome beacon
#

Keep a reference to it

#

and cancel it

#

?scheduling

undone axleBOT
cyan void
#

@chrome beacon please can u write an exsample im actualy so confused rn

grim hound
#

BukkitTask task = Bukkit.getScheduler().runTaskLater

#

and instead of private Set<UUID> damagingPlayers = new HashSet<>();

#

do a Map

#
Map<UUID, BukkitTask> map = new HashMap<>();
cyan void
#

a what

chrome beacon
#

A Map

cyan void
#

wait so how do i cancel it

astral pilot
#

is there a way to make it so that the zombie entity being spawned wont be a baby zombie?

#

aside from Zombie#setbaby(false)

grim hound
#
BukkitTask t = map.get(uuid);
if (t != null) t.cancel();
chrome beacon
slate tinsel
#

How can I resize a Firework Effect? I use "BALL" I want to make it smaller

astral pilot
chrome beacon
#

Then check that

#

before setting it to false

astral pilot
#

there's a lot of mobs that can be baby tho

#

so

#

i dont think manually checking them all would be feasible

chrome beacon
#

Just check if it's a zombie???

astral pilot
#

what if its a cow

#

and i want it not to be baby too

chrome beacon
#

If you want to prevent all baby mobs you can just check if it's Ageable

torn badge
#

Check instanceof Ageable

cyan void
#

please someone tell me how to cancel this

chrome beacon
undone axleBOT
astral pilot
#

btw is there a way to disable their natural drop

grim hound
cyan void
astral pilot
cyan void
#

nvm

#

im blind

grim hound
grim hound
#

set their LootTable

#

to an empty one

#

dunno if it can be null

astral pilot
#

thanks

chrome beacon
#

under the section called Canceling a Task

#

Please read the page ._.

cyan void
#

ok

#

i hope this works

#

@chrome beacon

#

not in a wired way

#

i love you

#

thanks for ur help

chrome beacon
tawny sparrow
#

Hello! Are any of you conducting tests for Spigot 1.8? If so, which library are you utilizing?

twin venture
#

cuz with database [mysql] for example , admin can't edit the kits ..

#

and it will have to many connections ..

remote swallow
#

in game editor

twin venture
remote swallow
#

have them edit kits in game

pseudo hazel
#

if you are talking about just storing the info and you dint want a databse, save them in a file

#

if you are talking about how admins or serv owners can set up the kits and stuff, most intuitive for them would be a way to configure it in like an ingame menu

#

but what is a module

twin venture
#

check this if you don't mind .

pseudo hazel
#

so a module is a separate plugin?

twin venture
#

game -> seprate plugin
lobby -> seprate plugin

#

and i add core in pom file of both game and lobby

#

cuz i need it in both places .

#

and the user should buy / select the kits in the lobby server

lost matrix
#

Are those two different servers?

twin venture
#

yes

#

and it won't be only 1 game servers , it can be multiple like 15 game servers

#

and 2 lobbies for examples ..

lost matrix
#

This means you need to transfer data between them or have a shared location for data.

twin venture
lost matrix
#

A database

twin venture
#

storing kit information?

#

[name , price , slot , items]..?

#

the name , price , slot , are easy my problem is how would i store an actual items ..

#

ik using deserlizing and serlizing ..

#

but wouldn't it be allot of work doing that?

lost matrix
#

Its a decent amount of work for sure.
Is your concern the creation of new kits?
Because admins usually have yml files which can be used as templates.

twin venture
#

thanks .. for answering , i will start working on it right now ..

twin venture
#

i don't understand ?

umbral ridge
#

What event would I use if I want to generate loot chests randomly in the map? (I know how to handle positioning I just don't know what event to use)

#

ChunkLoadEvent?

twin venture
umbral ridge
#

So map is reloaded each time the event ends

#

I guess I just retrieve all the chunks in the map, randomly select a few and then from there appropriately position the ches(s)

twin venture
#

umbral ridge
#

Or I could harcode it, specify all available locations, randomly select them

#

I guess

#

👌

twin venture
#

try the plugin i sent to you . maybe it helps?

mellow edge
#

should I check direction someone is facing like that?

if(yaw >= 135 && yaw <= 255) {
            System.out.println("facing NORTH!");
        } else if(yaw >= 45 && yaw <= 135) {
            System.out.println("facing WEST!");
        } else if((yaw>= 315 && yaw<=360)||(yaw>=0&&yaw<=45)) {
            System.out.println("facing SOUTH!");
        } else {
            System.out.println("facing EAST!");
        }
chrome beacon
mellow edge
#

thanks, that is a good alternative

umbral ridge
#

hey

#

1.20.4 remapped isn't out yet?

#

R0.1-SNAPSHOT is called differently?

#

1sec

river oracle
umbral ridge
#

I forgot

river oracle
#

java -jar BuildTools.jar --rev 1.20.4 --remapped

umbral ridge
#

I still don't understand this though, how does the IDE know that I ran buildtools?

#

it just scans the whole computer?

river oracle
#

BuildTOols installs spigot into your .m2

#

it runs mvn install on the server

umbral ridge
#

how does it know what server to pick I have like 7 directories with different minecraft jar versions

river oracle
#

.m2 organizes everything

#

maven is smart like that

umbral ridge
river oracle
#

if you want

proud badge
#

Whats better for an index:
Have a hashmap with Integer and Value or
Have an ArrayList and get it by the index

#

Also is it impossible to have different objects in an arraylist?

minor junco
#

depends on how large your map is going to be, how many reads, writes and what not

#

generally I would say arraylist is easier

#

you could use something like what i made ^^

#

makes things a lot easier

chrome beacon
proud badge
#

Dk

#

ArrayList<String>

chrome beacon
#

Or are you talking about different types

proud badge
#

I assumed a specified object was required

proud badge
#

For example Player OfflinePlayer

chrome beacon
#

So different types?

proud badge
#

yes

chrome beacon
#

._.

proud badge
#

yes or no

chrome beacon
#

You've given a mixed question

#

I'm not sure what yes or no would refer to

minor junco
#

i mean arraylists are there for a consecutive sequence of elements

proud badge
#

Is it possible to make an arraylist that would accept multiple types of objects

minor junco
#

erm yeah

#

ArrayList<Object>

proud badge
#

Ok epic

chrome beacon
#

Possible yes

minor junco
#

but not a union type

chrome beacon
#

Bad idea also yes

minor junco
#

we're not typescript

proud badge
#

k ima just stick with my hashmap system since it works

minor junco
#

honestly I thought your question was around whether it is more effective to associate an object to an index via a hashmap or custom array(list)

proud badge
#

that was the initial question

minor junco
chrome beacon
#

Honestly though you should go over your design

#

I have a feeling it needs to be reworked

umbral ridge
#

hey getCommands() on PlayerCommandSendEvent contain names and don't include slashes before right?

sullen marlin
#

Try and see

umbral ridge
#

👌

rapid trout
#

Hello I want to create a flashbang. For that I thank about a title with a custom texture with unicode but in 1.20.1 mojang removed unicode. By what I can replace the unicode ?

young knoll
#

Pretty sure it’s still a thing

next stratus
#

Likely a stupid question, but is NMS faster than worldedit at setting a lot of blocks? I'm only wanting to set a large region to air that's all

wet breach
#

World edit if i recall uses some nms to do what it does and isnt just strictly api

next stratus
#

So it's safer to stick with just using the world edit api and not going off wasting time making nms stuff?

wet breach
#

Most likely given world edit has been around for almost a decade

young knoll
#

Plus the worldedit api should be compatible with fawe

#

If you want super speeds

twin venture
#

i will just copy paste the files from lobby -> all game servers in kit folder.

umbral ridge
#

how would i replace the default unknown command message?

#

what event should i go for

#

also how do you save Unknown command. Type "/help" for help. to config?

young knoll
#

I think it's in one of the ymls

rough drift
#

spigot.yml iirc

umbral ridge
#

What if I want to remove it?

rough drift
#

set it to "" or something

#

or on command execute, if it doesn't exist then just don't try to run it

#

also

spigot.yml > messages.unknown-command

umbral ridge
#

thanks ill try this

#

setting it to "" worked. nice!

rough drift
#

I can't 😭

proud badge
#

What is kotlin

#

And can I use it to develop minecraft plugins?

pseudo hazel
#

a programming language

#

and yes

quaint mantle
meager wolf
#

is there an event for when an entity's hitbox touches another one (another entity hitbox)

#

or just an event for entities collision

#

(the closest thing i found is VehicleEntityCollisionEvent)

young knoll
#

no

meager wolf
#

damn

quaint mantle
quaint mantle
paper viper
meager wolf
#

^

quaint mantle
#

this is the plugin.yml

green plaza
#

Idk if thats good place for this question but i'll ask it here bcs mc is related to netty

#

index: 14, length: 1434 (expected: range(0, 512))

What might cause this error?

#

I send rly big string around 1400 characters

meager wolf
#

there should be no spaces here

#

||i think 🙂 ||

quaint mantle
#

like this?

river oracle
#

Are permission and config separate commands?

#

If so they should both be indented 1 space

quaint mantle
#

and yes

quaint mantle
#

so they need one space each?

river oracle
#

Yes

quaint mantle
meager wolf
#

it should be just like the permission:

quaint mantle
#

like this>

river oracle
#

You also need to makw sure you name isn't indented

#

That'll cause issues too

meager wolf
river oracle
#

Indented

quaint mantle
quaint mantle
river oracle
#

This
Is an indent
Is another indent

meager wolf
quaint mantle
#

now?

river oracle
#

Instead of guessing and checking read this and look at its example

quaint mantle
#

sure

meager wolf
river oracle
#

The wiki should solve their issue

meager wolf
river oracle
#

Likely they aren't a native English speaker so the examples should help

quaint mantle
#

no i am i just have a lot of issues understanding sometimes

river oracle
#

It's always easier to learn by example anyways 😉

meager wolf
#

:-)

quaint mantle
#

so they have to be on the same level then right?

#

the config and permission

meager wolf
#

ye

quaint mantle
#

ohhhh

#

now that makes more sense

meager wolf
#

its like, nested, but without the { and }

river oracle
#

Json superiority

quaint mantle
#

thanks again

quaint mantle
#

send your plugin.yml

#
name: TestPluginee
version: '${project.version}'
main: com.oisann.testpluginee.TestPluginee
api-version: '1.16'
authors: [Oisann]
description: Cool plugin
sound: ENTITY_ENDER_DRAGON_DEATH
commands:
  permission:
  config:

change it to this

quaint mantle
rare rover
#

why is my project doing this???

#

never seen this before

quaint mantle
#

what is happening 💀

rare rover
#

my project files are wonky

#

i can't access them

#

src file exists

smoky oak
quaint mantle
#

that's correct i am called oisann xd

#

still having the error

river oracle
#

If it is you haven't signed the cla

#

This is a limitation of stash

carmine mica
#

I mean... not really

#

you can just have something that closes PRs opened by accounts that haven't signed the CLA

young knoll
#

Not exactly a clean solution

carmine mica
#

about a zillion companies do it with their own repos all over the place

#

its a super super common solution

#

mojang/microsoft does it with their repos on github, surely companies that host code via stash also have something

gloomy onyx
#

Is there a plug-in that can do per player borders please let me know!

distant wave
#

Is there any way i could trace where an arrow is going and place there a head or smth

#

So it would kinda simulate a ball if you know what i mean

sullen marlin
#

Just make the ball constantly update to arrow location?

distant wave
#

Well but how do i make the ball? Since blocks cant really have position in floating points, should i use Armor stands or smth

smoky oak
#

just dont actually use an arrow, it tends to turn invisible

distant wave
#

So i can have some sort of block projectile?

smoky oak
#

have been planning to mess around with off-grid blocks but not done anything with it yet. Personally I'd advise you to use armour stands without collision and custom model data item on it

wet breach
#

you coud just use a collection of particles or maybe use snowballs lol

distant wave
wet breach
#

not sure how you are going to click something flying through the air o.O

eternal oxide
#

Thats going to be difficult as you need interact and not have your target mess with the projectile

distant wave
#

I have the same question, i have no idea how would i implement smth like that

eternal oxide
#

explain what you are doing and someone may have a better idea

wet breach
#

the whole ball effect etc is easy

#

the clicking part, not so much

#

but I agree you need to probably provide better details on what it is you are trying to do

eternal oxide
#

If it's somethign like volleyball then scrap the projectile and plot an arc for an entity

wet breach
#

all I have right now, is an arrow with a ball trail?

distant wave
#

Its a basketball plugin

#

Basically when someone shoots an arrow and someone clicks it midfly i want it the clicker to get the ball

wet breach
#

use a bat entity with custom texture then. This way it lets your players hit it

smoky oak
eternal oxide
#

yep, scrp the projectile

wet breach
distant wave
wet breach
#

math using vectors

eternal oxide
#

in the launch event you can get the direction and then spawn an entity and plot its course

smoky oak
distant wave
#

That cant be

#

Right

eternal oxide
#

yes, you have to apply gravity is all

smoky oak
#

doesnt gravity apply to entities by default

eternal oxide
#

then you can detect an interact click from a player

wet breach
#

its really not overly difficult, there might be some other things as they come up, but relatively its not all that difficult in terms of math

wet breach
distant wave
#

Alright thanks for help

#

Gonna implement it

#

(atleast attempt)

wet breach
#

I would use snowballs for when the player has the ball in their hand

eternal oxide
#

don;t forget to cancel/remove the projectile in launch. You want your entity nto the projectile

wet breach
#

this way you can get force and direction, and then when the snowball spawns, change it out for a bat entity with a custom texture

#

apply all the stuff from the snowball to the bat

#

reason for bat, is because its hitbox is small but not too small, but good enough for a ball size 🙂

distant wave
#

Sounds good

#

!!

wet breach
#

another entity might be some magma cubes, the smaller variants

#

or slimes

#

plenty of entities to choose from 😄

quaint mantle
twin venture
minor junco
#

Multiple ways of doing it. Database (NoSQL), Storage buckets that store json files, compressing your json file on bungeecord level and sending in to other servers through bungeecords pipeline, ...

#

Or if you want a dynamic server network that can scale: through docker

icy beacon
#

Unfortunate

minor junco
twin venture
#

easier and best way?

#

bungeecords pipeline maybe i can use redis?

minor junco
#

If you have a nosql database, I'd say that, otherwise the storage buckets

#

S3 object storage is inexpensive

#

But doesn't make a lot of sense if you just want to store configurations

#

There's many ways to do it

#

As long as you have a centralized config that can be accessed online or offline through all servers

twin venture
#

so lets say the files are in lobbyserver/plugins/lobby/kits/....json

#

how would that work if i want to use mysql? to save / load it in mysql ? or that won't work?

minor junco
#

You don't

#

You shouldn't store large json in a MySQL database kinda defeats the purpose of a relation based database

twin venture
#

but i will serlize and deserlize the items ..?

minor junco
#

And?

twin venture
minor junco
#

I wouldn't do it that way

#

If you have rw permissions you can do all this locally

torn badge
#

Having a configuration mysql table is totally fine

#

Or you could use mongo for better scalability

minor junco
#

I mean it works yeah

twin venture
minor junco
torn badge
minor junco
#

amen

twin venture
#

Alright thanks

cyan void
#

what is the difference from EntitySpawnEvent and CreatureSpawnEvent?

smoky oak
#

aint they in different apis?

#

ah

#

no

#

but one is a subgroup of the other

#

i really dont know what the right word to use is here

eternal oxide
#

creature extends entity. It's just like the damage events

#

If you ONLY want to listen to creature spawns.

smoky oak
#

shouldnt it be LivingSpawnEvent?

eternal oxide
#

a creature does not include players or armor stands

quaint mantle
eternal oxide
#

you never registered the class as a Listener

quaint mantle
#

ohhhh i keep saying what am i forgetting or doing wrong

cyan void
#

wait so witch one should i use

eternal oxide
#

this.getPluginManager.registerEvents(this,this)

#

or somethign close

cyan void
#

no like

#

entity or reature

#

creature

eternal oxide
#

oh

#

different person 🙂

#

depends what you want to listen to

cyan void
#

i just dont want mobs to spawn naturaly

eternal oxide
#

then creature is fine

cyan void
#

kk

#

thanks

#

now to make custom mobs!!!!

quaint mantle
eternal oxide
#

register

quaint mantle
#

like import you mean cause i did that too

eternal oxide
#

no

rotund ravine
#

?events

#

?eventexexutor

#

Såelling sucks ass

eternal oxide
#

?event

#

does it even exist? 🙂

#

this.getPluginManager().registerEvents(this,this)

quaint mantle
#

i think so but i never had to use before

#

i think its bukkit. not this.

covert dune
#

i am making a plugin that prevent player entering safezone if they are combat tagged, using player.setblockchange client sided

#

for now i use this:

    public List<Block> getBlocksInRadius(Player player, int radius) {
        List<Block> blocksInRadius = new ArrayList<>();
        Location playerLocation = player.getLocation();
        World world = player.getWorld();
        int rSquared = radius * radius;
        for (int x = -radius; x <= radius; x++) {
            for (int y = -radius; y <= radius; y++) {
                for (int z = -radius; z <= radius; z++) {
                    if (x * x + y * y + z * z <= rSquared) {
                        Location blockLocation = playerLocation.clone().add(x, y, z);
                        Block block = world.getBlockAt(blockLocation);
                        if (block.getType().equals(Material.GLASS)) {
                            blocksInRadius.add(block);
                        }
                    }
                }
            }
        }
        return blocksInRadius;
    }
    public void updateBlock(Player player, Location loc) {
        if (pvpmanager.getPlayerHandler().get(player).isInCombat()) {
            player.sendBlockChange(loc, Material.RED_STAINED_GLASS.createBlockData());
            Bukkit.getScheduler().runTaskLater(this, new Runnable() {
                @Override
                public void run() {
                    if(player.getLocation().distance(loc)>=9){
                        player.sendBlockChange(loc, Material.GLASS.createBlockData());
                    }
                }
            }, 40L);
        }
        else {
            player.sendBlockChange(loc, Material.GLASS.createBlockData());
        }
    }```
#

Is this a good approach?

#

Or is there a better way

lost matrix
#

Then you have a lot of faith in people not simply walking through your blocks, because the server surely wont stop them from simply walking through that 🙂

covert dune
#

I just want to display a red wall of glass

#

If they are in combat

lost matrix
#

You could display a world border as well if you want

covert dune
#

I want to achieve this effect (glass should be air)

#

That's what I got so far

umbral ridge
#

hey an entity harm, red colored effect is client side? From what I've read online. Is there a way to prevent it or customize it without a mod? with a plugin? Eg.: Cancel the harm event and manually calculate the damage? and then harm an entity, apply knockback

covert dune
#

Like I want to make a barrier that goes red near player radius

#

On the walls of a region

lost matrix
#

Yeah still reading. Your approach for getting all blocks in a radius should work but is inefficient.

covert dune
#

Idk how to explain it xd

#

Whats the best approach

lost matrix
smoky oak
#

cant you just use distanceSquared?

lost matrix
covert dune
#
    public void updateBlock(Player player, Location loc) {
        if (pvpmanager.getPlayerHandler().get(player).isInCombat()) {
            player.sendBlockChange(loc, Material.RED_STAINED_GLASS.createBlockData());
            Bukkit.getScheduler().runTaskLater(this, new Runnable() {
                @Override
                public void run() {
                    if(player.getLocation().distance(loc)>=9){
                        player.sendBlockChange(loc, Material.GLASS.createBlockData());
                    }
                }
            }, 40L);
        }
        else {
            player.sendBlockChange(loc, Material.GLASS.createBlockData());
        }
    }```
lost matrix
covert dune
#
        Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
            @Override
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()) {
                    List<Block> blocksInRadius = getBlocksInRadius(player, 8); // Example radius: 5
                    for (Block block : blocksInRadius) {
                        updateBlock(player, block.getLocation());
                    }
                }
            }
        }, 0L, 2L);```
#

this

#

inside onEnable

smoky oak
#

you probably want to filter at least by dimension

#

oh btw

#

you likely can use the boundingBoxes here

lost matrix
#

You should def profile this with spark if you want this to run on a server with more than 10 players.
Its a lot of computation for a simple visual effect.

smoky oak
#

i believe it was something like world.getNearbyPlayers(BoundingBox)

#

also youre trying to update blocks possible outside of render distance

#

cap it to a distance of maybe 31, thats vanilla's particle distance for non-forced particles

lost matrix
covert dune
smoky oak
#

uh thats the distance where it gets toggled, not where it filters by player

covert dune
#

so how should it be done to handle a lot of players?

lost matrix
covert dune
#

Yeah, thats what i need help with XD

smoky oak
#

like i said, just grab the players that should see it in the ffirst place

smoky oak
#

i mean at that point you should be fine?

#

you might want to pre-process your effect locations tho

lost matrix
# covert dune Yeah, thats what i need help with XD

I personally would add a ton of new classes to this, depending on what you are doing.
Define a distance around your wall and create a BoundingBox of that size.
Then on tick, you get all players in that BoundingBox and only update blocks for people which are
actually near your barrier.

quaint mantle
#

so i made this so far but i was wondering if its possible to make a config file where i can change the sound and the welcome message to the player from the config.yml if it possible can someone tell me how i know how to make a configcommand and yml just not how to be able to add these so i can change them from the yml
https://paste.md-5.net/ekayexudob.java

lost matrix
lost matrix
# quaint mantle so i made this so far but i was wondering if its possible to make a config file ...
wet breach
#

however, the best way to do this would just simply use packets though

smoky oak
#

packets are a pain lol

wet breach
#

this way in terms of server processing there isn't that much

lost matrix
distant wave
#

it seems like i do

wet breach
#

this is a server you control correct?

covert dune
#

of how to make it

smoky oak
wet breach
#

not sure what logic, the only difference is you are moving to just packets so the server isn't really aware of the blocks or keeping track of them. Since its just for visual purposes only the client needs to know about it. The only thing you need the server to do is just to ensure they don't cross the boundary

covert dune
#

i thought player.sendchangeblock is only clientsided

distant wave
quaint mantle
wet breach
distant wave
wet breach
#

why commission something you didn't know how to make

#

o.O

distant wave
#

when i started doing it i didnt know anything about bukkit lmao

river oracle
#

Wild

distant wave
#

its just an api ¯_(ツ)_/¯

river oracle
#

You'll need nms for what you want

distant wave
#

?nms

lost matrix
lost matrix
wet breach
# covert dune i thought player.sendchangeblock is only clientsided

while it does send packets, it still has to do other things before then. You can just inject directly into the network manager and bypass all the server stuff. Up to you which way you want to do it. If you want to stick with the api you can, however you wanted the most efficient which is not using the api.

smoky oak
quaint mantle
covert dune
lost matrix
wet breach
#

the api is great, but its not efficient

lost matrix
wet breach
#

api has never been efficient and has never really been the goal. This is why any network striving for efficiency should just make their own custom server

covert dune
# lost matrix Just use the api and focus on more impactful optimizations

so i should just optimize this and ill be good?

                  Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
            @Override
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()) {
                    List<Block> blocksInRadius = getBlocksInRadius(player, 8); // Example radius: 5
                    for (Block block : blocksInRadius) {
                        updateBlock(player, block.getLocation());
                    }
                }
            }
        }, 0L, 2L);```
lost matrix
lost matrix
slender elbow
#

if you're sending many block changes in batches then you might wanna use sendBlockChanges

covert dune
#

so running this every tick is fine if i filter out players?

lost matrix
#

Oh yeah, batching them in multiblock change packets is a good idea

wet breach
#

or you send a chunk update

#

which can just do an entire chunk in one go

#

or chunks

lost matrix
#

Multiblock change packet changes chunk sections. Thats pretty optimal for this case.

slender elbow
#

it was added to the API fairly recently, wasn't it?

wet breach
#

if that is what it does then yes, it would be the most ideal

smoky oak
#

tf is this

#

ah i forgot to adjust the specialsource didnt i

wet breach
# smoky oak tf is this

who knows, most of the vulnerabilities that anything complains about these days don't even apply majority of the time

#

since it requires to have access to begin with

smoky oak
#

i guess

#

which one is the correct for remapped again?

#

the one with the super long name?

slender elbow
#

something something "reading untrusted data sources"

wet breach
#

if someone has access you have larger things to worry about. Second, most require very very specific things to even apply

smoky oak
#

to be specific

#
          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <outputDirectory>D:/Work/DSMP/Server/plugins</outputDirectory>
                </configuration>
            </plugin>

can i make this copy the correct plugin file?

quaint mantle
#

the way i impleneted the sound enum you showed

eternal oxide
#

soundName and sound in onEnable are local variables. They are not usable in your onPlayerJoin

quaint mantle
#

well it works like that

eternal oxide
#

Because you never use them

#

those two line do literally nothing

quaint mantle
#

so they all need to be in the same place?

#

sorry still new to plugin making so i am trying to learn as best as i can

eternal oxide
#

your line 36 is the line playing sound at the moment

quaint mantle
#

yeah i want to be able to change the sound just from the config.yml

eternal oxide
#

move those two lines into your onPlayerJoin

#

and use sound instead of the Sound enum you use to play

smoky oak
#

which of the mappings on ?mappings are used by remapped? Yarn?

eternal oxide
#

Mojang

rotund ravine
#

Mojang mappings 💪🏻

#

They started releasing em a few versions ago

smoky oak
#

ah i see

quaint mantle
#

is there anything else i need to do like or is this all i need?

smoky oak
#

im trying to find packet hex 26 (?)

#

but i might need the entity packet

#

is there a simple way to listen to outgoing packets btw?

#

i want to duplicate it for a different location

rotund ravine
#

I think u can inject a handler into the packet pipeline

smoky oak
#

ill look into that later then
i dont want to rely on timing for this
i cant believe duplicating the crack effect is this difficult

eternal oxide
#

there is API for teh crack effect

smoky oak
#

since when lol

#

whats it?

#

oh its a particle now?

#

i thought it was still considered an entity

quaint mantle
rotund ravine
#

?

quaint mantle
#

it keeps making the config file to this when i don't even have that config file

smoky oak
#

can you just query blockDamage?

eternal oxide
#

I thought you wanted to display

smoky oak
#

duplicate

eternal oxide
#

No idea what you mean by duplicate

smoky oak
#

extend the effect over a larger area

eternal oxide
#

ah ok

smoky oak
#

while being in sync with the player crack

#

i could do it with timing but thats a terrible idea

eternal oxide
#

I'd check damage then, if that works, sendBlockDamage for all the other blocks

smoky oak
#

block doesnt have any damage methods

eternal oxide
#

there is a block damage event but I think it only fires once when you start

smoky oak
#

yea im aware of that

eternal oxide
#

then there is an abort event if you stop

smoky oak
#

but theres a ton of things that affect how fast you break it

eternal oxide
#

Thats probably not sent client to server though

#

as block toughness is fixed

#

its probably calculated

quaint mantle
#

why not just change the toughness of the block

eternal oxide
#

hard coded

#

not relevant to what he wants anyway

smoky oak
#

can the api tell you how long itll take for entity x with item y to break material z?

#

cuz then its just divide by 10

eternal oxide
#

no

smoky oak
#

oh irritating
theres no check method on item

rotund ravine
#

What check

eternal oxide
#

how much damage/how long to break a block

smoky oak
#

hm

#

theres block.Block::getBreakSpeed but it grabs it for the current player

#

its not accurate if for example you start breaking on a ladder and then step off

covert dune
#
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()) {
                    if(region != null && region.contains(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())) {
                        List<Block> blocksInRadius = getBlocksInRadius(player, 8); // Example radius: 5
                        for (Block block : blocksInRadius) {
                            updateBlock(player, block.getLocation());
                        }
                    }
                }
            }```
#

like this

eternal oxide
#

getBreakSpeed looks like what you want

#

from that you can start in teh damage event and apply to all blocks (fake Damage), then finish when it breaks or aborts

smoky oak
#

yea its just irritating that its inaccurate

#

if the break speed changes

eternal oxide
#

well its by tick so reasonably accurate

smoky oak
#

eh fair

#

you cant randomly queue the current breakState can you?

eternal oxide
#

you fetch the speed each tick

smoky oak
#

ah true

#

would involve some nasty math tho lol

eternal oxide
#

so if an enchant fades you apply the new break speed

smoky oak
#

yea

eternal oxide
#

nah it's just addition

smoky oak
#

just keep track of how much the block is broken and adjust accordingly

eternal oxide
#

add until 1.0+

rotund ravine
#

+1+2+1

smoky oak
#

float should be good enough

eternal oxide
#

and you just send the fake damage to each block other than the one you are actually breaking

smoky oak
#

ye makes sense

#

on a different topic

#

can i see without building where im missing javadoc? in IntelliJ

eternal oxide
#

oh as in yoru own javadoc

#

probably not as teh doc plugin jar does all that

smoky oak
#

ah ok

eternal oxide
smoky oak
#

uuuh

smoky oak
#

oh i see

#

it only highlights it in code like that tho

#

i was more thinking along the lines of scanning the source files and get a list 'missing here, here, here' cuz i can see that part myself, i just dont want to open and read through all of the files

eternal oxide
#

I don;'t use intelij but it says you can run an inspection

#

does IJ not have an error/warnings tab?

rotund ravine
#

It does

eternal oxide
#

you shoudl be able to click in there to be taken where you want

rotund ravine
#

Specially when building too

smoky oak
#

yea but building takes a while

#

i was wondering if i could just open it up somewhere

#

eh, guess its at least visible when building lol

eternal oxide
#

If it shows a warning then you click in your errors tab to select any

rotund ravine
#

There is probably a window

eternal oxide
#

the list shoudl be expandable

#

no need to build

smoky oak
#

oh interesting

smoky oak
#

not sure if its here cuz of me runing the analysis but its faster either way than building

#

ty

eternal oxide
#

if you have it set to warn in inspections they should all show up in the problems tool window

hushed spindle
#

if you're wanting to make custom break speeds you will need to use nms to accomplish it

hushed spindle
#

wdym ???

#

i aint reading up on your whole convo

#

but ive implemented custom breaking speeds so if you want to do that too i can help you along a bit

eternal oxide
#

Its not what he's doing

#

he's doing area break

hushed spindle
#

oh so you just want to make the things appear like its breaking

smoky oak
#

i mean i guess it would be interesting to know how you do it :V

hushed spindle
#

you'll still need to use nms

#

wait i think

#

lemme check lol

eternal oxide
#

not for area break

dry forum
#

when using

        as.setVisible(false);```

u can see the armorstand for a second before it turns invisible, anyway around this to make it not visible at all?