#general

1 messages ยท Page 205 of 1

gilded nova
#

yep

#

fun

#

Why does java have a >>>????

#

Like, I get << and >>, shifts

#

But >>>?

#

a: unsigned right shift operator

#

well

#

ok . _.

deft thistle
#

halp

gilded nova
#

Zero-fill right shift

#

try plugin, this

#

I mean you can't declared unsigned variables in java... yet it has that

#

Also dont make events in your main class

#

That looks good to me honestly

#

He isn't

#

ffs im blind

deft thistle
#

??

gilded nova
#

Register the event in the main class

deft thistle
#

ok

gilded nova
#

onenable

deft thistle
#

oh yeahh

#

i cant even create a new space

gilded nova
#

ohohohoh

#

I see the issue

deft thistle
#

nmo

#

like

#

when i press enter

#

i can go down

gilded nova
#

what

#

You're calling registerEvent, the one you're looking for is registerEvents with an S

#

registerEvent takes a completely different set of parameters

#

Just register it in your main class

#

too

deft thistle
#

i cant

gilded nova
#

You can

#

you can't what?

deft thistle
#

hold on let me make a vid

gilded nova
#

DON'T GIVE UP

#

getServer().getPluginManager().registerEvents(new ClassName(), this);

#

YES YOU CAN

deft thistle
#

ffff

gilded nova
#

getServer().getPluginManager().registerEvents(new JoinListener(), this);

#

Copy and paste that into your onEnable

deft thistle
#

fffffffffffffffffff

#

physically cant

gilded nova
#

Press insert

#

on your keyboard

deft thistle
#

bruh

#

what even happened

gilded nova
#

You pressed insert?

#

lol

deft thistle
#

ok

gilded nova
#

Tell me if it works

#

If you have numlock off, the zero key on your keyboard is also most likely insert

deft thistle
#

why would i need to put this getServer().getPluginManager().registerEvents(new JoinListener(), this);

#

i dont have a num pad

gilded nova
#

Because its registering the event

deft thistle
#

wouldnt new JoinListener(this); work

gilded nova
#

no

#

just paste what i gave you

#

lol

deft thistle
#

well it gave this error

#

java: constructor JoinListener in class me.muhammad.listners.join.JoinListener cannot be applied to given types;
required: me.muhammad.listners.Main
found: no arguments
reason: actual and formal argument lists differ in length

gilded nova
#

Is there a red line

deft thistle
#

yes

gilded nova
#

DId you take it out of your other class?

#

You spelt listeners wrong also

deft thistle
#

oof

gilded nova
#

Take the event register out of your join listener class

deft thistle
#

cant change it now

gilded nova
deft thistle
gilded nova
#

Well if it works

#

leave it

#

the one I gave you is just easier

deft thistle
#

new JoinListener(this); this also works

#

oh well

#

test time

gilded nova
#

Take what I gave you out of the onEnable

deft thistle
#

no errors

gilded nova
#

Honestly, ever since I got tired of forgetting to register my listeners, I made myself a little helper library/framework with a SelfRegisteringListener implements Listener class that registers itself on construction lmao
I never have to register a listener myself ever again

deft thistle
#

Take what I gave you out of the onEnable
@gilded nova i did

gilded nova
#

Good. But for future reference, getServer().getPluginManager().registerEvents(new JoinListener(), this); is all you need to register the listener instead of this chunk. However you can do it any way you like, it doesn't matter. The way you did it can result in a cleaner main class, but the way I did it just makes it simpler lol

deft thistle
#

ok

#

ill try both

#

bruh

#

invalid plugin.yml

gilded nova
#

Show me the plugin.yml

deft thistle
#

oh

#

its in the wrong spot

gilded nova
#

if you use the mc development plugin for intellij, it automatically creates it for you ๐Ÿ™‚

deft thistle
#

how can i get it

gilded nova
#

Just install the mc development plugin

#

its cheating

#

but like

#

its good

deft thistle
#

this?

gilded nova
#

ctrl+alt+s

#

for settings

#

and install it in the plugins tab

#

And when you create a new project, just choose spigot plugin or whatever you want to make

deft thistle
#

pog

gilded nova
deft thistle
#

dangggg

#

will i still have to give it the jar file though

#

Caused by: java.lang.UnsupportedClassVersionError: me/muhammad/listners/Main has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 52.0

#

bruh

vast isle
#

did you forget to change the project sdk

gilded nova
#

Project Settings

deft thistle
#

yes i did

gilded nova
#

Project

deft thistle
#

oop

gilded nova
#

Project language level

deft thistle
#

fefo you didnt need to do taht

gilded nova
#

You might need to set it in the module (in the modules section) as well tho

deft thistle
#

ok time to see

#

if it works

#

ez

#

time to get on my alt

#

twice

gilded nova
#

You need to set join message

deft thistle
#

and the leave message didnt work

#

nvm

gilded nova
#

e.setJoinMessage I believe

deft thistle
#

i didnt make leave message

gilded nova
#

Lol

#

My pc just cooked itself

#

Tobi why you always typing and then stop

sleek niche
#

Because I like to annoy people

#

Honestly: My device is just old, veeeeery old

gilded nova
#

fair enough

deft thistle
#

@gilded nova where would i put e.setJoinMessage

#

nvm

gilded nova
#

in the event

deft thistle
#

yes ik]

#

small brain

gilded nova
deft thistle
#

ikkkkkkkkk

gilded nova
#

cool

deft thistle
#

already compiled

#

but this happens

