#help-development

1 messages ยท Page 2293 of 1

eternal night
#

hyperSiren ๐Ÿš“ discord plugin ?! ๐Ÿ‘ฎ blue_siren

lost matrix
reef lagoon
#

Yes

#

Ban

eternal night
tardy delta
#

\๐Ÿ˜Ž

small current
#

how can i check if a clicked inventory

#

is a top inventory

#

this kinda won't work

lost matrix
#

check if clicked inventory == inventory

small current
#

also the inventory type is PLAYER

small current
tardy delta
#

== not equals ig

lost matrix
#
if(event.getClickedInventory() == event.getInventory())
#

or .equals doesnt matter really

small current
#

and what is the InventoryAction for shift click

#

should i use the click type?

zenith gate
#
Fireball.class

is there a way to increase the explosion radius of this?

small current
#

listen for it hitting

#

cancel the explosion of it

#

create one your self

zenith gate
#

and create one

small current
#

yes

zenith gate
#

okay

oblique wigeon
#

I'm using negative sized slimes and armor stand markers to create nametags, but whenever the entities are unloaded, either the entities despawn and the nametags don't, or somehow they seperate from the nametags. I'm tracking a

#

I'm tracking a EntityDeathEvent, but is there an event to track for despawns?

#

(yes, i looked)

zenith gate
eternal oxide
#

Explosion power/yield affects the range of the explosion

small current
oblique wigeon
#

just set the explosionpower

small current
#

what version that thing is added

oblique wigeon
#

i've used it since 1.16

small current
#

i guess im just outdated

#

๐Ÿ’€

sacred magnet
#

Hey how do I make a infinite firework and it only expload on someones first join ?

eternal oxide
#

You don;t. Fireworks, like all Particle effects are timed

#

they have an animation sequence

sacred magnet
#

Can I make a particle effect for it ?

eternal oxide
#

You can define colours etc as the Firework API permits, but you are limited to what is in the API

sacred magnet
#

can I make a new API ?

eternal oxide
#

No, you are talking about Modding the client and server

sacred magnet
#

how about a message like a boss bar for a couple seconds ?

round eagle
#

is it possible to send commands to another server? all of the spigot servers are bungee instances

eternal oxide
#

Look up Title and subtitle

frozen cedar
#

how to get killer of player if killer == mob?

#

i need the name of the mob that killed the player

eternal oxide
#

getLastDamageCause

frozen cedar
eternal oxide
#

of course, getEntity is the player

#

check if the event returned is an instancof EntityDamageByEntity

#

cast it

frozen cedar
#

thx

tardy delta
#

why dont you just use the default config?

#

many plugins provide default settings when just installed

#

whats even the point of that plugin, im not fully understanding the question

#

it tries to get an uuid that doesnt exist?

#

imagine your ip changing :(

visual tide
#

does for (;;) and while (true) compile to the same bytecode or is there a significant difference?

tardy delta
#

i guess just put the uuid in when the player joines

#

and save it

#

im not understanding then

quaint mantle
#

same bytecode

#

jvm optimizes it the same

visual tide
quaint mantle
#

Probably an ofustication thing

visual tide
#

use zeros

tardy delta
#

how can current be null?

quaint mantle
#

because current.next could be null

#

Also

visual tide
#

^

quaint mantle
#

Why are you implementing a linkedlist

tardy delta
#

owh ye i see

#

smh nothing better to do

#

and my brain is dying

#

yes but current.next can be null

#

braindead atm

visual tide
#

its reassigned

#

current = current.next;

#

and next could be null

tardy delta
#

im wondering why first isnt cleared too?

fleet comet
#

Whenever you are done with brush

tardy delta
#

hmm i guess i need to set first explicitly to null but why is last set to null automatically?
DEBUG: first: Node{value=null, prev=null, next=null},last: null

tender shard
tardy delta
#

who we got there ๐Ÿ‘‹

fleet comet
#

oh yeah duh

fleet comet
#

im not sure what part of the process the error is happening though

lost matrix
lost matrix
#

The first 20 lines of your class pls

kind hatch
#

You used the reload command didnโ€™t you?

fleet comet
fleet comet
#

for 1 plugin

lost matrix
fleet comet
#

oh

#

mk

kind hatch
#

You are getting an initialization error, meaning that you probably used a reload command.

lost matrix
#

Or an exception was thrown in the constructor or a static part.

kind hatch
# fleet comet its fine?

Normally itโ€™s not a big deal for most plugins, but it definitely causes weird behavior. There are a number of things you would need to account for on a reload.

lost matrix
#

Well not in a static part

lost matrix
fleet comet
#
< here > public class HE extends JavaPlugin {

    public static HE instance;



    @Override
    public void onEnable() {
        // Plugin startup logic
        instance = this;
        saveDefaultConfig();
        getCommand("tp").setExecutor(new NewTeleportCommand());
        getServer().getPluginManager().registerEvents(new NewTeleportCommand(), this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }


    public String getPrefix() {
        return ChatColor.translateAlternateColorCodes('&', getConfig().getString("prefix"));
    }
}``` heres the main class, also its now on line 7 where the error is
kind hatch
#

Oh look. Static

fleet comet
kind hatch
#

Well, you donโ€™t need a constructor for your main class since, if it extends JavaPlugin, it will be a singleton instance.

lost matrix
#

Thats such a weird error... Do you use PlugMan?

#

I guess a normal reload could cause it as well.
Anyways dont reload anything.

lost matrix
fleet comet
#

mhm

kind hatch
lost matrix
fleet comet
lost matrix
fleet comet
#

i thought i removed thst

#

that

#

nvm

#

thanks

lucid pecan
#

hello im tryna change a 1.8.9v mod to a 1.12.2v but i cant find mcpbot's version, the website is down "export.mcpbot.bspk.rs"
can anyone help me please ?

lost matrix
#
 player.playEffect(EntityEffect.TOTEM_RESURRECT); 

Also some particles.

shadow vortex
#

Im new to making plugins and i want to make one where the longer you crouch, a bigger explosion happens when you uncrouch. Right now all I know how to do is make an explosion happen immediately after crouching. Can anyone help?

lost matrix
shadow vortex
#

No

small current
#

looks like something you use in generics

fleet comet
#

it stands for horizonessentials

small current
#

i just saw it

lost matrix
# shadow vortex No

Then go learn the java basics before jumping into spigot pls. You wont come far without knowing at least the very basics.

small current
#

why public static

fleet comet
#

also the listener isnt working anymore @lost matrix

small current
#

private static then getter

fleet comet
#

let me figure out why its not working now...

fleet comet
#

@lost matrixso it opens the gui, but the listener doesnt cancel the event

#

or do anything

lost matrix
#

debug it

fleet comet
#

i am

#

doesnt even seam like the event even runs

small current
#

@fleet comet what is the problem

fleet comet
#

oh

#

thats why

lucid pecan
small current
#

hey why

#

and why my github is light mode

lost matrix
lost matrix
solid cargo
lucid pecan
#

forge

fleet comet
#

i registed the wrong event class

small current
#

@fleet comet the event is not registered

lost matrix
small current
#

and why the naming is

#

so

#

f-ed up

lucid pecan
#

ah ok mb

small current
#

WHY YOU GOT TWO LISTENERS IN ONE CLASS

fleet comet
#

?

small current
#

WHY YOU HAVE NEW IN THE FIRST OF YOUR CLASS NAME

lucid pecan
small current
#

iaejfduehdawydgyawe-h[wadapfbohdbpawdawdwadfawfawf

fleet comet
#

what are you talking about

lost matrix
small current
#

the code is not clean

fleet comet
#

I WANT IT TO WORK FIRST DUMMY

small current
#

and i hate an unclean code

#

no one names a class NewBlaBla

#

oh i guess someone did

#

YOU

#

im just triggered of this code

#

better for me to head out

lost matrix
solid cargo
#

oH nO hE AdDED โ€œnEWโ€ bEfOrE cLaSs nAmE

fleet comet
solid cargo
fleet comet
#

YEAH

small current
#

โค๏ธ

fleet comet
#

mhm

solid cargo
#

Better fix ur own code before trying to criticise others. And if you do, do constructive criticism

fleet comet
small current
#

you registered the listener ?

fleet comet
#

yeah

#

its debugging test

small current
crude crystal
#

When using NMS, what jar should be the best for NMS after compiling / decompiling from BuildTools?

solid cargo
small current
#

what is that

solid cargo
#

Constructive criticism?

small current
#

yes

lost matrix
# fleet comet yeah

Why do you have a constructor that takes a player?
You should never create more than one instance of a listener.
Also: You are not registering all the listeners you are creating with your players.

solid cargo
#

Normal criticism: Hey yo your class name is trash
Constructive criticism: standarts of naming a listener class is blah blah blah. Its better to use standarts

lost matrix
fleet comet
small current
#

just take it as constructive thanks

solid cargo
crude crystal
lost matrix
#

Its a maven plugin

lost matrix
crude crystal
#

Thank you!

tardy delta
#

i think i fixed it

lost matrix
fleet comet
lost matrix
solid cargo
#

E e

tardy delta
#

i was bored so i decided to write my own kind of linkedlist ๐Ÿค”

lost matrix
#

Doubly or singly linked?

tardy delta
#

doubly

reef lagoon
#
public class explosion implements Listener {
    @EventHandler
    public void onBoomBoom(EntityExplodeEvent event) {
        FallingBlock fb;
        Location loc;
        for(Block b : event.blockList()) {
                fb = b.getWorld().spawnFallingBlock(b.getLocation(), b.getType(), b.getData());
                loc = event.getEntity().getLocation().subtract(b.getLocation());
                fb.setVelocity(loc.getDirection().subtract(b.getLocation().getDirection()));
                Bukkit.broadcastMessage(color("&A&lLOCATION VECTOR: " + loc.getDirection() + "\n &b&lLOCATION: " + loc));
        }
    }
}``` Why are the vectors always the same if the location is different?
lost matrix
#

poor brush

tardy delta
#

and then cipher started talking about triple linked ones ๐Ÿฅบ

lost matrix
tardy delta
#

๐Ÿฅบ

lost matrix
#

That is not conform with the definition of a list. Thats a tree.

tardy delta
#

ye

fleet comet
#

wait lol

#

or dont

tardy delta
fleet comet
#

@lost matrixdo you know how i could do that?

fleet comet
reef lagoon
lost matrix
tardy delta
#

dunno what pascal case is, just follow conventions

lost matrix
#

Why are you subtracting locations there?

#

I dont get this

reef lagoon
#

im trying to make the blocks fly in the opposite direction of the explosion

lost matrix
reef lagoon
#

pushed away from

lost matrix
#

Alright one moment

fleet comet
#

me?

#

awww

#

i need helps

lost matrix
# reef lagoon pushed away from
  @EventHandler
  public void onExplode(EntityExplodeEvent event) {
    Location baseLocation = event.getEntity().getLocation();
    World world = event.getEntity().getWorld();
    
    for(Block block : event.blockList()) {
      Location blockLocation = block.getLocation();
      Vector pointingAway = blockLocation.toVector().subtract(baseLocation.toVector());
      pointingAway = pointingAway.add(new Vector(0, 0.2, 0));
      FallingBlock fallingBlock = world.spawnFallingBlock(blockLocation, block.getBlockData());
      fallingBlock.setVelocity(pointingAway);
    }
  }
reef lagoon
#

lemme try

#

Yes that works, tysm

fleet comet
#

@lost matrixcan you help me now

frozen cedar
#

how to Component to string?

lost matrix
fleet comet
tardy delta
#

skill issue

#

๐Ÿค“

lost matrix
# fleet comet huh? sry thats super confusing? ho wwould i do the second part?

This is a very basic setup and its still missing some parts but it paints the general idea:

public interface IGui {
  void handleEvent(InventoryClickEvent event);
}
public class GuiManger {

  private final Map<Inventory, IGui> guiMap = new HashMap<>();

  public void setGui(Inventory inventory, IGui gui) {
    guiMap.put(inventory, gui);
  }

  public IGui getGui(Inventory inventory) {
    return guiMap.get(inventory);
  }

  public void removeGui(Inventory inventory) {
    guiMap.remove(inventory);
  }

}
@AllArgsConstructor
public class GuiListener implements Listener {

  private final GuiManger guiManger;

  @EventHandler
  public void onClose(InventoryCloseEvent event) {
    guiManger.removeGui(event.getInventory());
  }

  @EventHandler
  public void onClick(InventoryClickEvent event) {
    IGui gui = guiManger.getGui(event.getInventory());
    if(gui != null) {
      gui.handleEvent(event);
    }
  }

}
fleet comet
lost matrix
tardy delta
#

i'm always having a gui class that stores an inventory object and listens for the click event, then checking that inv instead of checking the map

fleet comet
#

should i use horizongui or the extended gui class instead of igui?

lost matrix
fleet comet
#

horizongui is the abstract class though, i dont think that would work

tardy delta
#

7smile7, is it bad to register a listener for each custom inv object? ๐Ÿ‘‰๐Ÿ‘ˆ

vocal cloud
#

Why though

fleet comet
#

i would think so

tardy delta
#

i was doing my stuff like this

#

old code, not an excuse smh

lost matrix
tardy delta
#

mmh ye what i was thinking, better off using a map then

lost matrix
#

And it can lead to cpu and memory leaks

vocal cloud
#

Make a custom impl to map these things

frozen cedar
#

how to item.displayName() to TextComponentImpl? (now it is TranslatableComponentImpl)

tardy delta
#

i already made enough memoryleaks, no more for today

vocal cloud
#

Not using Rust moment

tardy delta
#

๐Ÿฅบ

twilit wharf
#

When a player switches worlds, I need to get their last location in the world they switched from. But when I get the event PlayerChangedWorldEvent, the from is a world, and the players location is the current location in the new world, which could be different because of spawn plugins. How could I track where the players last location was in this world?

cursive kite
#

What if you use PlayerMoveEvent, compare if getFrom world doesnโ€™t equal getTo world

lost matrix
zenith gate
#

can blocks hold meta data when they are placed? I want to create a crafting table that is needed for some recipes, and was going to identify it by meta data. can placed blocks hold meta data?

ornate patio
#

how do i send a subtitle to a player

#

player.sendTitle("", ColorFormat.colorize("&aUse &7/family setname &ato set the name."), 10, 70, 20); this doesn't send anything to the player

fleet comet
#

@lost matrixnow how do i add guis ```java
NewTeleportGUI teleportGUI = new NewTeleportGUI(player);
GUIManager ???

#

i do not know how though

tall dragon
ornate patio
#

nvm i just figured it out rn

#

i just set the title as " " not ""

fleet comet
#

@lost matrix whenever ur ready

#

im not sure why

tall dragon
#

thats not how it works

fleet comet
#

how does it work then

tall dragon
#

you need to have only one instance of GuiManager

#

and access it from both places

fleet comet
#

oh

#

prob main class then

tall dragon
#

yea

#

right now ur just adding it to a new GuiManager

#

and that GuiManager is just gonna be garbage collected

fleet comet
#

it... works

#

wow

#

thank you so much

tranquil dome
#

I know using PlayerMoveEvent is heavily advised against, but I do require it in one of my plugins. Would the following code cause any issues performance wise?

    @EventHandler(priority = EventPriority.HIGH)
    fun onPlayerMove(event: PlayerMoveEvent) {
        if (!config!!.getBoolean("environment.fall.use-actual-fall-distance")) return

        val player = event.player
        val yLocations = getYLocations()

        if (!yLocations.contains(player)) yLocations[player] = player.location.y
        if (player.fallDistance == 0F && yLocations[player] != player.location.y) yLocations[player] = player.location.y
    }
tall dragon
tranquil dome
#

yLocations is a HashMap<Player, Double>

tall dragon
#

what does getYLocations do

tranquil dome
#

get that hashmap

tall dragon
#

ye show how

tranquil dome
#

it's inside of a companion object

#
    companion object {
        private val yLocations = HashMap<Player, Double>()
        fun getYLocations() : HashMap<Player, Double> = yLocations
    }
tall dragon
#

and it looks like this event should only be working if a config value is set to true

#

its better to not register the event at all if not needed

tranquil dome
#

I thought of that too, but my events are registered on enable. Meaning that if a server owner were to change the config value, they would have to restart the server again.

cursive kite
#

Could add a command to reload the spawner feature and register it

tall dragon
#

well then just register it on reload

tranquil dome
#

I guess that could work. But back to my first question, would that code cause any noticeable performance issues?

tall dragon
#

well how do you get the companion object

mint mesa
#

Can I ask for support on BungeeCord issues?

#

Or will that get me sent to hell and back

tranquil dome
tranquil dome
#

same class as the event function

mint mesa
#

Amazing. I can read

#

How does one make a config.yml file? Since it doesnโ€™t really work the same as spigot

tall dragon
#

or do you need to track mouse movement

tranquil dome
#

I only need to track vertical movement to be fair

tall dragon
#

well you should check if he has moved vertically

#

else just return

#

else this event will also be spammed when players just move their mouse

tranquil dome
tall dragon
#

i would do it by comparing the from location to the to location

tranquil dome
#
if (event.from.y == event.to.y) return
tall dragon
#

ya

#

so it only continues when Y has changed

tranquil dome
#

alright

tall dragon
#

do you need it to be accurate

#

else you could check if the actual Y block location has changed

#

would cut down greatly on checks

tranquil dome
#

I do need it to be accurate

tall dragon
#

hm alright. well i think it should be alright now.

tranquil dome
#

I am setting the fall distance of a player to the value of the y level in the hashmap subtracted by the y level of the player when they hit the ground

#

Because falldistance is actually just how long a player is falling for

celest thunder
#

given a location and a vector, how could i get the first entity the ray made from said location and vector passes through?

this is my current code which only works if im inside the starting location

private fun raycast(starting: Location, vector: Vector, accuracy: Int = 5): LivingEntity? {
        var loc = starting.clone()
        val addVec = vector.clone().multiply(1 / accuracy)
        val length = vector.length()
        val nearbyEntities = loc.world.getNearbyEntities(loc, length, length, length)
        nearbyEntities.re   move(player)
        for (entity in nearbyEntities)
            println(entity.name)

        for (i in 0 until accuracy) {
            loc = loc.add(addVec)
            nearbyEntities.forEach {
                if (it is LivingEntity && (it as CraftEntity).handle.boundingBox.contains(loc)) {
                    return it
                }
            }
        }

        return null
    }

    private fun AxisAlignedBB.contains(loc: Location): Boolean {
        return loc.x >= this.a && loc.x <= this.d && loc.y >= this.b && loc.y <= this.e && loc.z >= this.c && loc.z <= this.f
    }```
tall dragon
#

any reason ur not using the built in raycasting ?

celest thunder
tall dragon
#

pretty sure its like World#raycast

#

or something

worldly ingot
#

raytrace, yeah

#

One for entities, blocks, and just general purpose raycasting

vocal cloud
worldly ingot
#

World and Entity both have methods

tall dragon
#

ya

celest thunder
tall dragon
#

๐Ÿ‘

mint mesa
#

How do I make a config.YML in bungee

#

Or how do I set it up at least

tranquil dome
#

@tall dragon Is there a way for me to unregister an event listener?

tall dragon
#

yes

tall dragon
quartz basalt
#

is it possible to make a custom chatcolor? (from rgb)

tall dragon
#

1.16 plus yes

quartz basalt
#

ok im using 1.16

tranquil dome
tall dragon
#

it unregistewrs the one you provide

#

as parameter

tranquil dome
#

the entire listener?

tall dragon
#

you just provide an instance to the listener class?

tranquil dome
#
if (config!!.getBoolean("modules.damage") && bowsConfig!!.getBoolean("environment.fall.use-actual-fall-distance")) Bukkit.getPluginManager().registerEvents(PlayerMove(), plugin)
else PlayerMoveEvent.getHandlerList().unregister(PlayerMove())
#

in my reload command ^

tall dragon
#

and what is PlayerMove()

tranquil dome
#
package me.bloedarend.pvpmechanics.listeners

import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.entity.EntityDamageEvent
import org.bukkit.event.player.PlayerMoveEvent

class PlayerMove : Listener {
    @EventHandler
    fun onPlayerMove(event: PlayerMoveEvent) {

    }
    
    @EventHandler
    fun onEntityDamage(event: EntityDamageEvent) {
        
    }
}
mint mesa
#

Why is fun in there

tall dragon
#

eh im not that familiar with kotlin

mint mesa
#

Out of curiousity

#

Oh for function

#

Right

tall dragon
#

you have to provide that same instance you use to register it

tranquil dome
#
package me.bloedarend.pvpmechanics.listeners

import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.entity.EntityDamageEvent
import org.bukkit.event.player.PlayerMoveEvent

class PlayerMove implements Listener {
    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {

    }
    
    @EventHandler
    public void onEntityDamage(EntityDamageEvent event) {
        
    }
}
#

What i'd like to know is, if I use PlayerMoveEvent.getHandlerList().unregister(PlayerMove()). Does it remove the entire listener, or will it still listen to EntityDamageEvent, but ignore PlayerMove?

tall dragon
#

well as you are removing it from the PlayerMoveEvent it only affects the PlayerMoveEvent

#

i think

#

best to just test it

tranquil dome
#

sure

timid spear
#

Sorry to interrupt...

Is there a way to run a synchronous-forced event asynchronously?
I want to run LeavesDecayEvent async, but that seems not possible.

vocal cloud
#

You schedule it sync

tall dragon
#

if its read only

#

nvm i misread

vocal cloud
#

If something needs to be run sync you can't run it async

timid spear
#

hmm, that's a shame ๐Ÿ˜ฆ

tall dragon
#

why do you want to run it async?

#

doesnt seem like it would impact a huge amount

sturdy heron
#

How do you go about making a hologram a passenger of a player? I've tried casting it into an entity since it requires the entity type, but it gives me an error

player.addPassenger(hologram);```
tranquil dome
timid spear
#

Several users of my plugin reported increased resources usage on their servers.
For example; when 20 players cut down trees simultaneously.

worldly ingot
#

Well running it asynchronously is not going to fix that

celest thunder
vocal cloud
worldly ingot
#

You should get these users to create a Spark profiler for like 10 minutes and figure out why it's bogging down server resources and fix the method that's taking up so much time

#

Async isn't a performance solver

#

It's a performance hider lol

vocal cloud
worldly ingot
#

You can put makeup on a pig, but it's still a pig

vocal cloud
#

But ExecutorService lets me have 1000 threads

celest thunder
tranquil dome
vocal cloud
#

.88 seems kinda low to me?

tall dragon
worldly ingot
#

You're doing a lot of weird collection operations in your onBlockRemove() method

#

Send all relevant code

#

(or if you have it on GitHub, even better)

#

fwiw a lot of the weight of that is the Block's #equals() method, but that's likely caused by how frequently you're doing #contains() operations (on an ArrayList no less)

tall dragon
worldly ingot
#

Ideally, yeah. And use of a HashSet. Though it depends on what all the code is doing

vocal cloud
#

Well, the best solution is to use the minimalist form of comparison possible

#

If you're checking a lot of .contains() use a hashmap instead

worldly ingot
#

Hash*Set. But again. Code being used here is relevant

vocal cloud
#

Ye

timid spear
#

I am happy to hear ideas on improving

#

๐Ÿ™‚

quaint mantle
#

Quick question: Is there anyway to flip an armorstand upside down in 1.19?

tall dragon
timid spear
#

Hmm, I just did that. Without much thinking of it

#

Unnessessary?

tall dragon
#

uh yea

quaint mantle
timid spear
worldly ingot
#

Some notes on improvements:

  • Block#getType() should be called once and kept in a variable. It maps the NMS -> Bukkit type every invocation, so best to do it once, especially in hot code
  • Use of a Set (HashSet specifically) for the scheduledBlocks, and an EnumSet for the NEIGHBORS field would be ideal
  • I don't think the Collections#shuffle() is necessary because all sides are being iterated over anyways. No need for it to be randomly shuffled
  • No reason to do anything asynchronously at all in this. Can remove any attempt at asynchronousy
#

Those changes alone will probably improve performance

vocal cloud
#

I think the scheduling calls might actually decrease performance rather than increase it

worldly ingot
#

That's what I mean. The asynchronousy is hurting you more than anything

vocal cloud
#

Plus, if you delete it instantly you don't have to make sure it's still there/already queued.

timid spear
tall dragon
quaint mantle
#

yeah i saw that

#

but i'd rather just flip the entire armorstand around

worldly ingot
#

You could also make use of a Set<UUID> for your world collections instead. Though you then run into some issues of worrying about loading before world management plugins because you need a World instance to get their UUID, blah blah blah. It's fine. lol

timid spear
quaint mantle
#

It should be possible but i just cant find anything

tall dragon
worldly ingot
#

Yeah. This is one of those cases where even things as small as calling #getType() only once does make a meaningful difference

quaint mantle
#

I think you cant nametag an armorstand

worldly ingot
#

but your biggest pain point is just the #contains() operations. I think you can scrap those entirely if you remove the scheduling

tall dragon
#

a nametag is just a displayname as far as im aware

quaint mantle
#

or atleast with dinnerebone working

tall dragon
#

why do u even need it flipped

#

u need its head close to ground?

tall dragon
#

custom decay?

worldly ingot
#

Faster leaf decay

ornate patio
#

how do i show custom text under a player's username

timid spear
tall dragon
#

well maybe load distribution could also be applied. what do u think @worldly ingot

#

if your changes are not enough

quaint mantle
#

thats the only thing

tall dragon
#

have u tried setting Marker to true?

quaint mantle
#

yeah

#

When i set marker to true it isnt effected by Velocity

worldly ingot
#

Don't think the load distribution is necessary. Going async for this is really not at all necessary ;p

vocal cloud
#

I just think personally that scheduling is going to cause more harm than good here.

worldly ingot
#

I do VeinMiner entirely synchronously with zero performance hit

quiet ice
#

Are you .... using netbeans?

tall dragon
worldly ingot
#

BigBrain Yessir

quiet ice
#

You must be memeing

#

No beginner would know that ANT even exists

tall dragon
#

its a lil annoying if u wanna go cross version tho

quaint mantle
#

imma use noclip

tall dragon
quiet ice
#

I might need to begin learning ant for one of my projects. Eclipse doesn't like me using JDT and gradle has absolutely shit documentation. Writing maven plugins is a can of worms I'd not want to open after I looked at their maven resolver

quaint mantle
#

I dont know hot to work with NMs

tall dragon
#

well spawning an armorstand with noclip is rather easy luckily

quaint mantle
#

but i got the command ig uess

tall dragon
#

i would just create a class, make it extend EntityArmorStand

#
public class MiniBlock extends EntityArmorStand {

    public MiniBlock(Location location) {
        super(((CraftWorld) location.getWorld()).getHandle(), location.getX(), location.getY(), location.getZ());

        this.noclip = true;
        this.setInvisible(true);
        this.setInvulnerable(true);
        this.setMarker(true);
    }
}

for example

quaint mantle
#

((CraftEntity) entity).getHandle().noclip = true;

#

i got this

elder birch
#

yo im making a data pack my issue is that my achievement trigger isnt working

quaint mantle
#

But idk how to get nms in my plugin

#

or like

#

use it

quiet ice
#

maven is incredibly easy to understand normally given that it is XML. For gradle I have to agree

tall dragon
quaint mantle
#

wym run buildtools?

eternal oxide
#

?bt

undone axleBOT
tall dragon
quiet ice
#

understandable

vocal cloud
#

Gradle is difficult but once you learn it you can do anything

tall dragon
quaint mantle
#

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

tall dragon
#

remove -api

quaint mantle
#

just-api

#

or the whole line

tall dragon
#

it should say spigot

#

not spigot-api

quaint mantle
#

still doesnt register CraftEntity

#

recognize

quiet ice
vocal cloud
#

Yeah, it's turing complete so KEKLEO

eternal oxide
quaint mantle
quaint mantle
elder birch
#

yo im making a data pack my issue is that my achievement trigger isnt working

vocal cloud
tall dragon
#

it has like. no features

#

its only advantage is thats its blazingly fast

eternal oxide
#

Ant was the go to about 5-6 years ago

river oracle
#

very sparsley do I see people on here using eclipse

eternal oxide
#

<-

ornate patio
#

how do i display custom text underneath a username

#

no

opal juniper
#

How do you just get resource files from within a jar

shy forge
#

NoClassDefError on YamlConfiguration

ornate patio
#

for example those servers which display hp underneath a player's username

quaint mantle
#

@tall dragon why is it obfuscated

tall dragon
#

you can get it deobfuscated if you use a mapping

quaint mantle
#

so how do i know which one is noclip

#

haha

tall dragon
#

huh

quaint mantle
#

yeah im using

#

.getHandle.

#

and people on internet say you should have like an option with

#

.getHandle().noclip

tall dragon
#

yea there should be

#

noclip is not obfuscated for me

quaint mantle
#

oh

#

whow do i send pictures

river oracle
#

verify

#

hack?

tall dragon
river oracle
#

thats just a modified jar not a hack lol

sage oxide
river oracle
#

forking stuff is definitly illegal

#

all you ended up doing was forking the jar an adding stuff to it lol

#

for forking bungeecord?

#

then why does it matter

#

still confused how you would think editing open sourced software is illegal

#

oh nvm i see

#

no lmfao thats not illegal to make plugins

#

bruh probably just used reflection

quaint mantle
#

@tall dragon only have these

river oracle
#

access classes from another jar file that may be private

#

etc

#

its a great feature of java

tall dragon
tall dragon
#

to create a custom ArmorStand

quaint mantle
#

i did extend it

#

now it forces me to implement

#

this method?

river oracle
#

why aren't you using mojang mappings ๐Ÿ’€

eternal oxide
#

use mojang mappings and you can see proper names

tall dragon
#

i rlly dont understand what ur doing. i did this in 1.16 and this is my whole class

public class MiniBlock extends EntityArmorStand {

    public MiniBlock(Location location) {
        super(((CraftWorld) location.getWorld()).getHandle(), location.getX(), location.getY(), location.getZ());

        this.noclip = true;
        this.setInvisible(true);
        this.setInvulnerable(true);
        this.setMarker(true);
    }
}
#

worked fine

#

but ur not using 1.16 are u ๐Ÿ˜„

quaint mantle
#

no

#

1.19

tall dragon
#

my bad abt that i got confused with someone else i was helping

#

well then you might indeed benefit from mappings

#

like said above

tranquil dome
#

Will teleporting snowball entities on every projectile launch cause any lag?

tall dragon
#

and where they are teleported

tranquil dome
#

As to where they are teleported, about 0.2 blocks to the left

ornate patio
#

is there a way i can generate fake minecraft accounts

#

i need to test a feature with 5 players

chrome beacon
#

Mineflayer :)

#

Perfect for automating your tests

shadow zinc
#

Can I cancel a redstone event and then call it later?

edgy peak
#

I tried something in code but im not sure its right

#

List<String> playersatstart = new ArrayList<String>();

quaint mantle
#

?learnjava

undone axleBOT
quaint mantle
#

List#add returns a boolean

edgy peak
sterile token
#

๐Ÿค™

edgy peak
#

ok

shadow zinc
#

I've tried something similar to that, it doesn't work obviously, I'm just wondering how I get the delay?

#

I know how to do that, I don't know how to get the delay

subtle folio
#

Is there a way I can display two things below the player name or only 1?

#

wdym

shadow zinc
#

?paste

undone axleBOT
subtle folio
#

nothing

#

or do you mean thjis

shadow zinc
#

again, how long do I delay for

#

I understand schedulers

subtle folio
#

ticks

#

20 ticks = 1s

shadow zinc
#

okay, maybe this might help you get what im doing

#

its halting server activity and restoring it

#

this currently doesn't work all the time due to timings I imagine

sterile token
#

I would something stupid, but what could cause me not able to use a specific maven dependency added to a specific module. I have to tell that im adding as dependency the module so i should be able to use it/call it....

shadow zinc
#

Run asynchronously?

#

And I assume this will fix my timings issue?

#

I can't test it right now so its all theory

#

and you are accounting that to it messing up the timings?

#

Okay, well I will test this out later, thanks for the help

#

oh?

sterile token
#

Maven dependency issue

shadow zinc
#

why not the standard 3?

#

yep

wet breach
#

Timings can also be wildly inaccurate if that is all you are going off of as well

shadow zinc
#

it is random tick speed

#

different I guess

wet breach
#

default overall tick speed is 20, random tick speed has nothing to do with the game loop

#

it has to do with how often it chooses something randomly to tick

#

but really though, should stop going based purely off timings o.O

#

what problem is trying to be solved?

#

I mean the reason for needing to halt all redstone activity

#

which btw breaks stuff regardless

sterile token
wet breach
#

it breaks bud switches for example

shadow zinc
#

My main concern is loops

#

Its an optional feature anyways, so as long as it partly works I'm happy

wet breach
#

loops are easy

#

just have to identify a condition to make it stop or make up a condition that would make it stop

#

or you can make use of schedulers or you can just make your own thread for it

shadow zinc
#

I just did it I think

wet breach
#

async tasks you mean, they are not quite threads ๐Ÿ˜›

shadow zinc
#

Don't they use existing bukkit threads?

sterile token
shadow zinc
#

same dif

wet breach
#

its not

#

an async task just means it is broken up over a period of time, instead of trying to be completed right then and there

#

so if the server has time it will work on it

#

and then it might work on something else

#

and then the loop ends for the server, and then in the next cycle it comes back to it

#

until its finished

shadow zinc
#

so don't use async?

#

this is what I got, good?

#

better rather

sterile token
#

DONT JOKE with people that are learning...

shadow zinc
#

yeah, you bully

true shuttle
#

I think I'm just forgetting something, but how can I have something always run? basically I'm trying to run something whenever a player is in direct sunlight, and I know how to do that part, but how can I always check for that? thanks!

#

no

sterile token
#

As my father always told me if you wont help dont disturb

shadow zinc
#

runnables?

#

bruh my internet cut off

#

lol do it on move

true shuttle
shadow zinc
#

np

sterile token
shadow zinc
#

God async is so juicy

#

anyways thanks for the help, im on the same time tomorrow I'll let you know how it went

sterile token
dusk flicker
#

I mean, joke with people, but make it clear it's a joke

true shuttle
hybrid spoke
hybrid spoke
young knoll
#

I run my async async

#

Just to be sure

hybrid spoke
#

running the async async, does that mean its sync again?

quick geyser
#

Can I check if a player can break a block with the rightClick interact event? Check for spawn protection, worldguard, towny, claims, etc..

hybrid spoke
#

hf checking for all these "etc"

quick geyser
#

Hm.. so maybe instead of right click I have them actually break the block and let these plugins cancel it before I do anything

young knoll
#

You can send a fake block break event and then check if it gets cancelled

quick geyser
#

Hm? How to send a fake one

young knoll
#

But keep in mind what consequences that may have

young knoll
zenith gate
#

don't 100% know if this is related to spigot, but I think it is to coding.

I have custom textures that I am trying to add, When added ones for an enchanted book because those are what my skills are, it adds it to all of the skill books, even tho they all have different ModelID numbers.. \

quick geyser
young knoll
#

Other plugins may do stuff with that event that you donโ€™t want

#

A simple example would be logging plugins

quick geyser
#

Hmm okay I'll debug a bit and see if I have any issues, how does one go about constructing an event? Sorry a bit new to plugin development

young knoll
#

new BlockBreakEvent

quick geyser
young knoll
#

Well if youโ€™re calling it when a block isnโ€™t actually being broken, then yes

quick geyser
#

I can still harvest even tho towny says no when I punch the crop

sterile token
quick geyser
#

It is Kotlin

young knoll
#

Did you call the event

#

Bukkit.getPluginManager.callEvent iirc

sterile token
#

Why....

quick geyser
#

You use what you use, I'll continue to use what I use. The beauty of preferences and options

quick geyser
young knoll
#

No

#

Check isCancelled on your event object after using callEvent

true shuttle
#

hey, how can I check if a player has nothing on their helmet slot?

#

i tried checking for null and air, but neither worked

#

it worked when I checked for a specific helmet, so it's not a different part of the code

delicate lynx
#

how are you checking it

true shuttle
#

player.getInventory().getHelmet().getType().equals(null)

fleet comet
#

Does anybody know how to add a make a combat tag system, i tried to use this but it just doesnt work ```java
public List<Player> damaged = new ArrayList<>();
private int taskid;

@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
    if (event.getEntity() instanceof Player) {
        Player player = (Player) event.getEntity();
        damaged.add(player);
        if (event.getDamager() instanceof Player) damaged.add((Player) event.getDamager());
        BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
        taskid = scheduler.scheduleSyncDelayedTask(HE.instance, () -> {
            int count = 30;
            if(count <= 0) {
                damaged.remove(player);
                scheduler.cancelTask(taskid);
                return;
            }
            count =- 1;
            TextComponent message = new TextComponent("You're in combat for " + count + " more seconds");
            message.setColor(ChatColor.of(Color.MAGENTA));
            player.spigot().sendMessage(ChatMessageType.ACTION_BAR, message);
        }, 30);
    }
}```
quick geyser
delicate lynx
true shuttle
fleet comet
#

use == null

#

after the check

delicate lynx
#

also, don't check the type, check if the itemstack is null

fleet comet
#
if (player.getInventory().getHelmet().getType() == null) {
stuff
}```
true shuttle
fleet comet
#

remove the gettype

true shuttle
#

oh ok

#

thx

#

Works! thx sm

granite burrow
#

is there a way to add lore to a custom enchant? I know that it can be done manually with events, however is it possible to detect whenever a specific enchantment is added to a command. For example in a command (Essentials: /enchant)

young knoll
#

Not easily

fleet comet
young knoll
#

Thatโ€™s why I use packets for custom enchantment text

fleet comet
#

that executes the normal enchant command if the arg isnt one of ur enchants

granite burrow
#

wouldn't that make it only support one specific command? There isn't a way to make it dynamic huh?

fleet comet
#

and if it is, use custom give methods

#

there is, just complicated

granite burrow
#

is there a way to check if a command is a default minecraft command?

fleet comet
#

well minecraft:command

#

is from minecraft

granite burrow
#

is there a way to tell if it was a plugin command or one from minecraft in the preprocesscommand event?

delicate lynx
fleet comet
#

yeah

#

but it doesnt

delicate lynx
#

well scheduleSyncDelayedTask() runs only once

#

and you also never remove the damager from your list

fleet comet
#

oh

#

what runs it multible times?

delicate lynx
#

and the 30 at the end of the runnable is in ticks, not seconds

#

so it would run after 30 ticks

fleet comet
#

yeah i was testing

delicate lynx
#

you would want to use scheduleSyncRepeatingTask

fleet comet
#

what are the args for that?

#

wdtm

delicate lynx
#
taskid = scheduler.scheduleSyncDelayedTask(HE.instance, () -> {
}, delay, period);
#

delay is how many seconds before it runs, period is how many ticks between runs

#

so if you want it to run every second, set 0 delay, period to 20 ticks (20 ticks = 1 second)

fleet comet
#

mk

#

@delicate lynxalso how would i use multible colors in a title

#

or an action bar

delicate lynx
#

if you're using TextComponent, you could make ones for each color of the sentence

#

TextComponent has addExtra(TextComponent) which let's you add them together into 1

#

so you could make different ones with different colors and just add them together

fleet comet
#

why is the number -1

delicate lynx
#

I would check if it's == 0 instead

subtle folio
#

we need to see some code

delicate lynx
#

so it doesn't display it

subtle folio
#

is better

fleet comet
#

i used that

subtle folio
#

just incase

delicate lynx
#

oh

subtle folio
#

?paste code

undone axleBOT
delicate lynx
#

the code is above

fleet comet
#
public List<Player> damaged = new ArrayList<>();
    private int taskid;

    @EventHandler
    public void onDamage(EntityDamageByEntityEvent event) {
        if (event.getEntity() instanceof Player) {
            Player player = (Player) event.getEntity();
            damaged.add(player);
            if (event.getDamager() instanceof Player) damaged.add((Player) event.getDamager());
            BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
            taskid = scheduler.scheduleSyncRepeatingTask(HE.instance, () -> {
                int count = 30;
                if(count <= 0) {
                    damaged.remove(player);
                    scheduler.cancelTask(taskid);
                    return;
                }
                count =- 1;
                TextComponent message = new TextComponent("You're in combat for " + count + " more seconds");
                message.setColor(ChatColor.of(Color.MAGENTA));
                player.spigot().sendMessage(ChatMessageType.ACTION_BAR, message);
            }, 0, 20);
        }
    }
#

ill paste it again though

subtle folio
#

use ?paste

#

?pastw

#

?paste

undone axleBOT
subtle folio
#

use this

fleet comet
#

okay next time

fleet comet
sterile token
fleet comet
#

wdym @delicate lynx

delicate lynx
#

I was wrong, use <= 0

sterile token
#

hahaha loving lambda one-liners

public List<String> complete(CommandSender sender, Set<Argument> args) {
  return args.stream().filter(arg -> !arg.getPermission().isEmpty() && sender.hasPermission(arg.getPermission())).map(Argument::getName).collect(Collectors.toList());
}
fleet comet
#

?paste

undone axleBOT
fleet comet
#

@delicate lynxhttps://paste.md-5.net/ihuzudenev.cs

cursive kite
#

You are setting it to -1?

sterile token
#

any better for idea for making an invisble block? Atm im just getting the block and setting to air and them setting it back to the its type

fleet comet
#

oh

cursive kite
fleet comet
#

?

cursive kite
#

Your code literally says count = -1

sterile token
#

var = var - 1

fleet comet
#

i prefer -=

sterile token
#

....

cursive kite
#

I use countโ€”

fleet comet
cursive kite
#

Discord formatting count - - ;

sterile token
#

take in care that:

count -- != ** -- count**

#

๐Ÿ˜‚

cursive kite
#

You have one count variable?

#

What if multiple players trigger the event?

sterile token
fleet comet
sterile token
left pine
#

mmm.... hello am someone tell me why this appears?

this is the code
package info.miplugin;

`import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

import info.miplugin.comandos.ComandoYoutube;

public class MiPlugin extends JavaPlugin{
PluginDescriptionFile pdffile = getDescription();
public String version = pdffile.getVersion();
public String nombre = ChatColor.AQUA+"["+ChatColor.GREEN+pdffile.getName()+ChatColor.AQUA+"]";

public void onEnable(){
    Bukkit.getConsoleSender().sendMessage(nombre+ChatColor.WHITE+" Esta listo (version: "+ChatColor.LIGHT_PURPLE+version+ChatColor.WHITE+")");
    registrarComandos();
}

public void onDisable(){
    Bukkit.getConsoleSender().sendMessage(nombre+ChatColor.GOLD+" Esta terminado (version: "+ChatColor.DARK_PURPLE+version+ChatColor.GOLD+")");
}

public void registrarComandos(){
    this.getCommand("youtube").setExecutor(new ComandoYoutube(this));
}

}`

undone axleBOT
cursive kite
#

๐Ÿ˜ฎ

sterile token
#

Open that url and paste the code there, press CTRL + s and copy the url

left pine
fleet comet
#

oh yeah

#

how would i do this then?

sterile token
#

๐Ÿ˜‚

#

Atleast learn the correct formatting in discord

sterile token
left pine
#

well here it shows that I put it

`main: info.miplugin.MiPlugin
version: 0.1pre-alpha
name: MiPlugin

conmmands:
youtube:
description: El comando youtube de MiPlugin`

zenith gate
#

is there a limit on the GENERIC.ARMOR && GENERIC.ARMOR_TOUGHNESS Attributes?
Im only getting 30 value when should be getting 80

undone axleBOT
sterile token
#

Agree

#

I already told him

#

So if doesnt listen is because he dont want help

left pine
#

what?

sterile token
cursive kite
#

Whatโ€™s wrong with using โ€˜โ€™โ€™player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));โ€™โ€™โ€™