gilded nova
#

?

#

oh

#

here

deft thistle
gilded nova
#

You need to use translatealternatecolorcodes

#

wait

deft thistle
#

i did

gilded nova
#

Why is there an & there

#

You must've just put it in by mistake?

deft thistle
#

i just made a new class

gilded nova
#

Can you show me your listener

#

class

deft thistle
gilded nova
#

It's probably in your config

#

Accidentally put a & in there

#

without a letter or number

deft thistle
#

i forgot the > at the end

#

in the else

gilded nova
#

Do you have a & in your name?

deft thistle
#

&a

#

its a color

gilded nova
#

Are you sure you did &a and not just &

deft thistle
#

yes

#

lets see

#

maybe ur right

#

theres an &a

#

but it still shows the &

#

and no color

gilded nova
#

Can you send me the config

deft thistle
#

`firstJoin_message: '&a<player> &6has joined the server for the first time!'

join_message: '&a<player> &7has joined the server'`

gilded nova
#

Should be working

#

if you put the > at the end of <player

deft thistle
#

u want the event

gilded nova
#

sure

deft thistle
#

i did

#

`@EventHandler
public void onJoin(PlayerJoinEvent e){
Player p = e.getPlayer();

    if (!p.hasPlayedBefore()){
        e.setJoinMessage(Utils.chat(plugin.getConfig().getString("firstJoin_message").replace("<player>", p.getDisplayName())));
    } else{
        e.setJoinMessage(Utils.chat(plugin.getConfig().getString("join_message").replace("<player>", p.getDisplayName())));`
#

oof

#

fortmatting

gilded nova
#

use code blocks

#

```java

```