sterile token
#

@left pine

#

Lmao

cursive kite
left pine
sterile token
#

I talk spanish that why i ask to you (Hablo espaรฑol por eso te pregunto)

fleet comet
#

but i need it to look like this "&7(&ftime&7) &cCombat Tagged"

#

how would i do that?

#

with 2 compononts?

sterile token
sterile token
fleet comet
#

there can only be 1 color per componont

sterile token
#

You can use ChatColor#translateAlternateColors or something like that

fleet comet
#

text compononts

#

you can use chatcolor on text compononts?

sterile token
fleet comet
#

oh

#

okay

#

i.. that would of saved me a few hours

sterile token
fleet comet
#

also that is aqua

#

i never knew that-

cursive kite
#

Whatโ€™s wrong with my action bar method?

cursive kite
#

player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));

#

And just use color codes vs multiple text components?

fleet comet
#

ChatColor is easy

#

easier

young knoll
#

Armor caps at 30

#

No idea about toughness

zenith gate
#

any way to get around it?

young knoll
#

Make a custom armor system

zenith gate
#

mhm... yeah, the only hard part ( for me at least ) is getting to work instead of minecraft armor system

shy forge
#

Quick question to check if I'm crazy or not. Hosting a server on localhost is supposed to give other computers on the same network access to it right?

zenith gate
#

through their IP yes

#

localhost is only for on same machine as the server

shy forge
#

Mk, mine's not working and I'm driving me up the wall a bit

river oracle
zenith gate
#

connect via your internal IP

shy forge
#

Port forward is only for not-on-the-same-network I thought?

zenith gate
#

thats for outside your wifi

#

so if you want your friends to connect you got to port forward..

shy forge
#

Right right. I'm currently trying to get my old computer to connect to my new one

#

Lemme try internal ip

zenith gate
#

Want to know how to make a Minecraft server in 1.18? Well, this is the video for you! We show you exactly how to create a Minecraft 1.18 server in order to start playing Minecraft 1.18 with your friends. This truly is a complete guide on how to start a Minecraft server in 1.18, so letโ€™s go ahead and jump right on into it!

Get a 24 hour DDOS Pro...

โ–ถ Play video
#

he will tell you pretty much everything

shy forge
#

U sure that's not just port forwarding?

cursive kite
#

Same Wi-Fi just type your ip not localhost, external use VPN

zenith gate
#

if your servers ip is 192.168.1.99
in minecraft for server ip put 192.168.1.99

shy forge
#

I'm trying different device, same network

cursive kite
#

Type your hosting device IP

#

No Port toward

noble lantern
#

Hey anyone a math wizard in here?