deft thistle
#
    public void onJoin(PlayerJoinEvent e){
        Player p = e.getPlayer();

        if (!p.hasPlayedBefore()){
            e.setJoinMessage(Utils.chat(plugin.getConfig().getString("firstJoin_message").replace("<player>", p.getDisplayName())));
        } else{
            e.setJoinMessage(Utils.chat(plugin.getConfig().getString("join_message").replace("<player>", p.getDisplayName())));```
gilded nova
#

should be working hahahaha

deft thistle
#

ill just screen shot

#

yeah

#

let me make a leave message

gilded nova
#

Make sure you restart the server with the new jar

deft thistle
#

i jjust /reload

gilded nova
#

no

#

restart

#

with the new jar

deft thistle
#

theres only 2 plugins

gilded nova
#

And if you changed the config, make sure you delete that too

#

restart

#

the fucking server

deft thistle
#

fine

#

fffffffff

gilded nova
#

Heres the process: compile > stop server > replace jar / delete directory > put in new jar > start server

deft thistle
#

k

gilded nova
#

Can you send me a screenshot of the config

#

I dont think you're doing it right

deft thistle
#

i didnt change it

gilded nova
#

Send it to me

#

a screenshot

deft thistle
#

which config

#

on the server

gilded nova
#

yeah

deft thistle
#

or the plugin

gilded nova
#

server

deft thistle
#

f

gilded nova
#

Why did the top one work correctly?

deft thistle
#

it didnt

#

it missed the first letter

#

and yup

#

the config was wrong

#

it said only &

gilded nova
#

You have to delete the config file if you make changes to the config

#

I told you so lol

deft thistle
#

we dont talk about those

#

ok now my name isnt cutoff

#

perfect

#

time to code a leave message

gilded nova
#

Because it would've been doing &d

deft thistle
#

still &a

#

and <player> would let that happen

gilded nova
#
@EventHandler
    public void onQuit(PlayerQuitEvent e){
        Player p = e.getPlayer();
        if (!(p.hasPermission(plugin.getConfig().getString("silent_leave_permission")) {
            e.setQuitMessage(Utils.chat(plugin.getConfig().getString("Quit_message").replace("<player>", p.getDisplayName())));
   } else {
            e.setQuitMessage("");
   }
}
#

done

deft thistle
#

excuse me

#

i wanted to do it

gilded nova
#

you still can

#

ill make it better

deft thistle
#

its literally the same

#

besides broadcast message

gilded nova
#

I made it fancier

deft thistle
#

leave.silent?

gilded nova
#

If they have that permission, they'll have no quit message

deft thistle
#

bruh

#

i would need to make a toggle for that

gilded nova
#

That's only if they have the permission lol

deft thistle
#

dont do it for me

gilded nova
#

like admins

deft thistle
#

still

gilded nova
#

There you go, variable permissions

#

Wait lets expand

deft thistle
#

idk how to do that yet

#

pog

#

it does work

gilded nova
#

Here

#
@EventHandler
    public void onQuit(PlayerQuitEvent e){
        Player p = e.getPlayer();
        if (!(p.hasPermission(plugin.getConfig().getString("silent_leave_permission")) {
            e.setQuitMessage(Utils.chat(plugin.getConfig().getString("Quit_message").replace("<player>", p.getDisplayName())));
        else if (p.getName().equals("Hayawii") {
            e.setQuitMessage(Utils.chat("&dthe guy that needs to learn basic java before diving into spigot API (" + p.getName() + ") just quit!"));
       }
   } else {
            e.setQuitMessage("");
   }
}
deft thistle
#

bruh

gilded nova
#

๐Ÿ˜›

deft thistle
#

how do i open a new project but keep the old one on the side like eclipse?

gilded nova
#

Ew eclipse

#

also

potent prawn
#

intellij?

gilded nova
#

just open a new one and say new window

deft thistle
#

yes

potent prawn
#

yeah what tim said

gilded nova
#

Instead of this window

potent prawn
#

when you go to open a project it will ask to use the current window or a new window

#

i usually have like 3 open lol

gilded nova
#

Same but it cooks my slow pc

deft thistle
#

wut

gilded nova
#

GroupID: me.muhammad

#

ArtifactID: whateveryourprojectis

deft thistle
#

ah

gilded nova
#

Didnt you do this like twice already?

deft thistle
#

no

#

i just now used the mc plugin

gilded nova
#

oh

#

Mm heatpipes

deft thistle
#

mm 2 trash gpus for now

gilded nova
#

why 2

deft thistle
#

560 ti only has one hdmi

#

and its mini

gilded nova
#

Damn boy 560ti

deft thistle
#

and no vga

gilded nova
#

How do you run minesweeper

deft thistle
#

i dont

#

only the 3080 will

#

release it already nvidia

#

i had a 2080

#

but sold it early so i can get the most money

gilded nova
#

Yes overpriced cases

deft thistle
#

i got that zalman case

gilded nova
#

Mines the $180 fractal design mesh one

#

Lol

deft thistle
#

my case is 60 dollars

#

5 fans

gilded nova
#

lots of fans

deft thistle
#

but two of the fans are absolute garbo

#

and make bearing noise

#

erased

#

they are the blue colored fans

gilded nova
#

Same

#

Zip tied cables because they were lookin messy

deft thistle
#

120mm aio

#

๐Ÿ˜†

gilded nova
#

Literally the shittest thing hahaha

deft thistle
#

any 50+ dollar air cooler is better

gilded nova
#

AIO looks better

#

change my mind

#

the pump is so loud

deft thistle
#

not a 120mm aio

gilded nova
#

the pump

#

is louder than all my fans

deft thistle
#

my pump can only be heard when all the fans are unplugged

#

hard drive is louder

#

lmao

#

at 4000rpm

gilded nova
#

I need my r5 3600x to come but its taking forever in the post ๐Ÿ˜ฆ

deft thistle
#

WOAH

#

27c

#

how

#

i have a 3600 @4.3ghz 1.3v

#

and it idles at 40-50

#

what plugin should i make

#

death messages

#

yeah

#

bruh

#

where would i put the config.yml

gilded nova
#

in resources

lofty compass
#

Papa is that you

deft thistle
#

is this all i need for a death messages plugin?

#

nope

#

guess noti

#

oh

#

im small brained

#

ez

#

all the potential plugins i can make

potent prawn
#

now you're thinking

deft thistle
#

and i dont have to pay any one anything

gilded nova
#

You dont have to pay if you get leaked premium plugins ๐Ÿ˜œ

deft thistle
#

shhh

gilded nova
#

and decompile

deft thistle
#

we dont talk about that

#

wait i can do that ๐Ÿ˜ฒ

gilded nova
#

No its against TOS

deft thistle
#

if your already getting the premium plugin for free why would it matter

gilded nova
#

Well if you're already getting it for free, it's already against the TOS

deft thistle
#

exactly

gilded nova
#

Don't do it man. The devs put hard work into their plugins (most of the time)

deft thistle
#

bruh why am i learning how to make plugns then

#

so i wont have to pirate

storm berry
#

hi if anyone knows a block inspection mod for sponge pls let me know!!

gilded nova
#

I'm almost certain devs that have open sourced projects are friendlier than ones with premium plugins because 9 times out of 10 they feel like they are superior lol

deft thistle
#

friendlier?

gilded nova
#

Yeah

lavish mural
#

hi can someone help me with perms? bc i dont know how to set any

gilded nova
deft thistle
#

that wouldnt be offtopic

#

lmao

lavish mural
#

oh oops lol

deft thistle
#

how do i become a @verified

lavish mural
#

i'll go to general 2

potent prawn
deft thistle
#

ah

gilded nova
#

Think you have to be a good dev

#

LOL

deft thistle
#

yup

#

u would be better fit

gilded nova
#

The verified dudes are good good devs

steel shuttle
#

except for the bad ones like me

rigid widget
#

The verified dudes usually make and maintain massive community projects

potent prawn
#

they are typically well-known ones involved with popular projects

deft thistle
#

technically im invlolved

gilded nova
#

With what

#

using the spigot api

#

hehe

deft thistle
#

yes

gilded nova
#

Makes join event listener = verified

deft thistle
#

yes

#

ofcourse

#

what do you want me to do

#

make the next skywars?

gilded nova
#

yes

#

ofc

deft thistle
#

hmmmmmmm

#

ok

#

i have a plugin in mind

#

server wide party plugin

gilded nova
#

Like bungeecord?

deft thistle
#

yes

gilded nova
#

Bungeecord is different to spigot api

#

i hope you know that

deft thistle
#

oof

#

how different?

gilded nova
#

Its similar

#

I've never used it

deft thistle
#

how would i change the death message to different deaths?

gilded nova
#

Use some sort of randomizer code lol

deft thistle
#

o i think i know

gilded nova
deft thistle
#

no not random

#

is there a way to tell if they are on fire or drowning?

gilded nova
#

I just assumed thats what you meant

#

OH

#

Youll have to check if they are under water first

#

no

#

nvm

deft thistle
#

why

#

if they are under water

gilded nova
#
DamageCause cause = e.getEntity().getLastDamageCause().getCause();
    if(cause == DamageCause.DROWNING){
         //set death message      
}```
#

That was on spigot forums

deft thistle
#

pog

rigid widget
#

What why would use a random number generator instead of just using Random Tim

#

Owait your article seems to be about that and I just misread

#

Soz

deft thistle
gilded nova
#

No you can just add that if

#

do this

deft thistle
#

dang

gilded nova
#

I'll give an example

#

wait

deft thistle
#

that wouldnt work

#

i can make multiple ifs for the different damage

gilded nova
#
DamageCause cause = e.getEntity().getLastDamageCause().getCause();
    if(cause == DamageCause.DROWNING){
         //drowing death message      
    } else {
    //death message for normal death
}```
#

Ignore the last one

deft thistle
#

i wouldnt need an else

gilded nova
#

you can use else ifs

#

if you want to add more

#

or use switch cases

#

idk

deft thistle
#

why not just multiple ifs for each damage type

#

like by player or cactus or lava

#

or something

#

i can put it all in the config

gilded nova
#

I mean yeah sure lol

#

it doesnt matter

topaz palm
#

im so bored ๐Ÿ˜”

gilded nova
#

Same

tight chasm
#

someone have a restart script? We are using mc host a root server so when the root server restarts the mc server is not restarting so i dont find a guide for stupid peoples like me with step for step thats root server is restart after they start instant the mc server

gilded nova
#

What?

#

I saw that LOL

modest compass
#

which discord is that?

gilded nova
#

Spigot

clever swan
#

how do I make it so diamonds don't drop from diamond_ore?

potent prawn
#

you monster

clever swan
#

setDropItems(false);?

leaden terrace
#

hello

#

goodbye

clever swan
#

event.getBlock().setType(Material.AIR); would this work?

gilded nova
#

Nope, that would replace the block with air, but the items will still probably drop

#

setDropItems(false);?
and yes, that would work

clever swan
#

alright thank you

#
    public void giveItems(Player player) {
        ItemStack item = new ItemStack(Material.DOUBLE_PLANT, 1);
        ItemMeta meta = item.getItemMeta();
        
        meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Miner Shard");
        ArrayList<String> lore = new ArrayList<String>();
        lore.add(ChatColor.WHITE + "");
        lore.add(ChatColor.WHITE + "This is a Miner Shard Used To Craft");
        lore.add(ChatColor.WHITE + "Pieces Of The Miner Armor");
        meta.setLore(lore);
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        item.setItemMeta(meta);
        
        player.getInventory().addItem(item);
    }
}

This is my current code, no errors, just want to know how I can implement a % chance of the player receiving the drop

gilded nova
#

how much math you know?

modest compass
#

you can use the Math.random() module and calculate chance

clever swan
#

a good amount of math

#

wtf

#

math.random?

modest compass
#

i think

clever swan
#

why not math.(50) or something similar?

modest compass
#

wot

clever swan
#

idk

#

i never heard of math.Random

rigid widget
#

it's a way to get rando numbs

modest compass
clever swan
#

ok ty

#

oh no

#

this is scary

rigid widget
#

not really

#

one second

gilded nova
#
if (Math.random() >= 0.1) {
  event.setDropItems(false);
}
modest compass
#

how is that scary lol

gilded nova
#

10% chance of getting the items

clever swan
#

oh

#

cool

#

will I need a new public void for this?

modest compass
#

up to you tbh

deft thistle
#

how the heck am i supposed to put this in an if statement

    if(cause == DamageCause.DROWNING){
         //drowing death message      
    } else {
    //death message for normal death
}```
modest compass
#

if you want to reuse the code for something else, you should make it into a new method

clever swan
#

ok

deft thistle
rigid widget
#

or, depending on how much it is called or if just at runtime, use something like

private final Random randomGen = new Random

//then, later:

if (randomGen.nextInt(boundary) == 1) {
//do things
}
#

you can use any math there

#

nextInt will make a number within that bound

#

including 0 but not including the number the bound is

clever swan
#

i think java if (Math.random() >= 0.1) { event.setDropItems(false);
is better for what im using

#

one day ill be able to decipher this gibberish

rigid widget
#

up to you! one looks shorter, but if you're gonna have that called often, you'll probably want to make it earlier

#

and also

potent prawn
#

sharing a single line is not going to get very far

rigid widget
#

don't use eclipse

#

and that

potent prawn
#

^

deft thistle
#

^

modest compass
#

^

clever swan
#

^

#

im switching soon dw

#

after i make this plugin

rigid widget
#

no

#

bad idea

#

bad lizard

clever swan
#
package me.FlameDuder.DuderItems;

import java.util.ArrayList;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import net.md_5.bungee.api.ChatColor;

public class DuderItems implements Listener {
    
    public void giveItems(Player player) {
        ItemStack item = new ItemStack(Material.DOUBLE_PLANT, 1);
        ItemMeta meta = item.getItemMeta();
        
        meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Miner Shard");
        ArrayList<String> lore = new ArrayList<String>();
        lore.add(ChatColor.WHITE + "");
        lore.add(ChatColor.WHITE + "This is a Miner Shard Used To Craft");
        lore.add(ChatColor.WHITE + "Pieces Of The Miner Armor");
        meta.setLore(lore);
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        item.setItemMeta(meta);
        if (Math.random() >= 0.1) {
              event.setDropItems(false);
        player.getInventory().addItem(item);
    }
}
#

bad lizard
@rigid widget now?

rigid widget
#

bad lizard!

outer vesselBOT
#

Hey TheShinyLizard! Please don't tag helpful/staff members directly.

clever swan
#

i should switch now?

rigid widget
#

yeah

#

don't waste time

vast isle
#

put the event thing in your event listener instead

clever swan
#

๐Ÿ‘

rigid widget
#

IntelliJ will help not only with saving your poor eyeballs from that light curse

#

but also explains errors and points them out

potent prawn
#

well you haven't defined the event anywhere have you

rigid widget
#

I think they call that when the event happens, from another class

#

dunno why that class is implementing listener though

deft thistle
#

Intellij is cool

#

already made 2 plugins with it

#

granted they are tiny plugins

vast isle
#

๐Ÿคท why not just make one plugin

deft thistle
#

but still

#

because

potent prawn
#

because not everyone needs to become the next essentials

deft thistle
#

exactly

#
    if(cause == DamageCause.DROWNING){
         //drowing death message      
    } else {
    //death message for normal death
}```
#

how do i use this

misty cradle
#

like that

deft thistle
#

what is "DamageCause"

rigid widget
#

That's a thing

misty cradle
#

Likely information regarding a cause of damage

modest compass
#

means how the player died?

deft thistle
#

ik but like

#

how would i use it

#

i cant put it in an if

rigid widget
#

e in that example is for an event

misty cradle
#

you don't assign variables in an if

gilded nova
#

what is "DamageCause"

That's a thing

#

> That's a thing
Larry - 2020

rigid widget
#

cause is exactly what you put in the if, and it is an (instance?) of DamageCause

deft thistle
#

how would i include that

misty cradle
#

follow the code snippet you posted?

rigid widget
#

why are you using a d for an event ๐Ÿ˜ฉ

#

no matter

#

i will resist

deft thistle
#

"death"

misty cradle
#

also, that

#

it frightens me

rigid widget
#

"event"

clever swan
#
package me.FlameDuder.DuderItems;

import java.util.ArrayList;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import net.md_5.bungee.api.ChatColor;

public class DuderItems implements Listener {
    if (Math.random() >= 0.1) 
        event.setDropItems(false);
    
    public void giveItems(Player player) {
        ItemStack item = new ItemStack(Material.DOUBLE_PLANT, 1);
        ItemMeta meta = item.getItemMeta();
        
        meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Miner Shard");
        ArrayList<String> lore = new ArrayList<String>();
        lore.add(ChatColor.WHITE + "");
        lore.add(ChatColor.WHITE + "This is a Miner Shard Used To Craft");
        lore.add(ChatColor.WHITE + "Pieces Of The Miner Armor");
        meta.setLore(lore);
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        item.setItemMeta(meta);
        player.getInventory().addItem(item);
    }
}```
now what did I do wrong?
misty cradle
#

that if needs to be inside a method

gilded nova
#

why are you using a d for an event ๐Ÿ˜ฉ
why the orgasm emoji lol

rigid widget
#

that's... weary

vast isle
#

stop putting your whole method into another method

rigid widget
#

like... tired of this bs

deft thistle
#

i stil dont understand

rigid widget
#

like... why tf

gilded nova
#

that's the orgasm emoji, like, it's the popular definition

rigid widget
#

no

#

fight me

gilded nova
#

ill fite u

deft thistle
#

no

#

this is most likely wrong

misty cradle
#
@EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        // Your things

        EntityDamageEvent.DamageCause cause = event.getEntity().getLastDamageCause().getCause();
        if(cause == EntityDamageEvent.DamageCause.DROWNING) {
            event.setDeathMessage("XXX drank too much water");
        }
    }
#

since you didn't want to follow the code snippet telling you how to use it

rigid widget
#

you... have it there

#

the same thing

#

why

gilded nova
#

By the way

rigid widget
#

๐Ÿ˜ฉ

deft thistle
#

so i did it right?

misty cradle
#

yes

gilded nova
#

larry no

clever swan
#

๐Ÿ˜ฉ

gilded nova
#

stop

#

no

misty cradle
#

the snippet you were sending was correct

gilded nova
#

;-;

rigid widget
#

well kinda, except you didn't actually do anything when the damage cause was drowning

deft thistle
#

i want to make a custom message for each damage type

gilded nova
#

I suggest you make that private static Main plugin non-static instead

clever swan
#

can someone re-explain the math.random stuff? im still not quite picking it up

gilded nova
#

You'll learn over time that static should be used exclusively and not sparingly

rigid widget
#

@clever swan I can, but only my way

clever swan
#

go for it

deft thistle
#

ok

rigid widget
#
// the following makes a new Random called randomGen (it's what we can use later in a variety of ways)
private final Random randomGen = new Random();
//then, later:
//the following gets that Random, and uses the nextInt method, which generates a nearly perfectly random number within the boundary you give it and 0
// it will include 0, but not the actual boundary number
// you can use things like the nextBoolean method to make a random true/false, or you can use if .nextInt(2) == 1 and it's practically the same thing.
// the following gives a 1 in 10 chance (0-9) that it'll be a 1 that returns.
if (randomGen.nextInt(10) == 1) {
//do things
}

@clever swan

gilded nova
#

new Random();

#

๐Ÿ‘€

clever swan
#

new Random();?

rigid widget
#

yeahyeah

vast isle
#

new random is probably easier to understand tbf

clever swan
#

...

#

you're telling me this NOW

gilded nova
#

where it says

rigid widget
#

Easier to understand sure, less useful

clever swan
#

someone explain new Random() or send a link

gilded nova
#

private final Random randomGen = new Random should be private final Random randomGen = new Random();

rigid widget
#

yes

#

!

vast isle
#

he just explained it?

rigid widget
#

i know im trying to edit

gilded nova
#

no you're not

#

you're typing other messages

#

there you go

rigid widget
#

i know ๐Ÿ˜”

clever swan
#

he just explained it?
oh

gilded nova
#

okay, now go read the code block above

clever swan
#

it is time to try and absorb information

misty cradle
#

google is a really resourceful tool

rigid widget
#

I thought y'all were trying to tell them to generate a new random every time instead of making one

#

like what they had before

gilded nova
#

ew no

rigid widget
#
// the following makes a new Random called randomGen (it's what we can use later in a variety of ways) EDITED FOR FEFO CAUSE I SUCK
// !!!!!
private final Random randomGen = new Random();
//then, later:
//the following gets that Random, and uses the nextInt method, which generates a nearly perfectly random number within the boundary you give it and 0
// it will include 0, but not the actual boundary number
// you can use things like the nextBoolean method to make a random true/false, or you can use if .nextInt(2) == 1 and it's practically the same thing.
// the following gives a 1 in 10 chance (0-9) that it'll be a 1 that returns.
if (randomGen.nextInt(10) == 1) {
//do things
}
#

There

#

happy

vast isle
#

๐Ÿ˜ฉ

clever swan
#

thank you

misty cradle
#

I'm sensing some passive aggressiveness towards Fefo towards the end of that first comment

#

I could just be seeing things tho thonk

rigid widget
#

what? nooooo way!

#

๐Ÿ˜ฉ

gilded nova
#

happy
very much indeeed

clever swan
#

wait

#

guys

#

there is a problem

gilded nova
#

indeeeeeed

clever swan
#

I actually understand this

vast isle
#

orgasms galore

rigid widget
#

hey nice

clever swan
#

thats not how this works

#

usually i have a stroke

gilded nova
#

LMAO

misty cradle
#

welcome to learning how to code

rigid widget
#

At least I can finally explain something to someone properly in java - that was my first time too

misty cradle
#

continuous strokes until finally, it stops for 5 minutes

rigid widget
#

first time buddiees!

clever swan
#

it was very epic

rigid widget
#

๐Ÿ˜ฉ

gilded nova
#

seriously tho

rigid widget
#

(okay fefo, now it's fun to do this, cause it bugs u)

gilded nova
#

that emoji

#

I'll ban it from my computer

rigid widget
#

do you hate me now ๐Ÿ˜ฉ

clever swan
#

and im assuming the 10 represents 10%?

rigid widget
#

nope it'll make a number

gilded nova
#

10 means 10

#

lmao

rigid widget
#

between 0 and 9

clever swan
#

so it's 1/10?

rigid widget
#

and then check if the number it made was a one

#

so effectively 1 in 10 yes

vast isle
#

it just generates a random number from 0-9 and you're checking if it's 1 so it'll end up being a 1 in 10 chance

clever swan
#

ah nice

#

thank you

rigid widget
#

in reality I could also do:

if (randomGen.nextInt(10) == 7) {
//do things
}

and it would be the exact same thing

#

cause math

clever swan
#

wow

#

that is interesting

rigid widget
#

or:

if (randomGen.nextBoolean && randomGen.nextBoolean && randomGen.nextBoolean) {
//do things
}

would be a one in 8 chance kek

#

can u see why? That's your mickety mousety clubhousety task for today!

potent prawn
#

what the bloody hell is this

modest compass
#

larry doing java

rigid widget
potent prawn
#

sounds fucky

rigid widget
#

you what real fun math is

vast isle
#

how would that be a one in 8 chance ๐Ÿค”

misty cradle
#

2 * 2 * 2

rigid widget
#

the first one is .5, the second cuts that to .25 (1/4) and the third cuts that in half too (1/8)

#

all three have to be true

potent prawn
vast isle
#

ah i was doing different math in my head

potent prawn
#

one in 10 chance

#

ez

rigid widget
#
if (randomGen.nextBoolean || (randomGen.nextBoolean && randomGen.nextBoolean)) {
//do things
}
potent prawn
#

actually should have done <= but w/e

rigid widget
#

Now that's fun math

misty cradle
#

how many attempts did it take to get that to behave just for the picture? lmao

potent prawn
#

just once

gilded nova
#

you what real fun math is
Riemann-Zeta function for minecraft rng

potent prawn
#

lol

misty cradle
#

really?

#

now that's luck

potent prawn
#

yes

rigid widget
clever swan
#

(randomGen.nextInt(97) == 1)
Is this a 3% chance?

rigid widget
#

1/97

misty cradle
#

1/97

potent prawn
#

not really luck, it's just probability lol

misty cradle
#

damnit larry

#

beat me to it

clever swan
#

ok ty

rigid widget
#

0.0103 @clever swan

#

do 33, and then 1

clever swan
#

thank you

misty cradle
#

well, luck as in the probability played out exactly as intended

#

could also use nextDouble and compare <= 0.03

rigid widget
#

yep

#
if (randomGen.nextBoolean || (randomGen.nextBoolean && randomGen.nextBoolean)) {
//do things
}
deft thistle
#

does ENTITY_ATTACK include players?

rigid widget
#

anyone got the chances for this yet

#

@deft thistle try it and see :^)

deft thistle
#

ok

vast isle
#

is it 1/6

gilded nova
#

hey i gettimg some kind of problem can someone help me?

#

kicked whilst connecting to survival: you have to join through the proxy

vast isle
#

join through the bungeecord server

gilded nova
#

its my server im join through bungee but i having this

#

maybe i did some config mistake

vast isle
#

do you have your survival server listening on 25565 instead of bungeecord maybe?

gilded nova
#

idk

deft thistle
#

check

gilded nova
#

where i check it im configuring first time

vast isle
#

look in your survival server's server.properties

deft thistle
#
            if(event.getEntity().getKiller() != null) {
                event.setDeathMessage(Utils.chat((plugin.getConfig().getString("player_message").replace("<player>", killer.getDisplayName().replace(">player<", p.getDisplayName())))));
            }```
#

why doesnt this work?

rigid widget
#

What does ide say

deft thistle
#

it works

#

but not waht i want it to say

#

killer_message: '&1D&ca&3m&an &e>player< was just killed by &4&l<player>'

#

this is what i want it to say

rigid widget
#

Are you sure you're not just sending that message to the dead person only and just testing with the dead person

#

Strings don't appear out of nowhere you wrote that

deft thistle
#

i made it setDeathMessage

#

and it says that on the person i killed

rigid widget
#

Ok that seems intended

deft thistle
#

no listen

#

i wrote this

#

but it didnt say that

#

config also says that

#

OOHHHH

#

nvm

#

i found the issue

rigid widget
#

Yep...

deft thistle
#

i put "player_message"

#

not "killer_message"

rigid widget
#

Yep

misty cradle
#
killer.getDisplayName().replace(">player<", p.getDisplayName())
#

there's also this

deft thistle
#

idk if that would work

misty cradle
#

you're missing a ) before your second replace

rigid widget
#

Why get it twice tho lol

#

In one line

deft thistle
#

so it says this player was killed by this player

rigid widget
#

Oh I am on mobile and missed a comma

#

Carry on

deft thistle
#

rip

misty cradle
#

plugin.getConfig().getString("player_message").replace("<player>", killer.getDisplayName()).replace(">player<", p.getDisplayName()))));

deft thistle
misty cradle
#

tis the issue I just warned you about

#

you're missing a ) before your second replace request

#

so you're trying to change a placeholder on the player's display name rather than your actual target

deft thistle
#

where

#

confusion

misty cradle
#

so, two things

deft thistle
#

oh ic

misty cradle
#
  1. The line of code I posted fixed it
  2. Count the number of replace calls you make
gilded nova
#
if (randomGen.nextBoolean || (randomGen.nextBoolean && randomGen.nextBoolean)) {
//do things
}

anyone got the chances for this yet
@rigid widget I just read it but it's basically just a teeny tiny bit over 50%

#

62.5 if I'm not mistaken

deft thistle
#

there we go

#

but its all yellow

#

bruh

misty cradle
#

that is how you have it configured after all

deft thistle
#

yes

#

i fixed it

#

i think im done coding for today

gilded nova
#

You had a long run today

deft thistle
#

ya

rigid widget
#

@gilded nova why

gilded nova
#

Cause I said so

rigid widget
#

Smfh

deft thistle
#

hes not wrong

gilded nova
#

the very first Boolean takes 50% straight away

rigid widget
#

12 percent isn't a tiny bit

gilded nova
#

So that's 50% of chances it's true

rigid widget
#

Yea

gilded nova
#

Just from the very beginning

deft thistle
#

tomorrow ill learn guis

gilded nova
#

Then the other 50% is split into two 50% (so that makes it 25% for each one), and since both have to be true for it -> .5 * .5 = .25, but it's on the other 50% so we cut it in half making it 12.5

#
  • the other 50
#

62.5

#

I tend to mix between 0% - 100% and .0 to 1.0 lol

rigid widget
#

But.. it's an OR

gilded nova
#

That's why it adds

rigid widget
#

it could either be 50 or 25

#

ร“h

#

Addition

gilded nova
#

All of them can be true as well

rigid widget
#

No cause once the first is true it stops

gilded nova
#

There's a 1/8 chances of that happening

#

Well yeah but I mean, if all of them were generated before being evaluated

rigid widget
#

Ye

gilded nova
#

But yeah that's my final answer

#

Also

#

5/8 = .625

rigid widget
#

Ye

gilded nova
#

Had to learn truth tables, Boolean algebra and whatnot in hs

rigid widget
#

Truth tables suck

gilded nova
#

Very useful in my daily life

#

Lmao

rigid widget
#

I did philosophy truth tables

#

Not sure how similar

#

Mine sucked

misty cradle
#

why do those sound awful

gilded nova
#

Same thing but with ones and zeroes instead of premises lol

rigid widget
#

Mapping conditions with weird symbols is awful

#

B(insert three horizontal lines vertically stacked)A so C?

#

Answer: Because you can

#

It's all dumb

gilded nova
#

Them you start sticking arrows

#

Horizontal arrows

#

Reversed horizontal arrows

#

Vertical arrows

rigid widget
#

Meh honestly probably just ranting cause I had a dumb prof who made things dumb

#

Oh, screw off with the arrows ๐Ÿ˜ฉ

gilded nova
#

Oh god the emoji XD

deft thistle
#

orgasm

rigid widget
#

No

gilded nova
#

I'm p happy with what I learned about all that in hs since I did electronics and I really enjoyed it

misty cradle
#

someone with access to the server emojis needs to just re-add that one with it classified as orgasm just to mess with Larry even more

rigid widget
#

No please ty

gilded nova
#

Lmfao

rigid widget
#

It is WEARY

deft thistle
#

see

gilded nova
#

It's the orgasm emoji

rigid widget
#

as in FED UP WITH FEFO'S SHIT

gilded nova
#

Omg

#

AHAHAHAHA

deft thistle
#

thats called an ahegao

rigid widget
#

now I will sleep

#

Cause im

storm berry
#

i really need a block inspect/chest inspect/item inspect plugin

rigid widget
#

๐Ÿ˜ฉ

misty cradle
#

woah Larry chill

storm berry
#

where i can see the history of an item etc

gilded nova
#

๐Ÿ‘€

rigid widget
#

@storm berry coreprotect or prism

storm berry
#

is it for sponge?

misty cradle
#

ahh sponge

rigid widget
#

Not sure that's quite appropriate for this server @deft thistle mind deleting it so I don't have to :)

deft thistle
#

i mean its just a face but

#

ill make it a spoiler

gilded nova
#

lol

deft thistle
#

or not

rigid widget
#

Better yet, gone! ;)

#

Remember folks, discord is 13+ not 18A

gilded nova
#

Bye Larry ๐Ÿ˜ฉ

deft thistle
#

a face is not 18+

rigid widget
#

Bye fefo ๐Ÿ˜ฉ

deft thistle
#

oh god

misty cradle
#

a face can easily be 18+ when it is suggestive

rigid widget
#

And yeah @deft thistle it totally can be, simply see things like Instagram which will remove images of anything clearly depicting sexual acts

#

Nick's right on

deft thistle
#

hmm

gilded nova
#

||Are you alright mate||

misty cradle
#

let's just not test it shall we

deft thistle
#

||Are you alright mate||
@gilded nova ||no||

gilded nova
#

Fix yourself

deft thistle
potent prawn
#

how do you re spoil a spoiler

deft thistle
#

leave and come back into the chat

gilded nova
#

Lmao

potent prawn
#

thanks

deft thistle
gilded nova
#

||Muhammad is the type to message random girls on instagram saying "hey darling"||

deft thistle
#

i dont use insta

#

i have an acc

gilded nova
#

Facebook then

deft thistle
#

but i dont use that

#

i dnt use that either

gilded nova
#

Do people still use Facebook? . _.

deft thistle
#

i dont msg random girls either

gilded nova
#

Everyone uses facebook yeah

deft thistle
#

my parents

#

and grand parents

gilded nova
#

Everyone I know is on it lol

potent prawn
#

i use facebook lol

gilded nova
#

Exactly

#

Like, actively?

potent prawn
#

very

gilded nova
#

I do

#

. _.

#

Maybe its an aussie thing

#

Probs

potent prawn
#

only way for me to keep up with friends and family back home

gilded nova
#

NZ ๐Ÿคฎ

deft thistle
#

yep

#

facebook messenger

gilded nova
#

Messenger

deft thistle
#

my only use for facebook

#

oop

gilded nova
#

Facebook is great

#

Way better than instagram in my opinion

#

Ofc

potent prawn
#

eh, they have their uses

deft thistle
#

na

gilded nova
#

That I won't deny

deft thistle
#

twitter is better

potent prawn
#

i use insta if i'm feeling like a thot

gilded nova
#

lol

#

Mmm turbo has insta for when he feels like a thot

#

Imma note that down

deft thistle
#

pin that

#

u wont

gilded nova
#

Careful... that garage door behind you might warp when you photoshop that ass of yours to look bigger

potent prawn
#

lmao

gilded nova
#

Lol

deft thistle
#

i use twitter

gilded nova
#

You're weird

deft thistle
#

some people are toxic

gilded nova
#

Like you?

deft thistle
#

no

gilded nova
#

Some?

#

Literally all of Twitter is toxic lol

#

Why the fuck would you use twitter

deft thistle
#

Like you?
@gilded nova when have i been toxic

potent prawn
#

twitter is weird

deft thistle
#

because its better than insta and i dont use anything else

#

besides snapchat

gilded nova
#

No

#

I totally disagree

deft thistle
#

good

gilded nova
#

Except snapchat

#

thats good

deft thistle
#

its your opinion

#

snapchat is trash

potent prawn
#

god i hate snapchat

gilded nova
#

Facebook & Snap are the go to's

deft thistle
#

my streaks keep getting erased

#

and i then get them back

#

only for them to go again

gilded nova
#

Well stop messaging random girls saying "hey darling"

#

> god i hate snapchat
He'll be listening to your prayers

potent prawn
#

๐Ÿ˜ค

deft thistle
#

i dont msg girls

gilded nova
#

You do

#

I know you do

#

Same

deft thistle
#

i dont

gilded nova
#

You do

deft thistle
#

i dont

#

u do

gilded nova
#

Yeah

deft thistle
gilded nova
#

You don't message girls cause you're respectful.

deft thistle
#

bruh

#

being gay is haram

gilded nova
#

LMFAO

potent prawn
#

๐Ÿณ๏ธโ€๐ŸŒˆ

deft thistle
#

haram

#

against islam

gilded nova
#

So then I guess you upset Allah

potent prawn
#

such a silly belief

deft thistle
#

nope

gilded nova
#

literally

deft thistle
#

100% accurate

potent prawn
#

lol

#

ok don't talk to me then

gilded nova
#

Tim is a simp tho I'm sure

#

hm

#

Depends

#

no ๐Ÿ˜ข

#

That's a yes

deft thistle
#

im not homophobic i just dont support lgbt

gilded nova
#

Neither

#

but I wont voice that opinion

#

I'll get roasted

potent prawn
#

by me

#

cause i am gay

gilded nova
#

oh shet