How can i convert a ChunkSnapshot location to a Block location

I thought the formula was:

(snapshotX * 16) * chunkWorldLocationX (Same for Z)

But it acts rather odd with negative values and obviously wouldnt work if a x or z was 0 in this code snippet here

shy forge
#

Got it working

#

Yh, it was internal ip

#

Sorry, kept trying to find my internal one and it kept giving me my public one

#

Thanks guys :)

wind tulip
#
    @EventHandler
    public static void PlayerLeave(PlayerQuitEvent event){
        if(Bukkit.getServer().getOnlinePlayers().size() == 0) DFVar.globalVars = new HashMap<>();
    }

is the player count from before or after the quit event?

#

I can't test right now

worldly ingot
#

I want to say it's before

#

(you can omit getServer() by the way. All Server methods are statically mirrored in Bukkit)

young knoll
#

I would say before since the player object is still valid

sleek trout
#

the problem is that i get the base price not the updated or the inflated price

young knoll
#

Itโ€™s per player

#

Not sure if thereโ€™s an api for it?

fleet comet
#

the code looks like shit but it works lol

granite burrow
#

Hey so I have been working in the PlayerCommandPreprocessEvent and I'm trying to determine if the command is one from Minecraft or if it is one from a plugin.

I setup a reference to the server's CommandMap and checked if the command was in there by doing CommandMap#getCommand(command) that outputted that it is a Minecraft registered command by sending this org.bukkit.craftbukkit.v1_18_R1.command.VanillaCommandWrapper(command), however, I'm not sure what I can do with this information now that I got it. Any ideas?

fleet comet
#

ha lol

#

i posted update cause i forget to fix something

#

the ! in the if statement wasnt there-

#

andd fixed

#

yep

noble lantern
ornate patio
#

is it possible to create command hints like the red underline here

echo basalt
noble lantern
#

would love to use bit shifts cause theyre way faster than the ladder option im doing

echo basalt
#

~ int realX = chunkPosition.getChunkX() << 4 | x;

noble lantern
#

Whats | x?

echo basalt
#

bit OR

#

x is 0-15

noble lantern
#

ill try this in a min

echo basalt
#

within the chunkposition

#

I honestly don't know why you were multiplying X by 16

#

the formula is chunkX << 4 + x

#

or chunkX * 16 + x

zenith gate
#

does the ender dragon death work differently then all other entities? im trying to get the killer and give it items

fleet comet
#

@last templei should of just released it with bstats- yet another release

dim palm
#

Hello, this code is good or i need to use another method?

vocal cloud
#

Probably by importing the correct dispenser I imagine

ornate patio
#

What's the convention for listing an argument that could either be any string, or a certain string to do something else

#

for example

#

/setownname <name|unnamed> This is what I have right now but it doesn't look right to me

#

name could be any name the user wants to name themselves

#

or they could type the literal string "unnamed" if they want to set their name to null

compact haven
#

there is no convention to command usage

#

I guess the only convention is [] <> which is stilll swapped by many plugins

waxen plinth
#

Why not just make the argument optional

compact haven
#

I don't think that's as clear

waxen plinth
#

How not

#

[] is generally used for optional args

compact haven
#

No, that not including it will clear it

#

instead of give you more info like the usage of the cmd

waxen plinth
quartz gull
river oracle
#

Research proper singleton objects

ornate patio
#

heโ€™s saying (I agree) that doing /setownname without a parameter to clear the name is confusing

#

when usually you would just type the command to get the usage message

sleek trout
cursive kite
#

I want to add multiversion support to my plugin, I don't plan to use any NMS but am not sure at this point, would Maven modularity be the best option to look into?>

compact haven
#

how do you typically find out the arguments of a command? by typing it without arguments

#

otherwise, how do you get the usage

#

by having a single optional argument, it's difficult to immediately understand how to set the nickname, or how to clear it

waxen plinth
#

Not something that could be an argument

ornate patio
#

i guess

#

but im lazy

fleet comet
#

also really buggy

cursive kite
#

I clicked a random file

#

NewTeleportCommand.java line 29 you don't return after your null check

#
                    player.sendMessage(he.getPrefix() + ChatColor.translateAlternateColorCodes('&', "&cThat player is not online"));
                }```
fleet comet
#

Oh, also can you just DM me the issues so i can wake up tmr and say MORE WORK

drowsy helm
#

i can REALLY nitpick it if you want

fleet comet
#

@cursive kite

#

please do

#

just dm me it

#

ima be spammed (:

#

@drowsy helmplease do

tender shard
fleet comet
#

im fixing that tmr, not sure how to use gradle with it

tender shard
#

why are all your fields public in the main class?

fleet comet
tender shard
#

and why are they static too? you should rather create instance methods as getters for your CombatManager, GUIManager, etc

#

like ```java
public CombatManager getCombatManager() { return this.combatManager; }

#

then make it a private instance field

small current
#

im not gonna read the code again

fleet comet
#

mk

noble lantern
#

Does anyone know the NMS methods to make a Player place blocks/use items in theyre main hands?

#

cant seem to find em, im just replicated it by swinging the nms arm, facing npc at location and settting the block there

quartz gull
#

not sure